#include "simple_paint.h" #include "simple_paint_util.h" #include #include #include #include #include #include #include /********************************** Images *****************************************/ static Ihandle* load_image_PaintZoomGrid(void) { unsigned char imgdata[] = { 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 110, 155, 223, 255, 255, 255, 255, 0, 255, 255, 255, 0, 106, 151, 219, 255, 255, 255, 255, 0, 255, 255, 255, 0, 95, 142, 210, 255, 255, 255, 255, 0, 255, 255, 255, 0, 84, 129, 201, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 110, 155, 223, 255, 255, 255, 255, 0, 255, 255, 255, 0, 102, 147, 217, 255, 255, 255, 255, 0, 255, 255, 255, 0, 92, 137, 207, 255, 255, 255, 255, 0, 255, 255, 255, 0, 80, 125, 197, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 110, 155, 223, 255, 110, 155, 223, 255, 107, 152, 222, 255, 104, 151, 219, 255, 103, 148, 216, 255, 100, 145, 213, 255, 97, 142, 210, 255, 93, 138, 206, 255, 88, 133, 203, 255, 84, 129, 201, 255, 80, 125, 197, 255, 76, 121, 193, 255, 72, 117, 189, 255, 68, 113, 183, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 106, 149, 219, 255, 255, 255, 255, 0, 255, 255, 255, 0, 97, 142, 210, 255, 255, 255, 255, 0, 255, 255, 255, 0, 84, 131, 199, 255, 255, 255, 255, 0, 255, 255, 255, 0, 72, 117, 187, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 103, 148, 216, 255, 255, 255, 255, 0, 255, 255, 255, 0, 92, 137, 207, 255, 255, 255, 255, 0, 255, 255, 255, 0, 81, 125, 196, 255, 255, 255, 255, 0, 255, 255, 255, 0, 68, 113, 185, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 104, 151, 219, 255, 104, 148, 216, 255, 100, 145, 213, 255, 97, 142, 210, 255, 92, 137, 207, 255, 88, 135, 203, 255, 84, 129, 199, 255, 80, 125, 195, 255, 76, 121, 193, 255, 70, 117, 189, 255, 68, 112, 183, 255, 62, 109, 181, 255, 60, 105, 177, 255, 57, 102, 174, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 97, 142, 210, 255, 255, 255, 255, 0, 255, 255, 255, 0, 84, 129, 199, 255, 255, 255, 255, 0, 255, 255, 255, 0, 72, 117, 187, 255, 255, 255, 255, 0, 255, 255, 255, 0, 60, 105, 177, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 93, 138, 206, 255, 255, 255, 255, 0, 255, 255, 255, 0, 80, 125, 195, 255, 255, 255, 255, 0, 255, 255, 255, 0, 66, 113, 185, 255, 255, 255, 255, 0, 255, 255, 255, 0, 56, 103, 173, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 95, 140, 212, 255, 92, 137, 207, 255, 88, 133, 203, 255, 84, 129, 199, 255, 80, 125, 195, 255, 76, 121, 193, 255, 72, 117, 187, 255, 68, 113, 185, 255, 64, 107, 181, 255, 59, 105, 178, 255, 55, 101, 174, 255, 53, 98, 170, 255, 49, 95, 168, 255, 48, 91, 165, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 84, 131, 199, 255, 255, 255, 255, 0, 255, 255, 255, 0, 70, 117, 189, 255, 255, 255, 255, 0, 255, 255, 255, 0, 60, 105, 177, 255, 255, 255, 255, 0, 255, 255, 255, 0, 49, 95, 168, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 82, 125, 195, 255, 255, 255, 255, 0, 255, 255, 255, 0, 68, 113, 185, 255, 255, 255, 255, 0, 255, 255, 255, 0, 57, 102, 174, 255, 255, 255, 255, 0, 255, 255, 255, 0, 46, 92, 165, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 84, 129, 199, 255, 80, 125, 195, 255, 76, 121, 191, 255, 72, 117, 189, 255, 66, 113, 185, 255, 64, 109, 181, 255, 60, 105, 177, 255, 55, 102, 174, 255, 52, 98, 171, 255, 49, 95, 168, 255, 46, 91, 166, 255, 44, 90, 163, 255, 42, 88, 161, 255, 42, 88, 161, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 72, 117, 187, 255, 255, 255, 255, 0, 255, 255, 255, 0, 60, 107, 177, 255, 255, 255, 255, 0, 255, 255, 255, 0, 50, 95, 167, 255, 255, 255, 255, 0, 255, 255, 255, 0, 42, 88, 161, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 68, 113, 185, 255, 255, 255, 255, 0, 255, 255, 255, 0, 56, 101, 173, 255, 255, 255, 255, 0, 255, 255, 255, 0, 46, 92, 165, 255, 255, 255, 255, 0, 255, 255, 255, 0, 42, 88, 161, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0 }; Ihandle* image = IupImageRGBA(16, 16, imgdata); return image; } static Ihandle* load_image_LogoTecgraf(void) { unsigned char imgdata[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 108, 120, 143, 125, 132, 148, 178, 173, 133, 149, 178, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 110, 130, 48, 130, 147, 177, 254, 124, 139, 167, 254, 131, 147, 176, 137, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 115, 128, 153, 134, 142, 159, 191, 194, 47, 52, 61, 110, 114, 128, 154, 222, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 143, 172, 192, 140, 156, 188, 99, 65, 69, 76, 16, 97, 109, 131, 251, 129, 144, 172, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 131, 147, 175, 232, 140, 157, 188, 43, 0, 0, 0, 0, 100, 112, 134, 211, 126, 141, 169, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 78, 88, 26, 48, 52, 57, 60, 135, 150, 178, 254, 108, 121, 145, 83, 105, 118, 142, 76, 106, 119, 143, 201, 118, 133, 159, 122, 117, 129, 152, 25, 168, 176, 190, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 118, 128, 145, 3, 104, 117, 140, 92, 114, 127, 152, 180, 131, 147, 177, 237, 133, 149, 178, 249, 38, 42, 50, 222, 137, 152, 180, 249, 126, 142, 170, 182, 114, 128, 154, 182, 104, 117, 140, 227, 95, 107, 128, 238, 83, 93, 112, 248, 84, 95, 113, 239, 104, 117, 141, 180, 115, 129, 155, 93, 127, 140, 165, 4, 98, 109, 130, 153, 109, 123, 147, 254, 145, 163, 195, 153, 138, 154, 182, 56, 115, 123, 138, 5, 92, 99, 109, 35, 134, 149, 177, 230, 0, 0, 0, 0, 0, 0, 0, 0, 120, 133, 159, 143, 135, 151, 181, 115, 86, 89, 93, 5, 41, 45, 51, 54, 40, 45, 53, 150, 107, 120, 144, 254, 122, 137, 164, 154, 51, 57, 66, 147, 83, 93, 112, 255, 108, 121, 145, 159, 113, 126, 151, 62, 123, 136, 159, 8, 87, 93, 103, 35, 125, 141, 169, 230, 0, 0, 0, 0, 0, 0, 0, 0, 129, 143, 169, 143, 140, 156, 184, 115, 134, 147, 172, 8, 124, 138, 165, 60, 124, 139, 167, 155, 131, 147, 177, 255, 131, 147, 176, 153, 64, 68, 73, 2, 36, 39, 45, 86, 41, 46, 54, 173, 60, 67, 80, 232, 75, 84, 101, 251, 89, 100, 120, 228, 105, 118, 142, 250, 110, 123, 148, 187, 118, 132, 158, 187, 126, 141, 169, 229, 134, 149, 177, 239, 136, 152, 179, 250, 136, 152, 181, 234, 139, 156, 186, 175, 130, 145, 173, 90, 124, 134, 151, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 71, 74, 79, 19, 60, 64, 73, 50, 92, 103, 124, 254, 86, 95, 111, 84, 90, 100, 117, 76, 126, 141, 168, 201, 113, 126, 150, 119, 99, 105, 117, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 93, 105, 125, 231, 135, 151, 181, 46, 0, 0, 0, 0, 137, 154, 184, 212, 123, 137, 164, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 74, 83, 98, 191, 133, 149, 179, 102, 111, 121, 139, 17, 134, 150, 180, 252, 126, 140, 166, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 48, 57, 132, 121, 136, 164, 197, 121, 135, 161, 115, 130, 146, 175, 221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 47, 52, 46, 87, 98, 118, 254, 126, 142, 170, 254, 124, 139, 166, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 78, 255, 255, 255, 241, 255, 255, 255, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 101, 255, 255, 255, 238, 255, 255, 255, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 78, 255, 255, 255, 241, 255, 255, 255, 77, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 101, 255, 255, 255, 238, 255, 255, 255, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 77, 255, 255, 255, 242, 255, 255, 255, 77, 255, 255, 255, 100, 255, 255, 255, 238, 255, 255, 255, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 77, 255, 255, 255, 244, 255, 255, 255, 240, 255, 255, 255, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 100, 255, 255, 255, 240, 255, 255, 255, 242, 255, 255, 255, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 101, 255, 255, 255, 238, 255, 255, 255, 57, 255, 255, 255, 77, 255, 255, 255, 242, 255, 255, 255, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 101, 255, 255, 255, 238, 255, 255, 255, 57, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 77, 255, 255, 255, 241, 255, 255, 255, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 101, 255, 255, 255, 238, 255, 255, 255, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 78, 255, 255, 255, 241,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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 95, 255, 255, 255, 156, 255, 255, 255, 156, 255, 255, 255, 156, 255, 255, 255, 156, 255, 255, 255, 156, 255, 255, 255, 156, 255, 255, 255, 156, 255, 255, 255, 156, 255, 255, 255, 156, 255, 255, 255, 156, 255, 255, 255, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 156, 255, 255, 255, 189, 255, 255, 255, 125, 255, 255, 255, 125, 255, 255, 255, 125, 255, 255, 255, 125, 255, 255, 255, 125, 255, 255, 255, 125, 255, 255, 255, 125, 255, 255, 255, 125, 255, 255, 255, 217, 255, 255, 255, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 156, 255, 255, 255, 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 181, 255, 255, 255, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 156, 255, 255, 255, 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 181, 255, 255, 255, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 156, 255, 255, 255, 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 181, 255, 255, 255, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 156, 255, 255, 255, 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 181, 255, 255, 255, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 156, 255, 255, 255, 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 181, 255, 255, 255, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 156, 255, 255, 255, 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 181, 255, 255, 255, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 156, 255, 255, 255, 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 181, 255, 255, 255, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 156, 255, 255, 255, 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 181, 255, 255, 255, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 156, 255, 255, 255, 203, 255, 255, 255, 153, 255, 255, 255, 153, 255, 255, 255, 153, 255, 255, 255, 153, 255, 255, 255, 153, 255, 255, 255, 153, 255, 255, 255, 153, 255, 255, 255, 153, 255, 255, 255, 225, 255, 255, 255, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 78, 255, 255, 255, 128, 255, 255, 255, 128, 255, 255, 255, 128, 255, 255, 255, 128, 255, 255, 255, 128, 255, 255, 255, 128, 255, 255, 255, 128, 255, 255, 255, 128, 255, 255, 255, 128, 255, 255, 255, 128, 255, 255, 255, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 64, 255, 255, 255, 156, 255, 255, 255, 156, 255, 255, 255, 156, 255, 255, 255, 156, 255, 255, 255, 156, 255, 255, 255, 156, 255, 255, 255, 156, 255, 255, 255, 156, 255, 255, 255, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 105, 255, 255, 255, 215, 255, 255, 255, 125, 255, 255, 255, 125, 255, 255, 255, 125, 255, 255, 255, 125, 255, 255, 255, 125, 255, 255, 255, 125, 255, 255, 255, 203, 255, 255, 255, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 64, 255, 255, 255, 105, 255, 255, 255, 166, 255, 255, 255, 208, 255, 255, 255, 105, 255, 255, 255, 105, 255, 255, 255, 105, 255, 255, 255, 105, 255, 255, 255, 105, 255, 255, 255, 31, 255, 255, 255, 153, 255, 255, 255, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 156, 255, 255, 255, 215, 255, 255, 255, 176, 255, 255, 255, 176, 255, 255, 255, 176, 255, 255, 255, 176, 255, 255, 255, 176, 255, 255, 255, 176, 255, 255, 255, 239, 255, 255, 255, 77, 255, 255, 255, 153, 255, 255, 255, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 156, 255, 255, 255, 125, 255, 255, 255, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 204, 255, 255, 255, 77, 255, 255, 255, 153, 255, 255, 255, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 156, 255, 255, 255, 125, 255, 255, 255, 1, 255, 255, 255, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 204, 255, 255, 255, 77, 255, 255, 255, 153, 255, 255, 255, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 156, 255, 255, 255, 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 204, 255, 255, 255, 77, 255, 255, 255, 153, 255, 255, 255, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 156, 255, 255, 255, 125, 255, 255, 255, 1, 255, 255, 255, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 204, 255, 255, 255, 77, 255, 255, 255, 153, 255, 255, 255, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 156, 255, 255, 255, 125, 255, 255, 255, 1, 255, 255, 255, 3, 255, 255, 255, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 205, 255, 255, 255, 219, 255, 255, 255, 235, 255, 255, 255, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 156, 255, 255, 255, 125, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 1, 255, 255, 255, 6, 255, 255, 255, 3, 255, 255, 255, 1, 255, 255, 255, 205, 255, 255, 255, 130, 255, 255, 255, 77, 255, 255, 255, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 156, 255, 255, 255, 203, 255, 255, 255, 153, 255, 255, 255, 153, 255, 255, 255, 153, 255, 255, 255, 153, 255, 255, 255, 153, 255, 255, 255, 153, 255, 255, 255, 235, 255, 255, 255, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 78, 255, 255, 255, 128, 255, 255, 255, 128, 255, 255, 255, 128, 255, 255, 255, 128, 255, 255, 255, 128, 255, 255, 255, 128, 255, 255, 255, 128, 255, 255, 255, 128, 255, 255, 255, 38, 0, 0, 0, 0, 0,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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 16, 255, 255, 255, 27, 255, 255, 255, 27, 255, 255, 255, 27, 255, 255, 255, 27, 255, 255, 255, 27, 255, 255, 255, 27, 255, 255, 255, 27, 255, 255, 255, 27, 255, 255, 255, 27, 255, 255, 255, 27, 255, 255, 255, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 151, 255, 255, 255, 247, 255, 255, 255, 247, 255, 255, 255, 247, 255, 255, 255, 247, 255, 255, 255, 247, 255, 255, 255, 247, 255, 255, 255, 247, 255, 255, 255, 247, 255, 255, 255, 247, 255, 255, 255, 247, 255, 255, 255, 124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 4, 255, 255, 255, 6, 255, 255, 255, 6, 255, 255, 255, 6, 255, 255, 255, 6, 255, 255, 255, 6, 255, 255, 255, 6, 255, 255, 255, 6, 255, 255, 255, 6, 255, 255, 255, 6, 255, 255, 255, 6, 255, 255, 255, 3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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; Ihandle* image = IupImageRGBA(22, 22, imgdata); return image; } static Ihandle* load_image_save(void) { unsigned char imgdata[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 71, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 89, 255, 255, 255, 210, 255, 255, 255, 76, 255, 255, 255, 76, 255, 255, 255, 76, 255, 255, 255, 148, 255, 255, 255, 201, 255, 255, 255, 76, 255, 255, 255, 76, 255, 255, 255, 76, 255, 255, 255, 76, 255, 255, 255, 76, 255, 255, 255, 160, 255, 255, 255, 189, 255, 255, 255, 76, 255, 255, 255, 76, 255, 255, 255, 76, 255, 255, 255, 194, 255, 255, 255, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 89, 255, 255, 255, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 102, 255, 255, 255, 178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 35, 255, 255, 255, 66, 255, 255, 255, 120, 255, 255, 255, 161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 133, 255, 255, 255, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 89, 255, 255, 255, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 102, 255, 255, 255, 178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 59, 255, 255, 255, 110, 255, 255, 255, 120, 255, 255, 255, 161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 133, 255, 255, 255, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 89, 255, 255, 255, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 102, 255, 255, 255, 178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 59, 255, 255, 255, 110, 255, 255, 255, 120, 255, 255, 255, 161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 133, 255, 255, 255, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 89, 255, 255, 255, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 102, 255, 255, 255, 178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 48, 255, 255, 255, 89, 255, 255, 255, 120, 255, 255, 255, 161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 133, 255, 255, 255, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 89, 255, 255, 255, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 102, 255, 255, 255, 185, 255, 255, 255, 23, 255, 255, 255, 23, 255, 255, 255, 23, 255, 255, 255, 23, 255, 255, 255, 23, 255, 255, 255, 132, 255, 255, 255, 161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 133, 255, 255, 255, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 89, 255, 255, 255, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 102, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 133, 255, 255, 255, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 89, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 21, 255, 255, 255, 56, 255, 255, 255, 57, 255, 255, 255, 59, 255, 255, 255, 59, 255, 255, 255, 59, 255, 255, 255, 59, 255, 255, 255, 59, 255, 255, 255, 59, 255, 255, 255, 59, 255, 255, 255, 58, 255, 255, 255, 56, 255, 255, 255, 40, 0, 0, 0, 0, 255, 255, 255, 133, 255, 255, 255, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 89, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 97, 255, 255, 255, 246, 255, 255, 255, 224, 255, 255, 255, 224, 255, 255, 255, 224, 255, 255, 255, 224, 255, 255, 255, 224, 255, 255, 255, 224, 255, 255, 255, 224, 255, 255, 255, 224, 255, 255, 255, 224, 255, 255, 255, 236, 255, 255, 255, 184, 0, 0, 0, 0, 255, 255, 255, 133, 255, 255, 255, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 89, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 97, 255, 255, 255, 184, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 97, 255, 255, 255, 184, 0, 0, 0, 0, 255, 255, 255, 133, 255, 255, 255, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 89, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 97, 255, 255, 255, 184, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 97, 255, 255, 255, 184, 0, 0, 0, 0, 255, 255, 255, 133, 255, 255, 255, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 89, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 97, 255, 255, 255, 184, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 97, 255, 255, 255, 184, 0, 0, 0, 0, 255, 255, 255, 133, 255, 255, 255, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 89, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 97, 255, 255, 255, 184, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 97, 255, 255, 255, 184, 0, 0, 0, 0, 255, 255, 255, 133, 255, 255, 255, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 89, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 97, 255, 255, 255, 188, 255, 255, 255, 15, 255, 255, 255, 15, 255, 255, 255, 15, 255, 255, 255, 15, 255, 255, 255, 15, 255, 255, 255, 15, 255, 255, 255, 15, 255, 255, 255, 15, 255, 255, 255, 15, 255, 255, 255, 106, 255, 255, 255, 184, 0, 0, 0, 0, 255, 255, 255, 133, 255, 255, 255, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 89, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 97, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 184, 0, 0, 0, 0, 255, 255, 255, 133, 255, 255, 255, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 89, 255, 255, 255, 203, 255, 255, 255, 48, 255, 255, 255, 52, 255, 255, 255, 59, 255, 255, 255, 59, 255, 255, 255, 59, 255, 255, 255, 59, 255, 255, 255, 59, 255, 255, 255, 59, 255, 255, 255, 59, 255, 255, 255, 59, 255, 255, 255, 59, 255, 255, 255, 59, 255, 255, 255, 59, 255, 255, 255, 56, 255, 255, 255, 48, 255, 255, 255, 156, 255, 255, 255, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 81, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; Ihandle* image = IupImageRGBA(22, 22, imgdata); return image; } static Ihandle* load_image_saveas(void) { unsigned char imgdata[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 71, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 89, 255, 255, 255, 210, 255, 255, 255, 76, 255, 255, 255, 76, 255, 255, 255, 76, 255, 255, 255, 148, 255, 255, 255, 201, 255, 255, 255, 76, 255, 255, 255, 76, 255, 255, 255, 76, 255, 255, 255, 76, 255, 255, 255, 76, 255, 255, 255, 160, 255, 255, 255, 189, 255, 255, 255, 76, 255, 255, 255, 76, 255, 255, 255, 76, 255, 255, 255, 194, 255, 255, 255, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 89, 255, 255, 255, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 102, 255, 255, 255, 178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 35, 255, 255, 255, 66, 255, 255, 255, 120, 255, 255, 255, 161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 133, 255, 255, 255, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 89, 255, 255, 255, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 102, 255, 255, 255, 178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 59, 255, 255, 255, 110, 255, 255, 255, 120, 255, 255, 255, 161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 128, 255, 255, 255, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 89, 255, 255, 255, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 102, 255, 255, 255, 178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 59, 255, 255, 255, 110, 255, 255, 255, 120, 255, 255, 255, 158, 255, 255, 255, 1, 255, 255, 255, 105, 255, 255, 255, 155, 255, 255, 255, 23, 255, 255, 255, 150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 89, 255, 255, 255, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 102, 255, 255, 255, 178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 35, 255, 255, 255, 65, 255, 255, 255, 63, 255, 255, 255, 37, 255, 255, 255, 169, 255, 255, 255, 225, 255, 255, 255, 230, 255, 255, 255, 99, 255, 255, 255, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 89, 255, 255, 255, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 102, 255, 255, 255, 185, 255, 255, 255, 23, 255, 255, 255, 23, 255, 255, 255, 23, 255, 255, 255, 19, 0, 0, 0, 0, 255, 255, 255, 53, 255, 255, 255, 220, 255, 255, 255, 177, 255, 255, 255, 19, 255, 255, 255, 67, 255, 255, 255, 243, 255, 255, 255, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 89, 255, 255, 255, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 102, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 246, 255, 255, 255, 224, 255, 255, 255, 58, 255, 255, 255, 112, 255, 255, 255, 242, 255, 255, 255, 113, 255, 255, 255, 1, 255, 255, 255, 22, 255, 255, 255, 183, 255, 255, 255, 216, 255, 255, 255, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 89, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 21, 255, 255, 255, 56, 255, 255, 255, 57, 255, 255, 255, 59, 255, 255, 255, 59, 255, 255, 255, 15, 255, 255, 255, 19, 255, 255, 255, 177, 255, 255, 255, 221, 255, 255, 255, 54, 0, 0, 0, 0, 255, 255, 255, 65, 255, 255, 255, 229, 255, 255, 255, 164, 255, 255, 255, 13, 255, 255, 255, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 89, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 97, 255, 255, 255, 246, 255, 255, 255, 224, 255, 255, 255, 223, 255, 255, 255, 110, 255, 255, 255, 60, 255, 255, 255, 225, 255, 255, 255, 171, 255, 255, 255, 15, 255, 255, 255, 3, 255, 255, 255, 128, 255, 255, 255, 241, 255, 255, 255, 98, 0, 0, 0, 0, 255, 255, 255, 103, 255, 255, 255, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 89, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 97, 255, 255, 255, 184, 0, 0, 0, 0, 255, 255, 255, 2, 255, 255, 255, 120, 255, 255, 255, 242, 255, 255, 255, 105, 0, 0, 0, 0, 255, 255, 255, 26, 255, 255, 255, 190, 255, 255, 255, 211, 255, 255, 255, 43, 255, 255, 255, 13, 0, 0, 0, 0, 255, 255, 255, 133, 255, 255, 255, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 89, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 97, 255, 255, 255, 140, 255, 255, 255, 1, 255, 255, 255, 132, 255, 255, 255, 248, 255, 255, 255, 50, 0, 0, 0, 0, 255, 255, 255, 72, 255, 255, 255, 232, 255, 255, 255, 156, 255, 255, 255, 10, 255, 255, 255, 58, 255, 255, 255, 171, 0, 0, 0, 0, 255, 255, 255, 133, 255, 255, 255, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 89, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 16, 255, 255, 255, 1, 255, 255, 255, 27, 255, 255, 255, 15, 255, 255, 255, 216, 255, 255, 255, 124, 255, 255, 255, 135, 255, 255, 255, 239, 255, 255, 255, 91, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 97, 255, 255, 255, 184, 0, 0, 0, 0, 255, 255, 255, 133, 255, 255, 255, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 89, 255, 255, 255, 191, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 11, 255, 255, 255, 49, 0, 0, 0, 0, 255, 255, 255, 48, 255, 255, 255, 246, 255, 255, 255, 205, 255, 255, 255, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 97, 255, 255, 255, 184, 0, 0, 0, 0, 255, 255, 255, 133, 255, 255, 255, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 89, 255, 255, 255, 191, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 129, 255, 255, 255, 207, 255, 255, 255, 25, 255, 255, 255, 26, 255, 255, 255, 77, 255, 255, 255, 9, 255, 255, 255, 15, 255, 255, 255, 15, 255, 255, 255, 15, 255, 255, 255, 15, 255, 255, 255, 106, 255, 255, 255, 184, 0, 0, 0, 0, 255, 255, 255, 133, 255, 255, 255, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 89, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 8, 255, 255, 255, 118, 255, 255, 255, 61, 255, 255, 255, 9, 0, 0, 0, 0, 255, 255, 255, 14, 255, 255, 255, 167, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 184, 0, 0, 0, 0, 255, 255, 255, 133, 255, 255, 255, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 89, 255, 255, 255, 203, 255, 255, 255, 48, 255, 255, 255, 48, 255, 255, 255, 10, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 30, 255, 255, 255, 52, 255, 255, 255, 59, 255, 255, 255, 59, 255, 255, 255, 59, 255, 255, 255, 59, 255, 255, 255, 59, 255, 255, 255, 59, 255, 255, 255, 56, 255, 255, 255, 48, 255, 255, 255, 156, 255, 255, 255, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 81, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 143, 0, 0, 0, 0, 255, 255, 255, 87, 255, 255, 255, 225, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 10, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 204, 255, 255, 255, 203, 255, 255, 255, 114, 0, 0, 0, 0, 255, 255, 255, 1, 255, 255, 255, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 13, 255, 255, 255, 255, 255, 255, 255, 85, 255, 255, 255, 76, 255, 255, 255, 76, 255, 255, 255, 76, 255, 255, 255, 76, 255, 255, 255, 235, 255, 255, 255, 182, 255, 255, 255, 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 13, 255, 255, 255, 255, 255, 255, 255, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 227, 255, 255, 255, 54, 255, 255, 255, 136, 255, 255, 255, 117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 13, 255, 255, 255, 255, 255, 255, 255, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 227, 255, 255, 255, 54, 255, 255, 255, 1, 255, 255, 255, 135, 255, 255, 255, 117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 13, 255, 255, 255, 255, 255, 255, 255, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 227, 255, 255, 255, 54, 0, 0, 0, 0, 255, 255, 255, 1, 255, 255, 255, 135, 255, 255, 255, 117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 13, 255, 255, 255, 255, 255, 255, 255, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 227, 255, 255, 255, 225, 255, 255, 255, 217, 255, 255, 255, 217, 255, 255, 255, 217, 255, 255, 255, 253, 255, 255, 255, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 13, 255, 255, 255, 255, 255, 255, 255, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 57, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 244, 255, 255, 255, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 13, 255, 255, 255, 255, 255, 255, 255, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 240, 255, 255, 255, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 13, 255, 255, 255, 255, 255, 255, 255, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 240, 255, 255, 255, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 13, 255, 255, 255, 255, 255, 255, 255, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 240, 255, 255, 255, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 13, 255, 255, 255, 255, 255, 255, 255, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 240, 255, 255, 255, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 13, 255, 255, 255, 255, 255, 255, 255, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 240, 255, 255, 255, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 13, 255, 255, 255, 255, 255, 255, 255, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 240, 255, 255, 255, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 13, 255, 255, 255, 255, 255, 255, 255, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 240, 255, 255, 255, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 13, 255, 255, 255, 255, 255, 255, 255, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 240, 255, 255, 255, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 13, 255, 255, 255, 255, 255, 255, 255, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 240, 255, 255, 255, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 13, 255, 255, 255, 255, 255, 255, 255, 32, 255, 255, 255, 20, 255, 255, 255, 20, 255, 255, 255, 20, 255, 255, 255, 20, 255, 255, 255, 20, 255, 255, 255, 20, 255, 255, 255, 20, 255, 255, 255, 20, 255, 255, 255, 20, 255, 255, 255, 241, 255, 255, 255, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 13, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 5, 255, 255, 255, 5, 255, 255, 255, 5, 255, 255, 255, 5, 255, 255, 255, 5, 255, 255, 255, 5, 255, 255, 255, 5, 255, 255, 255, 5, 255, 255, 255, 5, 255, 255, 255, 5, 255, 255, 255, 5, 255, 255, 255, 5, 255, 255, 255, 1, 0, 0, 0, 0, 0,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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 124, 255, 255, 255, 153, 255, 255, 255, 153, 255, 255, 255, 153, 255, 255, 255, 153, 255, 255, 255, 153, 255, 255, 255, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 207, 255, 255, 255, 164, 255, 255, 255, 128, 255, 255, 255, 128, 255, 255, 255, 128, 255, 255, 255, 128, 255, 255, 255, 128, 255, 255, 255, 128, 255, 255, 255, 128, 255, 255, 255, 128, 255, 255, 255, 128, 255, 255, 255, 128, 255, 255, 255, 128, 255, 255, 255, 127, 255, 255, 255, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 207, 255, 255, 255, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 133, 255, 255, 255, 153, 255, 255, 255, 153, 255, 255, 255, 153, 255, 255, 255, 153, 255, 255, 255, 153, 255, 255, 255, 153, 255, 255, 255, 204, 255, 255, 255, 181, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 207, 255, 255, 255, 74, 0, 0, 0, 0, 255, 255, 255, 30, 255, 255, 255, 48, 255, 255, 255, 48, 255, 255, 255, 48, 255, 255, 255, 48, 255, 255, 255, 48, 255, 255, 255, 48, 255, 255, 255, 48, 255, 255, 255, 48, 255, 255, 255, 48, 255, 255, 255, 152, 255, 255, 255, 195, 255, 255, 255, 48, 255, 255, 255, 48, 255, 255, 255, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 207, 255, 255, 255, 74, 255, 255, 255, 5, 255, 255, 255, 225, 255, 255, 255, 233, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 232, 255, 255, 255, 247, 255, 255, 255, 142, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 207, 255, 255, 255, 74, 255, 255, 255, 88, 255, 255, 255, 215, 255, 255, 255, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 3, 255, 255, 255, 7, 255, 255, 255, 230, 255, 255, 255, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 207, 255, 255, 255, 75, 255, 255, 255, 203, 255, 255, 255, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 98, 255, 255, 255, 210, 255, 255, 255, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 207, 255, 255, 255, 137, 255, 255, 255, 234, 255, 255, 255, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 2, 255, 255, 255, 209, 255, 255, 255, 97, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 207, 255, 255, 255, 237, 255, 255, 255, 132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 66, 255, 255, 255, 230, 255, 255, 255, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 207, 255, 255, 255, 246, 255, 255, 255, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 183, 255, 255, 255, 123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 207, 255, 255, 255, 157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 45, 255, 255, 255, 243, 255, 255, 255, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 207, 255, 255, 255, 224, 255, 255, 255, 209, 255, 255, 255, 209, 255, 255, 255, 209, 255, 255, 255, 209, 255, 255, 255, 209, 255, 255, 255, 209, 255, 255, 255, 209, 255, 255, 255, 209, 255, 255, 255, 209, 255, 255, 255, 209, 255, 255, 255, 209, 255, 255, 255, 230, 255, 255, 255, 124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 58, 255, 255, 255, 71, 255, 255, 255, 71, 255, 255, 255, 71, 255, 255, 255, 71, 255, 255, 255, 71, 255, 255, 255, 71, 255, 255, 255, 71, 255, 255, 255, 71, 255, 255, 255, 71, 255, 255, 255, 71, 255, 255, 255, 71, 255, 255, 255, 71, 255, 255, 255, 71, 255, 255, 255, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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0, 0, 0, 0, 0, 0, 0, 0 }; Ihandle* image = IupImageRGBA(22, 22, imgdata); return image; } static Ihandle* load_image_revert(void) { unsigned char imgdata[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 43, 255, 255, 255, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 17, 255, 255, 255, 143, 255, 255, 255, 251, 255, 255, 255, 74, 255, 255, 255, 34, 255, 255, 255, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 3, 255, 255, 255, 152, 255, 255, 255, 254, 255, 255, 255, 255, 255, 255, 255, 218, 255, 255, 255, 246, 255, 255, 255, 233, 255, 255, 255, 151, 255, 255, 255, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 70, 255, 255, 255, 214, 255, 255, 255, 14, 255, 255, 255, 5, 255, 255, 255, 55, 255, 255, 255, 150, 255, 255, 255, 243, 255, 255, 255, 128, 255, 255, 255, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 5, 255, 255, 255, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 38, 255, 255, 255, 205, 255, 255, 255, 171, 255, 255, 255, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 15, 255, 255, 255, 200, 255, 255, 255, 149, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 27, 255, 255, 255, 237, 255, 255, 255, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 121, 255, 255, 255, 185, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 6, 255, 255, 255, 55, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 54, 255, 255, 255, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 20, 255, 255, 255, 249, 255, 255, 255, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 62, 255, 255, 255, 240, 255, 255, 255, 65, 255, 255, 255, 86, 255, 255, 255, 240, 255, 255, 255, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 205, 255, 255, 255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 86, 255, 255, 255, 241, 255, 255, 255, 240, 255, 255, 255, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 165, 255, 255, 255, 117, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 60, 255, 255, 255, 204, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 86, 255, 255, 255, 241, 255, 255, 255, 240, 255, 255, 255, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 160, 255, 255, 255, 119, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 34, 255, 255, 255, 246, 255, 255, 255, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 62, 255, 255, 255, 240, 255, 255, 255, 65, 255, 255, 255, 86, 255, 255, 255, 240, 255, 255, 255, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 195, 255, 255, 255, 90, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 3, 255, 255, 255, 233, 255, 255, 255, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 6, 255, 255, 255, 61, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 60, 255, 255, 255, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 10, 255, 255, 255, 245, 255, 255, 255, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 151, 255, 255, 255, 150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 94, 255, 255, 255, 209, 255, 255, 255, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 42, 255, 255, 255, 243, 255, 255, 255, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 9, 255, 255, 255, 221, 255, 255, 255, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 128, 255, 255, 255, 205, 255, 255, 255, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 2, 255, 255, 255, 163, 255, 255, 255, 186, 255, 255, 255, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 5, 255, 255, 255, 171, 255, 255, 255, 200, 255, 255, 255, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 9, 255, 255, 255, 163, 255, 255, 255, 210, 255, 255, 255, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 5, 255, 255, 255, 149, 255, 255, 255, 237, 255, 255, 255, 121, 255, 255, 255, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 10, 255, 255, 255, 94, 255, 255, 255, 221, 255, 255, 255, 186, 255, 255, 255, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 64, 255, 255, 255, 188, 255, 255, 255, 249, 255, 255, 255, 205, 255, 255, 255, 165, 255, 255, 255, 160, 255, 255, 255, 195, 255, 255, 255, 245, 255, 255, 255, 209, 255, 255, 255, 96, 255, 255, 255, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 27, 255, 255, 255, 80, 255, 255, 255, 117, 255, 255, 255, 119, 255, 255, 255, 90, 255, 255, 255, 40, 255, 255, 255, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; Ihandle* image = IupImageRGBA(22, 22, imgdata); return image; } /*********************************** Utilities Methods **************************************/ void SimplePaint::UpdateImage(imImage* new_image, bool update_size) { file.SetImage(new_image); if (update_size) { Ihandle* size_lbl = IupGetDialogChild(dlg, "SIZELABEL"); IupSetfAttribute(size_lbl, "TITLE", "%d x %d px", file.GetImage()->width, file.GetImage()->height); canvas.ScrollUpdate(); } canvas.Update(); } void SimplePaint::UpdateFile() { Ihandle* size_lbl = IupGetDialogChild(dlg, "SIZELABEL"); if (file.GetFilename()) IupSetfAttribute(dlg, "TITLE", "%s - Simple Paint", str_filetitle(file.GetFilename())); else IupSetAttribute(dlg, "TITLE", "Untitled - Simple Paint"); IupSetfAttribute(size_lbl, "TITLE", "%d x %d px", file.GetImage()->width, file.GetImage()->height); /* reset zoom to 100% */ canvas.SetZoom(0); } void SimplePaint::CheckNewFile() { if (!file.GetImage()) { int width = IupConfigGetVariableIntDef(config, "NewImage", "Width", 640); int height = IupConfigGetVariableIntDef(config, "NewImage", "Height", 480); if (file.New(width, height)) UpdateFile(); } } void SimplePaint::OpenFile(const char* filename) { if (file.Open(filename)) { UpdateFile(); IupConfigRecentUpdate(config, filename); } } void SimplePaint::ToggleBarVisibility(Ihandle* item, Ihandle* bar) { if (IupGetInt(bar, "VISIBLE")) { IupSetAttribute(bar, "FLOATING", "YES"); IupSetAttribute(bar, "VISIBLE", "NO"); IupSetAttribute(item, "VALUE", "OFF"); } else { IupSetAttribute(bar, "FLOATING", "NO"); IupSetAttribute(bar, "VISIBLE", "YES"); IupSetAttribute(item, "VALUE", "ON"); } IupRefresh(bar); /* refresh the dialog layout */ } void SimplePaint::SelectFile(bool is_open) { const char* dir = IupConfigGetVariableStr(config, "MainWindow", "LastDirectory"); Ihandle* filedlg = IupFileDlg(); if (is_open) IupSetAttribute(filedlg, "DIALOGTYPE", "OPEN"); else { IupSetAttribute(filedlg, "DIALOGTYPE", "SAVE"); IupSetStrAttribute(filedlg, "FILE", file.GetFilename()); } IupSetAttribute(filedlg, "EXTFILTER", "Image Files|*.bmp;*.jpg;*.png;*.tif;*.tga|All Files|*.*|"); IupSetStrAttribute(filedlg, "DIRECTORY", dir); IupSetAttributeHandle(filedlg, "PARENTDIALOG", dlg); IupPopup(filedlg, IUP_CENTERPARENT, IUP_CENTERPARENT); if (IupGetInt(filedlg, "STATUS") != -1) { char* filename = IupGetAttribute(filedlg, "VALUE"); if (is_open) OpenFile(filename); else { if (file.SaveAsFile(filename)) { IupSetfAttribute(dlg, "TITLE", "%s - Simple Paint", str_filetitle(filename)); IupConfigRecentUpdate(config, filename); } } dir = IupGetAttribute(filedlg, "DIRECTORY"); IupConfigSetVariableStr(config, "MainWindow", "LastDirectory", dir); } IupDestroy(filedlg); } /********************************** Callbacks Methods *****************************************/ int SimplePaint::ZoomValueChangedCallback(Ihandle* val) { double zoom_index = IupGetDouble(val, "VALUE"); canvas.SetZoom(zoom_index); return IUP_DEFAULT; } int SimplePaint::DialogDropfilesCallback(Ihandle*, char* filename) { if (file.SaveCheck()) OpenFile(filename); return IUP_DEFAULT; } int SimplePaint::FileMenuOpenCallback(Ihandle*) { Ihandle* item_save = IupGetDialogChild(dlg, "ITEM_SAVE"); if (file.GetImageChanged()) IupSetAttribute(item_save, "ACTIVE", "YES"); else IupSetAttribute(item_save, "ACTIVE", "NO"); Ihandle* item_revert = IupGetDialogChild(dlg, "ITEM_REVERT"); if (file.GetImageChanged() && file.GetFilename()) IupSetAttribute(item_revert, "ACTIVE", "YES"); else IupSetAttribute(item_revert, "ACTIVE", "NO"); return IUP_DEFAULT; } int SimplePaint::EditMenuOpenCallback(Ihandle*) { Ihandle *clipboard = IupClipboard(); Ihandle *item_paste = IupGetDialogChild(dlg, "ITEM_PASTE"); if (!IupGetInt(clipboard, "IMAGEAVAILABLE")) IupSetAttribute(item_paste, "ACTIVE", "NO"); else IupSetAttribute(item_paste, "ACTIVE", "YES"); IupDestroy(clipboard); return IUP_DEFAULT; } int SimplePaint::ViewMenuOpenCallback(Ihandle*) { Ihandle* item_zoomgrid = IupGetDialogChild(dlg, "ITEM_ZOOMGRID"); if (canvas.GetZoomGrid()) IupSetAttribute(item_zoomgrid, "VALUE", "ON"); else IupSetAttribute(item_zoomgrid, "VALUE", "OFF"); Ihandle* item_toolbox = IupGetDialogChild(dlg, "ITEM_TOOLBOX"); if (toolbox.Visible()) IupSetAttribute(item_toolbox, "VALUE", "ON"); else IupSetAttribute(item_toolbox, "VALUE", "OFF"); Ihandle* item_toolbar = IupGetDialogChild(dlg, "ITEM_TOOLBAR"); Ihandle* toolbar = IupGetDialogChild(dlg, "TOOLBAR"); if (IupGetInt(toolbar, "VISIBLE")) IupSetAttribute(item_toolbar, "VALUE", "ON"); else IupSetAttribute(item_toolbar, "VALUE", "OFF"); Ihandle* item_statusbar = IupGetDialogChild(dlg, "ITEM_STATUSBAR"); Ihandle* statusbar = IupGetDialogChild(dlg, "STATUSBAR"); if (IupGetInt(statusbar, "VISIBLE")) IupSetAttribute(item_statusbar, "VALUE", "ON"); else IupSetAttribute(item_statusbar, "VALUE", "OFF"); return IUP_DEFAULT; } int SimplePaint::ConfigRecentCallback(Ihandle* ih) { if (file.SaveCheck()) { char* filename = IupGetAttribute(ih, "RECENTFILENAME"); OpenFile(filename); } return IUP_DEFAULT; } int SimplePaint::DialogMoveCallback(Ihandle* dlg, int x, int y) { int old_x = IupGetInt(dlg, "_OLD_X"); int old_y = IupGetInt(dlg, "_OLD_Y"); if (old_x == x && old_y == y) return IUP_DEFAULT; toolbox.MoveDialog(x - old_x, y - old_y); IupSetInt(dlg, "_OLD_X", x); IupSetInt(dlg, "_OLD_Y", y); return IUP_DEFAULT; } /********************************* SimplePaint Menu Item Callbacks Methods **************************/ int SimplePaint::ItemNewActionCallback(Ihandle*) { if (file.SaveCheck()) { int width = IupConfigGetVariableIntDef(config, "NewImage", "Width", 640); int height = IupConfigGetVariableIntDef(config, "NewImage", "Height", 480); if (IupGetParam("New Image", NULL, NULL, "Width: %i[1,]\nHeight: %i[1,]\n", &width, &height, NULL)) { IupConfigSetVariableInt(config, "NewImage", "Width", width); IupConfigSetVariableInt(config, "NewImage", "Height", height); file.New(width, height); UpdateFile(); } } return IUP_DEFAULT; } int SimplePaint::ItemOpenActionCallback(Ihandle*) { if (!file.SaveCheck()) return IUP_DEFAULT; SelectFile(true); return IUP_DEFAULT; } int SimplePaint::ItemSaveasActionCallback(Ihandle*) { SelectFile(false); return IUP_DEFAULT; } int SimplePaint::ItemSaveActionCallback(Ihandle* item_save) { if (!file.GetFilename()) ItemSaveasActionCallback(item_save); else { /* test again because in can be called using the hot key */ if (file.GetImageChanged()) file.SaveFile(); } return IUP_DEFAULT; } int SimplePaint::ItemRevertActionCallback(Ihandle*) { OpenFile(file.GetFilename()); return IUP_DEFAULT; } int SimplePaint::ItemPagesetupActionCallback(Ihandle*) { int margin_width = IupConfigGetVariableIntDef(config, "Print", "MarginWidth", 20); int margin_height = IupConfigGetVariableIntDef(config, "Print", "MarginHeight", 20); if (IupGetParam("Page Setup", NULL, NULL, "Margin Width (mm): %i[1,]\nMargin Height (mm): %i[1,]\n", &margin_width, &margin_height, NULL)) { IupConfigSetVariableInt(config, "Print", "MarginWidth", margin_width); IupConfigSetVariableInt(config, "Print", "MarginHeight", margin_height); } return IUP_DEFAULT; } int SimplePaint::ItemPrintActionCallback(Ihandle*) { char* title = IupGetAttribute(dlg, "TITLE"); int margin_width = IupConfigGetVariableIntDef(config, "Print", "MarginWidth", 20); int margin_height = IupConfigGetVariableIntDef(config, "Print", "MarginHeight", 20); canvas.Print(title, margin_width, margin_height); return IUP_DEFAULT; } int SimplePaint::ItemExitActionCallback(Ihandle*) { if (!file.SaveCheck()) return IUP_IGNORE; /* to abort the CLOSE_CB callback normal processing */ IupConfigSetVariableStr(config, "MainWindow", "Toolbox", toolbox.Visible() ? "ON" : "OFF"); if (toolbox.Visible()) toolbox.HideDialog(); /* manually hide it before the main dialog, because it is a child dialog */ file.Close(); IupConfigDialogClosed(config, dlg, "MainWindow"); IupConfigSave(config); IupDestroy(config); return IUP_CLOSE; } int SimplePaint::ItemCopyActionCallback(Ihandle*) { Ihandle *clipboard = IupClipboard(); IupSetAttribute(clipboard, "NATIVEIMAGE", NULL); /* clear clipboard first */ IupSetAttribute(clipboard, "NATIVEIMAGE", (char*)IupGetImageNativeHandle(file.GetImage())); IupDestroy(clipboard); return IUP_DEFAULT; } int SimplePaint::ItemPasteActionCallback(Ihandle*) { if (file.SaveCheck()) { Ihandle *clipboard = IupClipboard(); imImage* new_image = IupGetNativeHandleImage(IupGetAttribute(clipboard, "NATIVEIMAGE")); IupDestroy(clipboard); if (!new_image) { IupMessageError(NULL, "Invalid Clipboard Data"); return IUP_DEFAULT; } file.New(new_image); UpdateFile(); } return IUP_DEFAULT; } int SimplePaint::ItemBackgroundActionCallback(Ihandle*) { Ihandle* colordlg = IupColorDlg(); long background = canvas.GetBackground(); IupSetRGB(colordlg, "VALUE", cdRed(background), cdGreen(background), cdBlue(background)); IupSetAttributeHandle(colordlg, "PARENTDIALOG", dlg); IupPopup(colordlg, IUP_CENTERPARENT, IUP_CENTERPARENT); if (IupGetInt(colordlg, "STATUS") == 1) { const char* background_str = IupGetAttribute(colordlg, "VALUE"); IupConfigSetVariableStr(config, "Canvas", "Background", background_str); unsigned int ri, gi, bi; sscanf(background_str, "%u %u %u", &ri, &gi, &bi); canvas.SetBackground(cdEncodeColor((unsigned char)ri, (unsigned char)gi, (unsigned char)bi)); } IupDestroy(colordlg); return IUP_DEFAULT; } int SimplePaint::ItemZoomoutActionCallback(Ihandle*) { canvas.ZoomOut(); return IUP_DEFAULT; } int SimplePaint::ItemZoominActionCallback(Ihandle*) { canvas.ZoomIn(); return IUP_DEFAULT; } int SimplePaint::ItemActualsizeActionCallback(Ihandle*) { canvas.SetZoom(0); return IUP_DEFAULT; } int SimplePaint::DialogMinimizeCallback(Ihandle *ih) { Ihandle* dlg = IupGetDialog(ih); if (IupGetInt(dlg, "MINIMIZED")) IupSetAttribute(dlg, "PLACEMENT", NULL); else IupSetAttribute(dlg, "PLACEMENT", "MINIMIZED"); IupShow(dlg); return IUP_DEFAULT; } int SimplePaint::DialogMaximizeCallback(Ihandle *ih) { Ihandle* dlg = IupGetDialog(ih); if (IupGetInt(dlg, "MAXIMIZED")) { IupSetAttribute(dlg, "PLACEMENT", NULL); IupSetAttribute(ih, "IMAGE", "ImageMaximize"); } else { IupSetAttribute(dlg, "PLACEMENT", "MAXIMIZED"); IupSetAttribute(ih, "IMAGE", "ImageMaximize2"); } IupShow(dlg); return IUP_DEFAULT; } int SimplePaint::ItemZoomgridActionCallback(Ihandle*) { canvas.SetZoomGrid(canvas.GetZoomGrid() ? false : true); IupConfigSetVariableStr(config, "Canvas", "ZoomGrid", canvas.GetZoomGrid() ? "ON" : "OFF"); return IUP_DEFAULT; } int SimplePaint::ItemToolbarActionCallback(Ihandle* item_toolbar) { Ihandle* toolbar = IupGetDialogChild(dlg, "TOOLBAR"); ToggleBarVisibility(item_toolbar, toolbar); IupConfigSetVariableStr(config, "MainWindow", "Toolbar", IupGetAttribute(item_toolbar, "VALUE")); return IUP_DEFAULT; } int SimplePaint::ItemToolboxActionCallback(Ihandle*) { if (toolbox.Visible()) toolbox.HideDialog(); else toolbox.ShowDialog(); return IUP_DEFAULT; } int SimplePaint::ItemStatusbarActionCallback(Ihandle* item_statusbar) { Ihandle* statusbar = IupGetDialogChild(dlg, "STATUSBAR"); ToggleBarVisibility(item_statusbar, statusbar); IupConfigSetVariableStr(config, "MainWindow", "Statusbar", IupGetAttribute(item_statusbar, "VALUE")); return IUP_DEFAULT; } int SimplePaint::ItemResizeActionCallback(Ihandle*) { int height = file.GetImage()->height, width = file.GetImage()->width; int quality = IupConfigGetVariableIntDef(config, "Image", "ResizeQuality", 1); /* medium default */ if (!IupGetParam("Resize", NULL, NULL, "Width: %i[1,]\n" "Height: %i[1,]\n" "Quality: %l|low|medium|high|\n", &width, &height, &quality, NULL)) return IUP_DEFAULT; IupConfigSetVariableInt(config, "Image", "ResizeQuality", quality); imImage* new_image = imImageCreateBased(file.GetImage(), width, height, -1, -1); if (!new_image) { show_file_error(IM_ERR_MEM); return IUP_DEFAULT; } if (quality == 2) quality = 3; /* interpolation order can be 0, 1, and 3 */ imProcessResize(file.GetImage(), new_image, quality); UpdateImage(new_image, true); /* update size */ return IUP_DEFAULT; } int SimplePaint::ItemMirrorActionCallback(Ihandle*) { imImage* new_image = imImageClone(file.GetImage()); if (!new_image) { show_file_error(IM_ERR_MEM); return IUP_DEFAULT; } imProcessMirror(file.GetImage(), new_image); UpdateImage(new_image); return IUP_DEFAULT; } int SimplePaint::ItemFlipActionCallback(Ihandle*) { imImage* new_image = imImageClone(file.GetImage()); if (!new_image) { show_file_error(IM_ERR_MEM); return IUP_DEFAULT; } imProcessFlip(file.GetImage(), new_image); UpdateImage(new_image); return IUP_DEFAULT; } int SimplePaint::ItemRotate180ActionCallback(Ihandle*) { imImage* new_image = imImageClone(file.GetImage()); if (!new_image) { show_file_error(IM_ERR_MEM); return IUP_DEFAULT; } imProcessRotate180(file.GetImage(), new_image); UpdateImage(new_image); return IUP_DEFAULT; } int SimplePaint::ItemRotate90cwActionCallback(Ihandle*) { imImage* new_image = imImageCreateBased(file.GetImage(), file.GetImage()->height, file.GetImage()->width, -1, -1); if (!new_image) { show_file_error(IM_ERR_MEM); return IUP_DEFAULT; } imProcessRotate90(file.GetImage(), new_image, 1); UpdateImage(new_image, true); /* update size */ return IUP_DEFAULT; } int SimplePaint::ItemRotate90ccwActionCallback(Ihandle*) { imImage* new_image = imImageCreateBased(file.GetImage(), file.GetImage()->height, file.GetImage()->width, -1, -1); if (!new_image) { show_file_error(IM_ERR_MEM); return IUP_DEFAULT; } imProcessRotate90(file.GetImage(), new_image, -1); UpdateImage(new_image, true); /* update size */ return IUP_DEFAULT; } int SimplePaint::ItemNegativeActionCallback(Ihandle*) { imImage* new_image = imImageClone(file.GetImage()); if (!new_image) { show_file_error(IM_ERR_MEM); return IUP_DEFAULT; } imProcessNegative(file.GetImage(), new_image); UpdateImage(new_image); return IUP_DEFAULT; } static int brightcont_param_cb(Ihandle* dialog, int param_index, void* user_data) { Ihandle* dlg = (Ihandle*)user_data; if (param_index == 0 || param_index == 1) { imImage* image = (imImage*)IupGetAttribute(dlg, "ORIGINAL_IMAGE"); imImage* new_image = (imImage*)IupGetAttribute(dlg, "NEW_IMAGE"); SimplePaintFile* file = (SimplePaintFile*)IupGetAttribute(dlg, "PAINT_FILE"); SimplePaintCanvas* canvas = (SimplePaintCanvas*)IupGetAttribute(dlg, "PAINT_CANVAS"); Ihandle* brightness_shift_param = (Ihandle*)IupGetAttribute(dialog, "PARAM0"); Ihandle* contrast_factor_param = (Ihandle*)IupGetAttribute(dialog, "PARAM1"); #if IM_VERSION_NUMBER > 312000 double param[2] = { 0, 0 }; param[0] = IupGetDouble(brightness_shift_param, "VALUE"); param[1] = IupGetDouble(contrast_factor_param, "VALUE"); #else float param[2] = { 0, 0 }; param[0] = IupGetFloat(brightness_shift_param, "VALUE"); param[1] = IupGetFloat(contrast_factor_param, "VALUE"); #endif imProcessToneGamut(image, new_image, IM_GAMUT_BRIGHTCONT, param); file->SetImage(new_image, false); canvas->Update(); } else if (param_index != IUP_GETPARAM_INIT && param_index != IUP_GETPARAM_MAP) { /* restore original configuration */ SimplePaintFile* file = (SimplePaintFile*)IupGetAttribute(dlg, "PAINT_FILE"); SimplePaintCanvas* canvas = (SimplePaintCanvas*)IupGetAttribute(dlg, "PAINT_CANVAS"); imImage* image = (imImage*)IupGetAttribute(dlg, "ORIGINAL_IMAGE"); file->SetImage(image, false); IupSetAttribute(dlg, "ORIGINAL_IMAGE", NULL); IupSetAttribute(dlg, "NEW_IMAGE", NULL); IupSetAttribute(dlg, "PAINT_FILE", NULL); IupSetAttribute(dlg, "PAINT_CANVAS", NULL); if (param_index == IUP_GETPARAM_BUTTON2) /* cancel */ canvas->Update(); } return 1; } int SimplePaint::ItemBrightcontActionCallback(Ihandle*) { imImage* new_image = imImageClone(file.GetImage()); if (!new_image) { show_file_error(IM_ERR_MEM); return IUP_DEFAULT; } IupSetAttribute(dlg, "ORIGINAL_IMAGE", (char*)file.GetImage()); IupSetAttribute(dlg, "NEW_IMAGE", (char*)new_image); IupSetAttribute(dlg, "PAINT_FILE", (char*)&file); IupSetAttribute(dlg, "PAINT_CANVAS", (char*)&canvas); #if IM_VERSION_NUMBER > 312000 double param[2] = { 0, 0 }; if (!IupGetParam("Brightness and Contrast", brightcont_param_cb, dlg, "Brightness Shift: %R[-100,100]\n" "Contrast Factor: %R[-100,100]\n", #else float param[2] = { 0, 0 }; if (!IupGetParam("Brightness and Contrast", brightcont_param_cb, dlg, "Brightness Shift: %r[-100,100]\n" "Contrast Factor: %r[-100,100]\n", #endif ¶m[0], ¶m[1], NULL)) { imImageDestroy(new_image); return IUP_DEFAULT; } /* since the image was already processed in preview we don't need to process it again, but leave it here to illustrate the logic */ imProcessToneGamut(file.GetImage(), new_image, IM_GAMUT_BRIGHTCONT, param); UpdateImage(new_image); return IUP_DEFAULT; } int SimplePaint::ItemHelpActionCallback(Ihandle*) { IupHelp("http://www.tecgraf.puc-rio.br/iup"); return IUP_DEFAULT; } static int bt_ok_action_cb(Ihandle*) { return IUP_CLOSE; } static int bt_sysinfo_action_cb(Ihandle*) { char sysinfo[10240]; int o = 0; o += sprintf(sysinfo + o, "------- System Information -------\n\n"); o += sprintf(sysinfo + o, "IUP %s %s\n\n", IupVersion(), IUP_COPYRIGHT); o += sprintf(sysinfo + o, " System: %s\n", IupGetGlobal("SYSTEM")); o += sprintf(sysinfo + o, " System Version: %s\n", IupGetGlobal("SYSTEMVERSION")); char* motif = IupGetGlobal("MOTIFVERSION"); if (motif) o += sprintf(sysinfo + o, " Motif Version: %s\n", motif); char* gtk = IupGetGlobal("GTKVERSION"); if (gtk) o += sprintf(sysinfo + o, " GTK Version: %s\n", gtk); o += sprintf(sysinfo + o, "\n Screen Size: %s\n", IupGetGlobal("SCREENSIZE")); o += sprintf(sysinfo + o, " Screen Depth: %s\n", IupGetGlobal("SCREENDEPTH")); char* opengl = IupGetGlobal("GL_VERSION"); if (opengl) { o += sprintf(sysinfo + o, "\n OpenGL Version: %s\n", opengl); o += sprintf(sysinfo + o, " OpenGL Vendor: %s\n", IupGetGlobal("GL_VENDOR")); o += sprintf(sysinfo + o, " OpenGL Renderer: %s\n", IupGetGlobal("GL_RENDERER")); } o += sprintf(sysinfo + o, "\nIM %s %s\n", imVersion(), IM_COPYRIGHT); o += sprintf(sysinfo + o, "\nCD %s %s\n", cdVersion(), CD_COPYRIGHT); IupGetText("System Information", sysinfo, 10240); return IUP_DEFAULT; } int SimplePaint::ItemAboutActionCallback(Ihandle* ih) { Ihandle *bt_ok, *vbox, *dlg_about, *lbl, *bt_sysinfo, *txt; lbl = IupLabel(NULL); IupSetAttribute(lbl, "IMAGE", "SPLASH"); bt_ok = IupButton("OK", NULL); IupSetAttribute(bt_ok, "PADDING", "6X3"); IupSetCallback(bt_ok, "ACTION", bt_ok_action_cb); bt_sysinfo = IupButton("SysInfo", NULL); IupSetAttribute(bt_sysinfo, "PADDING", "6X3"); IupSetCallback(bt_sysinfo, "ACTION", bt_sysinfo_action_cb); vbox = IupVbox( lbl, IupSetAttributes(IupLabel("Simple Paint 1.2"), "FONT=\"Helvetica, Bold 14\""), IupLabel("Copyright © 1995-2015 Tecgraf/PUC-Rio"), txt = IupSetAttributes(IupText(NULL), "READONLY=Yes, BORDER=NO, VALUE=\"iup@tecgraf.puc-rio.br\", VISIBLECOLUMNS=12, ALIGNMENT=ACENTER"), IupSetAttributes(IupLabel(NULL), "SEPARATOR=Horizontal"), IupSetAttributes(IupHbox(bt_sysinfo, IupFill(), bt_ok, NULL), "MARGIN=10x10"), NULL); IupSetAttribute(vbox, "ALIGNMENT", "ACENTER"); IupSetAttribute(vbox, "MARGIN", "5x5"); IupSetAttribute(vbox, "GAP", "5"); IupSetAttribute(vbox, "FONT", "Helvetica, 12"); dlg_about = IupDialog(vbox); IupSetAttribute(dlg_about, "TITLE", "About"); IupSetAttribute(dlg_about, "RESIZE", "NO"); IupSetAttribute(dlg_about, "MINBOX", "NO"); IupSetAttribute(dlg_about, "MAXBOX", "NO"); IupSetAttribute(dlg_about, "MENUBOX", "NO"); IupSetAttributeHandle(dlg_about, "DEFAULTENTER", bt_ok); IupSetAttributeHandle(dlg_about, "DEFAULTESC", bt_ok); IupSetAttributeHandle(dlg_about, "PARENTDIALOG", IupGetDialog(ih)); IupSetStrAttribute(txt, "BGCOLOR", IupGetAttribute(dlg_about, "BGCOLOR")); IupPopup(dlg_about, IUP_CENTERPARENT, IUP_CENTERPARENT); IupDestroy(dlg_about); return IUP_DEFAULT; } /********************************** Main *****************************************/ Ihandle* SimplePaint::CreateFileTab() { Ihandle *toolbar; Ihandle *btn_copy, *btn_paste, *btn_new, *btn_open, *btn_save, *btn_saveas, *btn_revert, *btn_zoomgrid; btn_new = IupFlatButton(NULL); IupSetAttribute(btn_new, "IMAGE", "IUP_FileNew"); IupSetAttribute(btn_new, "FLAT", "Yes"); IUP_CLASS_SETCALLBACK(btn_new, "FLAT_ACTION", ItemNewActionCallback); IupSetAttribute(btn_new, "TIP", "New (Ctrl+N)"); IupSetAttribute(btn_new, "CANFOCUS", "No"); btn_open = IupFlatButton(NULL); IupSetAttribute(btn_open, "IMAGE", "IUP_FileOpen"); IupSetAttribute(btn_open, "FLAT", "Yes"); IUP_CLASS_SETCALLBACK(btn_open, "FLAT_ACTION", ItemOpenActionCallback); IupSetAttribute(btn_open, "TIP", "Open (Ctrl+O)"); IupSetAttribute(btn_open, "CANFOCUS", "No"); btn_save = IupFlatButton(NULL); IupSetAttribute(btn_save, "IMAGE", "IUP_FileSave"); IupSetAttribute(btn_save, "FLAT", "Yes"); IUP_CLASS_SETCALLBACK(btn_save, "FLAT_ACTION", ItemSaveActionCallback); IupSetAttribute(btn_save, "TIP", "Save (Ctrl+S)"); IupSetAttribute(btn_save, "CANFOCUS", "No"); btn_saveas = IupFlatButton("Save As"); //IupSetAttribute(btn_saveas, "IMAGE", "IUP_FileSave"); IupSetAttribute(btn_saveas, "FLAT", "Yes"); IUP_CLASS_SETCALLBACK(btn_saveas, "FLAT_ACTION", ItemSaveasActionCallback); IupSetAttribute(btn_saveas, "TIP", "Save As"); IupSetAttribute(btn_saveas, "CANFOCUS", "No"); btn_revert = IupFlatButton(NULL); IupSetAttribute(btn_revert, "IMAGE", "IUP_EditUndo"); IupSetAttribute(btn_revert, "FLAT", "Yes"); IUP_CLASS_SETCALLBACK(btn_revert, "FLAT_ACTION", ItemRevertActionCallback); IupSetAttribute(btn_revert, "TIP", "Save As"); IupSetAttribute(btn_revert, "CANFOCUS", "No"); btn_copy = IupFlatButton(NULL); IupSetAttribute(btn_copy, "IMAGE", "IUP_EditCopy"); IupSetAttribute(btn_copy, "FLAT", "Yes"); IUP_CLASS_SETCALLBACK(btn_copy, "FLAT_ACTION", ItemCopyActionCallback); IupSetAttribute(btn_copy, "TIP", "Copy (Ctrl+C)"); IupSetAttribute(btn_copy, "CANFOCUS", "No"); btn_paste = IupFlatButton(NULL); IupSetAttribute(btn_paste, "IMAGE", "IUP_EditPaste"); IupSetAttribute(btn_paste, "FLAT", "Yes"); IUP_CLASS_SETCALLBACK(btn_paste, "FLAT_ACTION", ItemPasteActionCallback); IupSetAttribute(btn_paste, "TIP", "Paste (Ctrl+V)"); IupSetAttribute(btn_paste, "CANFOCUS", "No"); btn_zoomgrid = IupFlatButton(NULL); IupSetAttribute(btn_zoomgrid, "IMAGE", "PaintZoomGrid"); IupSetAttribute(btn_zoomgrid, "FLAT", "Yes"); IUP_CLASS_SETCALLBACK(btn_zoomgrid, "FLAT_ACTION", ItemZoomgridActionCallback); IupSetAttribute(btn_zoomgrid, "TIP", "Zoom Grid"); IupSetAttribute(btn_zoomgrid, "CANFOCUS", "No"); toolbar = IupHbox( btn_new, btn_open, btn_save, btn_saveas, btn_revert, IupSetAttributes(IupFlatSeparator(), "ORIENTATION=VERTICAL"), btn_copy, btn_paste, IupSetAttributes(IupFlatSeparator(), "ORIENTATION=VERTICAL"), btn_zoomgrid, IupFill(), NULL); IupSetAttribute(toolbar, "MARGIN", "5x5"); IupSetAttribute(toolbar, "GAP", "2"); IupSetAttribute(toolbar, "NAME", "TOOLBAR"); IupSetAttribute(toolbar, "TABTITLE", "FILE"); return toolbar; } Ihandle* SimplePaint::CreateEditTab() { Ihandle *toolbar; Ihandle *btn_copy, *btn_paste; btn_copy = IupFlatButton(NULL); IupSetAttribute(btn_copy, "IMAGE", "IUP_EditCopy"); IupSetAttribute(btn_copy, "FLAT", "Yes"); IUP_CLASS_SETCALLBACK(btn_copy, "FLAT_ACTION", ItemCopyActionCallback); IupSetAttribute(btn_copy, "TIP", "Copy (Ctrl+C)"); IupSetAttribute(btn_copy, "CANFOCUS", "No"); btn_paste = IupFlatButton(NULL); IupSetAttribute(btn_paste, "IMAGE", "IUP_EditPaste"); IupSetAttribute(btn_paste, "FLAT", "Yes"); IUP_CLASS_SETCALLBACK(btn_paste, "FLAT_ACTION", ItemPasteActionCallback); IupSetAttribute(btn_paste, "TIP", "Open (Ctrl+V)"); IupSetAttribute(btn_paste, "CANFOCUS", "No"); toolbar = IupHbox( btn_copy, btn_paste, IupFill(), NULL); IupSetAttribute(toolbar, "MARGIN", "5x5"); IupSetAttribute(toolbar, "GAP", "2"); IupSetAttribute(toolbar, "NAME", "TOOLBAR"); IupSetAttribute(toolbar, "TABTITLE", "EDIT"); return toolbar; } Ihandle* SimplePaint::CreateViewTab() { Ihandle *toolbar; Ihandle *btn_zoomin, *btn_zoomout, *btn_actualsize, *btn_zoomgrid, *btn_background, *btn_toolbox, *btn_statusbar; IupSetHandle("PaintZoomGrid", load_image_PaintZoomGrid()); btn_zoomin = IupFlatButton(NULL); IupSetAttribute(btn_zoomin, "IMAGE", "IUP_ZoomIn"); IUP_CLASS_SETCALLBACK(btn_zoomin, "FLAT_ACTION", ItemZoominActionCallback); IupSetAttribute(btn_zoomin, "TIP", "Zoom In (Ctrl++)"); IupSetAttribute(btn_zoomin, "CANFOCUS", "No"); btn_zoomout = IupFlatButton(NULL); IupSetAttribute(btn_zoomout, "IMAGE", "IUP_ZoomOut"); IUP_CLASS_SETCALLBACK(btn_zoomout, "FLAT_ACTION", ItemZoomoutActionCallback); IupSetAttribute(btn_zoomout, "TIP", "Open (Ctrl+-)"); IupSetAttribute(btn_zoomout, "CANFOCUS", "No"); btn_actualsize = IupFlatButton(NULL); IupSetAttribute(btn_actualsize, "IMAGE", "IUP_ZoomActualSize"); IUP_CLASS_SETCALLBACK(btn_actualsize, "FLAT_ACTION", ItemActualsizeActionCallback); IupSetAttribute(btn_actualsize, "TIP", "Actual Size (Ctrl+0)"); IupSetAttribute(btn_actualsize, "CANFOCUS", "No"); btn_zoomgrid = IupFlatButton("Zoom Grid"); IupSetAttribute(btn_zoomgrid, "IMAGE", "PaintZoomGrid"); IUP_CLASS_SETCALLBACK(btn_zoomgrid, "FLAT_ACTION", ItemZoomgridActionCallback); IupSetAttribute(btn_zoomgrid, "TIP", "Zoom Grid"); IupSetAttribute(btn_zoomgrid, "CANFOCUS", "No"); btn_background = IupFlatButton("Background"); IUP_CLASS_SETCALLBACK(btn_background, "FLAT_ACTION", ItemBackgroundActionCallback); IupSetAttribute(btn_background, "TIP", "Save As"); IupSetAttribute(btn_background, "CANFOCUS", "No"); btn_toolbox = IupFlatButton("Toolbox"); IUP_CLASS_SETCALLBACK(btn_toolbox, "FLAT_ACTION", ItemToolboxActionCallback); IupSetAttribute(btn_toolbox, "TIP", "Toolbox"); IupSetAttribute(btn_toolbox, "CANFOCUS", "No"); btn_statusbar = IupFlatButton("Status Bar"); IUP_CLASS_SETCALLBACK(btn_statusbar, "FLAT_ACTION", ItemStatusbarActionCallback); IupSetAttribute(btn_statusbar, "TIP", "Status Bar"); IupSetAttribute(btn_statusbar, "CANFOCUS", "No"); toolbar = IupHbox( btn_zoomin, btn_zoomout, btn_actualsize, btn_zoomgrid, IupSetAttributes(IupFlatSeparator(), "ORIENTATION=VERTICAL"), btn_background, IupSetAttributes(IupFlatSeparator(), "ORIENTATION=VERTICAL"), btn_toolbox, btn_statusbar, IupFill(), NULL); IupSetAttribute(toolbar, "MARGIN", "5x5"); IupSetAttribute(toolbar, "GAP", "2"); IupSetAttribute(toolbar, "NAME", "TOOLBAR"); IupSetAttribute(toolbar, "TABTITLE", "VIEW"); return toolbar; } Ihandle* SimplePaint::CreateImageTab() { Ihandle *toolbar; Ihandle *btn_resize, *btn_mirror, *btn_flip, *btn_rotate180, *btn_rotateCw90, *btn_rotateCcw90, *btn_negative, *btn_BrightCont; btn_resize = IupFlatButton("Resize"); IupSetAttribute(btn_resize, "FLAT", "Yes"); IUP_CLASS_SETCALLBACK(btn_resize, "FLAT_ACTION", ItemResizeActionCallback); IupSetAttribute(btn_resize, "TIP", "Resize"); IupSetAttribute(btn_resize, "CANFOCUS", "No"); btn_mirror = IupFlatButton("Mirror"); IupSetAttribute(btn_mirror, "FLAT", "Yes"); IUP_CLASS_SETCALLBACK(btn_mirror, "FLAT_ACTION", ItemMirrorActionCallback); IupSetAttribute(btn_mirror, "TIP", "Mirror"); IupSetAttribute(btn_mirror, "CANFOCUS", "No"); btn_flip = IupFlatButton("Flit"); IupSetAttribute(btn_flip, "FLAT", "Yes"); IUP_CLASS_SETCALLBACK(btn_flip, "FLAT_ACTION", ItemFlipActionCallback); IupSetAttribute(btn_flip, "TIP", "Flip"); IupSetAttribute(btn_flip, "CANFOCUS", "No"); btn_rotate180 = IupFlatButton("Rotate 180º"); IupSetAttribute(btn_rotate180, "FLAT", "Yes"); IUP_CLASS_SETCALLBACK(btn_rotate180, "FLAT_ACTION", ItemRotate180ActionCallback); IupSetAttribute(btn_rotate180, "TIP", "Rotate 180º"); IupSetAttribute(btn_rotate180, "CANFOCUS", "No"); btn_rotateCw90 = IupFlatButton("Rotate +90º"); IupSetAttribute(btn_rotateCw90, "FLAT", "Yes"); IUP_CLASS_SETCALLBACK(btn_rotateCw90, "FLAT_ACTION", ItemRotate90cwActionCallback); IupSetAttribute(btn_rotateCw90, "TIP", "Rotate 90º (clock-wise)"); IupSetAttribute(btn_rotateCw90, "CANFOCUS", "No"); btn_rotateCcw90 = IupFlatButton("Rotate -90º"); IupSetAttribute(btn_rotateCcw90, "FLAT", "Yes"); IUP_CLASS_SETCALLBACK(btn_rotateCcw90, "FLAT_ACTION", ItemRotate90ccwActionCallback); IupSetAttribute(btn_rotateCcw90, "TIP", "Rotate 90º (counter-Clock)"); IupSetAttribute(btn_rotateCcw90, "CANFOCUS", "No"); btn_negative = IupFlatButton("Negative"); IupSetAttribute(btn_negative, "FLAT", "Yes"); IUP_CLASS_SETCALLBACK(btn_negative, "FLAT_ACTION", ItemNegativeActionCallback); IupSetAttribute(btn_negative, "TIP", "Negative"); IupSetAttribute(btn_negative, "CANFOCUS", "No"); btn_BrightCont = IupFlatButton("Brightness and Contrast"); IupSetAttribute(btn_BrightCont, "FLAT", "Yes"); IUP_CLASS_SETCALLBACK(btn_BrightCont, "FLAT_ACTION", ItemBrightcontActionCallback); IupSetAttribute(btn_BrightCont, "TIP", "Brightness and Contrast"); toolbar = IupHbox( btn_resize, btn_mirror, btn_flip, btn_rotate180, btn_rotateCw90, btn_rotateCcw90, IupSetAttributes(IupFlatSeparator(), "ORIENTATION=VERTICAL"), btn_negative, btn_BrightCont, IupFill(), NULL); IupSetAttribute(toolbar, "MARGIN", "5x5"); IupSetAttribute(toolbar, "GAP", "2"); IupSetAttribute(toolbar, "NAME", "TOOLBAR"); IupSetAttribute(toolbar, "TABTITLE", "IMAGE"); return toolbar; } Ihandle* SimplePaint::CreateHelpTab() { Ihandle *toolbar; Ihandle *btn_help, *btn_about; btn_help = IupFlatButton("Help"); IupSetAttribute(btn_help, "FLAT", "Yes"); IUP_CLASS_SETCALLBACK(btn_help, "FLAT_ACTION", ItemHelpActionCallback); IupSetAttribute(btn_help, "TIP", "Help"); IupSetAttribute(btn_help, "CANFOCUS", "No"); btn_about = IupFlatButton("About"); IupSetAttribute(btn_about, "FLAT", "Yes"); IUP_CLASS_SETCALLBACK(btn_about, "FLAT_ACTION", ItemAboutActionCallback); IupSetAttribute(btn_about, "TIP", "About"); IupSetAttribute(btn_about, "CANFOCUS", "No"); toolbar = IupHbox( btn_help, btn_about, IupFill(), NULL); IupSetAttribute(toolbar, "MARGIN", "5x5"); IupSetAttribute(toolbar, "GAP", "2"); IupSetAttribute(toolbar, "NAME", "TOOLBAR"); IupSetAttribute(toolbar, "TABTITLE", "HELP"); return toolbar; } Ihandle* SimplePaint::CreateStatusbar() { Ihandle *statusbar; statusbar = IupHbox( IupSetAttributes(IupLabel("(0, 0) = 0 0 0"), "EXPAND=HORIZONTAL, PADDING=10x5, NAME=STATUSLABEL"), IupSetAttributes(IupLabel(NULL), "SEPARATOR=VERTICAL"), IupSetAttributes(IupLabel("0 x 0"), "SIZE=70x, PADDING=10x5, NAME=SIZELABEL, ALIGNMENT=ACENTER"), IupSetAttributes(IupLabel(NULL), "SEPARATOR=VERTICAL"), IupSetAttributes(IupLabel("100%"), "SIZE=30x, PADDING=10x5, NAME=ZOOMLABEL, ALIGNMENT=ARIGHT"), IupSetCallbacks(IupSetAttributes(IupButton(NULL, NULL), "IMAGE=IUP_ZoomOut, FLAT=Yes, TIP=\"Zoom Out (Ctrl+-)\", CANFOCUS=No"), "ACTION", CB_ItemZoomoutActionCallback, NULL), IupSetCallbacks(IupSetAttributes(IupVal(NULL), "VALUE=0, MIN=-6, MAX=6, SIZE=50x10, NAME=ZOOMVAL, CANFOCUS=No"), "VALUECHANGED_CB", CB_ZoomValueChangedCallback, NULL), IupSetCallbacks(IupSetAttributes(IupButton(NULL, NULL), "IMAGE=IUP_ZoomIn, FLAT=Yes, TIP=\"Zoom In (Ctrl++)\", CANFOCUS=No"), "ACTION", CB_ItemZoominActionCallback, NULL), IupSetCallbacks(IupSetAttributes(IupButton(NULL, NULL), "IMAGE=IUP_ZoomActualSize, FLAT=Yes, TIP=\"Actual Size (Ctrl+0)\", CANFOCUS=No"), "ACTION", CB_ItemActualsizeActionCallback, NULL), NULL); IupSetAttribute(statusbar, "NAME", "STATUSBAR"); IupSetAttribute(statusbar, "ALIGNMENT", "ACENTER"); /* Initialize variables from the configuration file */ if (!IupConfigGetVariableIntDef(config, "MainWindow", "Statusbar", 1)) { IupSetAttribute(statusbar, "FLOATING", "YES"); IupSetAttribute(statusbar, "VISIBLE", "NO"); } return statusbar; } void SimplePaint::CreateMainDialog(Ihandle* iup_canvas) { Ihandle *vbox, *tabs; tabs = IupFlatTabs(CreateEditTab(), CreateViewTab(), CreateImageTab(), CreateHelpTab(), NULL); /* A Flat color look like Office 2016 */ IupSetAttribute(tabs, "FORECOLOR", "47 82 154"); IupSetAttribute(tabs, "BGCOLOR", IupGetGlobal("DLGBGCOLOR")); IupSetAttribute(tabs, "TABSBACKCOLOR", "47 82 154"); IupSetAttribute(tabs, "HIGHCOLOR", "201 222 245"); IupSetAttribute(tabs, "CLOSEHIGHCOLOR", "255 128 128"); IupSetAttribute(tabs, "TABSFORECOLOR", "255 255 255"); IupSetAttribute(tabs, "SHOWLINES", "NO"); IupSetAttribute(tabs, "FOCUSFEEDBACK", "NO"); //IupSetAttribute(tabs, "TABSPADDING", "5x5"); TODO vbox = IupVbox( tabs, IupHbox(iup_canvas, NULL), CreateStatusbar(), NULL); //IupSetAttribute(vbox, "MARGIN", "5x5"); TODO IupSetAttribute(vbox, "GAP", "0"); dlg = IupDialog(vbox); IupSetAttribute(dlg, "SIZE", "HALFxHALF"); IUP_CLASS_SETCALLBACK(dlg, "DROPFILES_CB", DialogDropfilesCallback); IUP_CLASS_SETCALLBACK(dlg, "MOVE_CB", DialogMoveCallback); IUP_CLASS_SETCALLBACK(dlg, "K_cN", ItemNewActionCallback); IUP_CLASS_SETCALLBACK(dlg, "K_cO", ItemOpenActionCallback); IUP_CLASS_SETCALLBACK(dlg, "K_cS", ItemSaveActionCallback); IUP_CLASS_SETCALLBACK(dlg, "K_cV", ItemPasteActionCallback); IUP_CLASS_SETCALLBACK(dlg, "K_cC", ItemCopyActionCallback); IUP_CLASS_SETCALLBACK(dlg, "K_cP", ItemPrintActionCallback); IUP_CLASS_SETCALLBACK(dlg, "K_cMinus", ItemZoomoutActionCallback); IUP_CLASS_SETCALLBACK(dlg, "K_cPlus", ItemZoominActionCallback); IUP_CLASS_SETCALLBACK(dlg, "K_cEqual", ItemZoominActionCallback); IUP_CLASS_SETCALLBACK(dlg, "K_c0", ItemActualsizeActionCallback); IupSetHandle("Tecgraf", load_image_LogoTecgraf()); IupSetHandle("ImageClose", load_image_close()); IupSetHandle("ImageMaximize", load_image_maximize()); IupSetHandle("ImageMaximize2", load_image_maximize2()); //TODO IupSetHandle("ImageMinimize", load_image_minimize()); IupSetHandle("ImageSave", load_image_save()); IupSetHandle("ImageSaveAs", load_image_saveas()); IupSetHandle("ImageNew", load_image_new()); IupSetHandle("ImageOpen", load_image_open()); IupSetHandle("ImageRevert", load_image_revert()); Ihandle *logo = IupFlatLabel(NULL); Ihandle *label = IupFlatLabel("Custom Dialog Title"); Ihandle *buttonOpen = IupDropButton(NULL); Ihandle *buttonNew = IupFlatButton(NULL); Ihandle *buttonSave = IupFlatButton(NULL); Ihandle *buttonSaveAs = IupFlatButton(NULL); Ihandle *buttonRevert = IupFlatButton(NULL); Ihandle *buttonMinimize = IupFlatButton(NULL); Ihandle *buttonMaximize = IupFlatButton(NULL); Ihandle *buttonClose = IupFlatButton(NULL); Ihandle *separator1 = IupFlatSeparator(); Ihandle *separator2 = IupFlatSeparator(); Ihandle *hbox = IupHbox(logo, separator1, buttonNew, buttonOpen, buttonSave, buttonSaveAs, buttonRevert, separator2, label, IupFill(), buttonMinimize, buttonMaximize, buttonClose, NULL); Ihandle *caption_bar = IupBackgroundBox(hbox); Ihandle* list = IupList(NULL); IupSetAttribute(list, "VISIBLEITEMS", "20"); IupSetAttribute(list, "VISIBLELINES", "4"); IupSetAttribute(list, "CANFOCUS", "No"); IUP_CLASS_SETCALLBACK(list, "ACTION", ConfigRecentCallback); IupSetAttribute(logo, "IMAGE", "Tecgraf"); IupSetAttribute(logo, "ALIGNMENT", "ACENTER"); IupSetAttribute(logo, "PADDING", "5"); IupSetAttribute(label, "EXPAND", "HORIZONTAL"); IupSetAttribute(label, "ALIGNMENT", "ACENTER"); IupSetAttribute(label, "NAME", "CUSTOMFRAMECAPTION"); IupSetAttribute(label, "FGCOLOR", IupGetGlobal("DLGBGCOLOR")); IupSetAttribute(buttonOpen, "IMAGE", "ImageOpen"); IupSetAttribute(buttonOpen, "FLAT", "Yes"); IupSetAttribute(buttonOpen, "DROPCHILD_HANDLE", (char*)list); IUP_CLASS_INITCALLBACK(IupGetDialog(list), SimplePaint); IUP_CLASS_SETCALLBACK(buttonOpen, "FLAT_ACTION", ItemOpenActionCallback); IupSetAttribute(buttonOpen, "TIP", "Open (Ctrl+O)"); IupSetAttribute(buttonOpen, "CANFOCUS", "No"); IupSetAttribute(buttonNew, "IMAGE", "ImageNew"); IupSetAttribute(buttonNew, "FLAT", "Yes"); IUP_CLASS_SETCALLBACK(buttonNew, "FLAT_ACTION", ItemNewActionCallback); IupSetAttribute(buttonNew, "TIP", "New (Ctrl+N)"); IupSetAttribute(buttonNew, "CANFOCUS", "No"); IupSetAttribute(buttonSave, "IMAGE", "ImageSave"); IupSetAttribute(buttonSave, "FLAT", "Yes"); IUP_CLASS_SETCALLBACK(buttonSave, "FLAT_ACTION", ItemSaveActionCallback); IupSetAttribute(buttonSave, "TIP", "Save (Ctrl+S)"); IupSetAttribute(buttonSave, "CANFOCUS", "No"); IupSetAttribute(buttonSaveAs, "FLAT", "Yes"); IupSetAttribute(buttonSaveAs, "IMAGE", "ImageSaveAs"); IUP_CLASS_SETCALLBACK(buttonSaveAs, "FLAT_ACTION", ItemSaveasActionCallback); IupSetAttribute(buttonSaveAs, "TIP", "Save As"); IupSetAttribute(buttonSaveAs, "CANFOCUS", "No"); IupSetAttribute(buttonRevert, "IMAGE", "ImageRevert"); IupSetAttribute(buttonRevert, "FLAT", "Yes"); IUP_CLASS_SETCALLBACK(buttonRevert, "FLAT_ACTION", ItemRevertActionCallback); IupSetAttribute(buttonRevert, "TIP", "Save As"); IupSetAttribute(buttonRevert, "CANFOCUS", "No"); IupSetAttribute(buttonMinimize, "FLAT", "YES"); IupSetAttribute(buttonMinimize, "CANFOCUS", "NO"); IupSetAttribute(buttonMinimize, "FONTSTYLE", "Bold"); IupSetAttribute(buttonMinimize, "FGCOLOR", IupGetGlobal("DLGBGCOLOR")); IupSetAttribute(buttonMinimize, "IMAGE", "ImageMinimize"); IupSetAttribute(buttonMaximize, "FGCOLOR", IupGetGlobal("DLGBGCOLOR")); IupSetAttribute(buttonMaximize, "IMAGE", "ImageMaximize"); IupSetAttribute(buttonClose, "FGCOLOR", IupGetGlobal("DLGBGCOLOR")); IupSetAttribute(buttonClose, "HLCOLOR", "47 82 100"); IupSetAttribute(buttonClose, "IMAGE", "ImageClose"); IupSetAttribute(caption_bar, "BGCOLOR", "47 82 154"); IupSetAttribute(caption_bar, "MARGIN", "0"); IupSetAttribute(separator1, "FGCOLOR", IupGetGlobal("DLGBGCOLOR")); IupSetAttribute(separator2, "FGCOLOR", IupGetGlobal("DLGBGCOLOR")); IupSetAttribute(hbox, "ALIGNMENT", "ACENTER"); IupSetAttribute(hbox, "GAP", "6"); IUP_CLASS_SETCALLBACK(buttonMinimize, "FLAT_ACTION", DialogMinimizeCallback); IUP_CLASS_SETCALLBACK(buttonMaximize, "FLAT_ACTION", DialogMaximizeCallback); IUP_CLASS_SETCALLBACK(buttonClose, "FLAT_ACTION", ItemExitActionCallback); IupInsert(vbox, NULL, caption_bar); //ifdef TODO simulate IupSetAttribute(dlg, "CUSTOMFRAME", "YES"); IupSetAttribute(label, "HTTRANSPARENT", "YES"); /* Windows Only */ IupSetAttribute(caption_bar, "HTTRANSPARENT", "YES"); /* Windows Only */ IupSetAttribute(dlg, "CUSTOMFRAMESIMULATE", "NO"); IupConfigRecentInit(config, (Ihandle*)IupGetAttribute(buttonOpen, "DROPCHILD_HANDLE"), CB_ConfigRecentCallback, 10); /* parent for pre-defined dialogs in closed functions (IupMessage and IupAlarm) */ IupSetAttributeHandle(NULL, "PARENTDIALOG", dlg); } SimplePaint::SimplePaint() :dlg(NULL), config(NULL), file(), toolbox(), canvas() { /*************** Config ***********/ config = IupConfig(); IupSetAttribute(config, "APP_NAME", "simple_paint"); IupConfigLoad(config); /*************** Canvas ***********/ Ihandle* iup_canvas = canvas.CreateCanvas(&file, &toolbox); /* Initialize variables from the configuration file */ const char* background_str = IupConfigGetVariableStr(config, "Canvas", "Background"); if (background_str) { unsigned int ri, gi, bi; sscanf(background_str, "%u %u %u", &ri, &gi, &bi); canvas.SetBackground(cdEncodeColor((unsigned char)ri, (unsigned char)gi, (unsigned char)bi)); } if (!IupConfigGetVariableIntDef(config, "Canvas", "ZoomGrid", 1)) canvas.SetZoomGrid(false); /*************** Dialog ***********/ CreateMainDialog(iup_canvas); IUP_CLASS_INITCALLBACK(dlg, SimplePaint); /*************** Toolbox ***********/ toolbox.CreateDialog(dlg, config); IupInsert(IupGetParent(iup_canvas), NULL, toolbox.getToolbox()); /* show the dialog at the last position, with the last size */ IupConfigDialogShow(config, dlg, "MainWindow"); /* Initialize variables from the configuration file */ if (IupConfigGetVariableIntDef(config, "MainWindow", "Toolbox", 1)) { /* configure the very first time to be aligned with the canvas top left corner */ if (!IupConfigGetVariableStr(config, "Toolbox", "X")) { int x = IupGetInt(iup_canvas, "X"); int y = IupGetInt(iup_canvas, "Y"); IupConfigSetVariableInt(config, "Toolbox", "X", x); IupConfigSetVariableInt(config, "Toolbox", "Y", y); } //toolbox.ShowDialog(); TODO } }