diff --git a/src/font_6x11.h b/src/font_6x11.h new file mode 100644 index 0000000..844ff4f --- /dev/null +++ b/src/font_6x11.h @@ -0,0 +1,3337 @@ +/**********************************************/ +/* */ +/* Font file generated by rthelen */ +/* */ +/**********************************************/ + +static unsigned char fontdata[] = { + + /* 0 0x00 '^A' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 1 0x01 '^B' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 2 0x02 '^C' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 3 0x03 '^D' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 4 0x04 '^E' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 5 0x05 '^F' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 6 0x06 '^G' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 7 0x07 '^H' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 8 0x08 '^I' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 9 0x09 '^J' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 10 0x0a '^K' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 11 0x0b '^L' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 12 0x0c '^M' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 13 0x0d '^N' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 14 0x0e '^O' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 15 0x0f '^P' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 16 0x10 '^Q' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 17 0x11 '^R' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x28, /* 00 0 000 */ + 0x54, /* 0 0 0 00 */ + 0x38, /* 00 000 */ + 0x54, /* 0 0 0 00 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 18 0x12 '^S' */ + 0x04, /* 00000 00 */ + 0x04, /* 00000 00 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x50, /* 0 0 0000 */ + 0x50, /* 0 0 0000 */ + 0x20, /* 00 00000 */ + 0x20, /* 00 00000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 19 0x13 '^T' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x38, /* 00 000 */ + 0x7c, /* 0 00 */ + 0x38, /* 00 000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 20 0x14 '^U' */ + 0x18, /* 000 000 */ + 0x10, /* 000 0000 */ + 0x28, /* 00 0 000 */ + 0x7c, /* 0 00 */ + 0x78, /* 0 000 */ + 0x78, /* 0 000 */ + 0x7c, /* 0 00 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 21 0x15 '^V' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 22 0x16 '^W' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 23 0x17 '^X' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 24 0x18 '^Y' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 25 0x19 '^Z' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 26 0x1a '^[' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 27 0x1b '^\' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 28 0x1c '^]' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 29 0x1d '^^' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 30 0x1e '^_' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 31 0x1f '^`' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 32 0x20 ' ' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 33 0x21 '!' */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 34 0x22 '"' */ + 0x28, /* 00 0 000 */ + 0x28, /* 00 0 000 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 35 0x23 '#' */ + 0x00, /* 00000000 */ + 0x28, /* 00 0 000 */ + 0x7c, /* 0 00 */ + 0x28, /* 00 0 000 */ + 0x7c, /* 0 00 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 36 0x24 '$' */ + 0x10, /* 000 0000 */ + 0x38, /* 00 000 */ + 0x54, /* 0 0 0 00 */ + 0x50, /* 0 0 0000 */ + 0x38, /* 00 000 */ + 0x14, /* 000 0 00 */ + 0x54, /* 0 0 0 00 */ + 0x38, /* 00 000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 37 0x25 '%' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x54, /* 0 0 0 00 */ + 0x58, /* 0 0 000 */ + 0x28, /* 00 0 000 */ + 0x34, /* 00 0 00 */ + 0x54, /* 0 0 0 00 */ + 0x48, /* 0 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 38 0x26 '&' */ + 0x00, /* 00000000 */ + 0x30, /* 00 0000 */ + 0x48, /* 0 00 000 */ + 0x50, /* 0 0 0000 */ + 0x20, /* 00 00000 */ + 0x54, /* 0 0 0 00 */ + 0x48, /* 0 00 000 */ + 0x34, /* 00 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 39 0x27 ''' */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 40 0x28 '(' */ + 0x04, /* 00000 00 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x08, /* 0000 000 */ + 0x04, /* 00000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 41 0x29 ')' */ + 0x20, /* 00 00000 */ + 0x10, /* 000 0000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x20, /* 00 00000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 42 0x2a '*' */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x54, /* 0 0 0 00 */ + 0x38, /* 00 000 */ + 0x54, /* 0 0 0 00 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 43 0x2b '+' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x7c, /* 0 00 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 44 0x2c ',' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x30, /* 00 0000 */ + 0x30, /* 00 0000 */ + 0x10, /* 000 0000 */ + 0x20, /* 00 00000 */ + 0x00, /* 00000000 */ + + /* 45 0x2d '-' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7c, /* 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 46 0x2e '.' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x18, /* 000 000 */ + 0x18, /* 000 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 47 0x2f '/' */ + 0x04, /* 00000 00 */ + 0x04, /* 00000 00 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x20, /* 00 00000 */ + 0x20, /* 00 00000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x00, /* 00000000 */ + + /* 48 0x30 '0' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x4c, /* 0 00 00 */ + 0x54, /* 0 0 0 00 */ + 0x64, /* 0 00 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 49 0x31 '1' */ + 0x00, /* 00000000 */ + 0x08, /* 0000 000 */ + 0x18, /* 000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x1c, /* 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 50 0x32 '2' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x04, /* 00000 00 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x20, /* 00 00000 */ + 0x7c, /* 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 51 0x33 '3' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x04, /* 00000 00 */ + 0x18, /* 000 000 */ + 0x04, /* 00000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 52 0x34 '4' */ + 0x00, /* 00000000 */ + 0x08, /* 0000 000 */ + 0x18, /* 000 000 */ + 0x28, /* 00 0 000 */ + 0x48, /* 0 00 000 */ + 0x7c, /* 0 00 */ + 0x08, /* 0000 000 */ + 0x1c, /* 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 53 0x35 '5' */ + 0x00, /* 00000000 */ + 0x7c, /* 0 00 */ + 0x40, /* 0 000000 */ + 0x78, /* 0 000 */ + 0x04, /* 00000 00 */ + 0x04, /* 00000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 54 0x36 '6' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x40, /* 0 000000 */ + 0x78, /* 0 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 55 0x37 '7' */ + 0x00, /* 00000000 */ + 0x7c, /* 0 00 */ + 0x04, /* 00000 00 */ + 0x04, /* 00000 00 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 56 0x38 '8' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 57 0x39 '9' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x3c, /* 00 00 */ + 0x04, /* 00000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 58 0x3a ':' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x18, /* 000 000 */ + 0x18, /* 000 000 */ + 0x00, /* 00000000 */ + 0x18, /* 000 000 */ + 0x18, /* 000 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 59 0x3b ';' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x30, /* 00 0000 */ + 0x30, /* 00 0000 */ + 0x00, /* 00000000 */ + 0x30, /* 00 0000 */ + 0x30, /* 00 0000 */ + 0x10, /* 000 0000 */ + 0x20, /* 00 00000 */ + 0x00, /* 00000000 */ + + /* 60 0x3c '<' */ + 0x00, /* 00000000 */ + 0x04, /* 00000 00 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x20, /* 00 00000 */ + 0x10, /* 000 0000 */ + 0x08, /* 0000 000 */ + 0x04, /* 00000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 61 0x3d '=' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7c, /* 0 00 */ + 0x00, /* 00000000 */ + 0x7c, /* 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 62 0x3e '>' */ + 0x00, /* 00000000 */ + 0x20, /* 00 00000 */ + 0x10, /* 000 0000 */ + 0x08, /* 0000 000 */ + 0x04, /* 00000 00 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x20, /* 00 00000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 63 0x3f '?' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x04, /* 00000 00 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 64 0x40 '@' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x74, /* 0 0 00 */ + 0x54, /* 0 0 0 00 */ + 0x78, /* 0 000 */ + 0x40, /* 0 000000 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 65 0x41 'A' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x7c, /* 0 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 66 0x42 'B' */ + 0x00, /* 00000000 */ + 0x78, /* 0 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x78, /* 0 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x78, /* 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 67 0x43 'C' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 68 0x44 'D' */ + 0x00, /* 00000000 */ + 0x78, /* 0 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x78, /* 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 69 0x45 'E' */ + 0x00, /* 00000000 */ + 0x7c, /* 0 00 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x78, /* 0 000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x7c, /* 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 70 0x46 'F' */ + 0x00, /* 00000000 */ + 0x7c, /* 0 00 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x78, /* 0 000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 71 0x47 'G' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x40, /* 0 000000 */ + 0x4c, /* 0 00 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 72 0x48 'H' */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x7c, /* 0 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 73 0x49 'I' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 74 0x4a 'J' */ + 0x00, /* 00000000 */ + 0x04, /* 00000 00 */ + 0x04, /* 00000 00 */ + 0x04, /* 00000 00 */ + 0x04, /* 00000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 75 0x4b 'K' */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x48, /* 0 00 000 */ + 0x50, /* 0 0 0000 */ + 0x60, /* 0 00000 */ + 0x50, /* 0 0 0000 */ + 0x48, /* 0 00 000 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 76 0x4c 'L' */ + 0x00, /* 00000000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x7c, /* 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 77 0x4d 'M' */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x6c, /* 0 0 00 */ + 0x54, /* 0 0 0 00 */ + 0x54, /* 0 0 0 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 78 0x4e 'N' */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x64, /* 0 00 00 */ + 0x54, /* 0 0 0 00 */ + 0x4c, /* 0 00 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 79 0x4f 'O' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 80 0x50 'P' */ + 0x00, /* 00000000 */ + 0x78, /* 0 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x78, /* 0 000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 81 0x51 'Q' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x54, /* 0 0 0 00 */ + 0x38, /* 00 000 */ + 0x04, /* 00000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 82 0x52 'R' */ + 0x00, /* 00000000 */ + 0x78, /* 0 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x78, /* 0 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 83 0x53 'S' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x40, /* 0 000000 */ + 0x38, /* 00 000 */ + 0x04, /* 00000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 84 0x54 'T' */ + 0x00, /* 00000000 */ + 0x7c, /* 0 00 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 85 0x55 'U' */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 86 0x56 'V' */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x28, /* 00 0 000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 87 0x57 'W' */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x54, /* 0 0 0 00 */ + 0x54, /* 0 0 0 00 */ + 0x6c, /* 0 0 00 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 88 0x58 'X' */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x28, /* 00 0 000 */ + 0x10, /* 000 0000 */ + 0x28, /* 00 0 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 89 0x59 'Y' */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x28, /* 00 0 000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 90 0x5a 'Z' */ + 0x00, /* 00000000 */ + 0x7c, /* 0 00 */ + 0x04, /* 00000 00 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x20, /* 00 00000 */ + 0x40, /* 0 000000 */ + 0x7c, /* 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 91 0x5b '[' */ + 0x0c, /* 0000 00 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x0c, /* 0000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 92 0x5c '\' */ + 0x20, /* 00 00000 */ + 0x20, /* 00 00000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x04, /* 00000 00 */ + 0x04, /* 00000 00 */ + 0x02, /* 000000 0 */ + 0x02, /* 000000 0 */ + 0x00, /* 00000000 */ + + /* 93 0x5d ']' */ + 0x30, /* 00 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x30, /* 00 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 94 0x5e '^' */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x28, /* 00 0 000 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 95 0x5f '_' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7e, /* 0 0 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 96 0x60 '`' */ + 0x20, /* 00 00000 */ + 0x10, /* 000 0000 */ + 0x08, /* 0000 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 97 0x61 'a' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x4c, /* 0 00 00 */ + 0x34, /* 00 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 98 0x62 'b' */ + 0x00, /* 00000000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x78, /* 0 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x78, /* 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 99 0x63 'c' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x40, /* 0 000000 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 100 0x64 'd' */ + 0x00, /* 00000000 */ + 0x04, /* 00000 00 */ + 0x04, /* 00000 00 */ + 0x3c, /* 00 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 101 0x65 'e' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x7c, /* 0 00 */ + 0x40, /* 0 000000 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 102 0x66 'f' */ + 0x00, /* 00000000 */ + 0x0c, /* 0000 00 */ + 0x10, /* 000 0000 */ + 0x38, /* 00 000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 103 0x67 'g' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x3c, /* 00 00 */ + 0x04, /* 00000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + + /* 104 0x68 'h' */ + 0x00, /* 00000000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x78, /* 0 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 105 0x69 'i' */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x30, /* 00 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 106 0x6a 'j' */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x30, /* 00 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x60, /* 0 00000 */ + 0x00, /* 00000000 */ + + /* 107 0x6b 'k' */ + 0x00, /* 00000000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x48, /* 0 00 000 */ + 0x50, /* 0 0 0000 */ + 0x70, /* 0 0000 */ + 0x48, /* 0 00 000 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 108 0x6c 'l' */ + 0x00, /* 00000000 */ + 0x30, /* 00 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 109 0x6d 'm' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x78, /* 0 000 */ + 0x54, /* 0 0 0 00 */ + 0x54, /* 0 0 0 00 */ + 0x54, /* 0 0 0 00 */ + 0x54, /* 0 0 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 110 0x6e 'n' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x58, /* 0 0 000 */ + 0x64, /* 0 00 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 111 0x6f 'o' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 112 0x70 'p' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x78, /* 0 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x78, /* 0 000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x00, /* 00000000 */ + + /* 113 0x71 'q' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x3c, /* 00 00 */ + 0x04, /* 00000 00 */ + 0x04, /* 00000 00 */ + 0x00, /* 00000000 */ + + /* 114 0x72 'r' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x58, /* 0 0 000 */ + 0x64, /* 0 00 00 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 115 0x73 's' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x40, /* 0 000000 */ + 0x38, /* 00 000 */ + 0x04, /* 00000 00 */ + 0x78, /* 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 116 0x74 't' */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x38, /* 00 000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x0c, /* 0000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 117 0x75 'u' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x4c, /* 0 00 00 */ + 0x34, /* 00 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 118 0x76 'v' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x28, /* 00 0 000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 119 0x77 'w' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x54, /* 0 0 0 00 */ + 0x54, /* 0 0 0 00 */ + 0x54, /* 0 0 0 00 */ + 0x54, /* 0 0 0 00 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 120 0x78 'x' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x28, /* 00 0 000 */ + 0x10, /* 000 0000 */ + 0x28, /* 00 0 000 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 121 0x79 'y' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x3c, /* 00 00 */ + 0x04, /* 00000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + + /* 122 0x7a 'z' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7c, /* 0 00 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x20, /* 00 00000 */ + 0x7c, /* 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 123 0x7b '{' */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x04, /* 00000 00 */ + 0x00, /* 00000000 */ + + /* 124 0x7c '|' */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 125 0x7d '}' */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x20, /* 00 00000 */ + 0x00, /* 00000000 */ + + /* 126 0x7e '~' */ + 0x00, /* 00000000 */ + 0x34, /* 00 0 00 */ + 0x58, /* 0 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 127 0x7f '^?' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 128 0x80 '\200' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x7c, /* 0 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 129 0x81 '\201' */ + 0x28, /* 00 0 000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x7c, /* 0 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 130 0x82 '\202' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 131 0x83 '\203' */ + 0x10, /* 000 0000 */ + 0x7c, /* 0 00 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x78, /* 0 000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x7c, /* 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 132 0x84 '\204' */ + 0x58, /* 0 0 000 */ + 0x44, /* 0 000 00 */ + 0x64, /* 0 00 00 */ + 0x54, /* 0 0 0 00 */ + 0x4c, /* 0 00 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 133 0x85 '\205' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 134 0x86 '\206' */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 135 0x87 '\207' */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x4c, /* 0 00 00 */ + 0x34, /* 00 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 136 0x88 '\210' */ + 0x10, /* 000 0000 */ + 0x08, /* 0000 000 */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x4c, /* 0 00 00 */ + 0x34, /* 00 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 137 0x89 '\211' */ + 0x10, /* 000 0000 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x4c, /* 0 00 00 */ + 0x34, /* 00 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 138 0x8a '\212' */ + 0x00, /* 00000000 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x4c, /* 0 00 00 */ + 0x34, /* 00 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 139 0x8b '\213' */ + 0x34, /* 00 0 00 */ + 0x58, /* 0 0 000 */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x4c, /* 0 00 00 */ + 0x34, /* 00 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 140 0x8c '\214' */ + 0x18, /* 000 000 */ + 0x24, /* 00 00 00 */ + 0x18, /* 000 000 */ + 0x3c, /* 00 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x4c, /* 0 00 00 */ + 0x34, /* 00 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 141 0x8d '\215' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x3c, /* 00 00 */ + 0x10, /* 000 0000 */ + 0x20, /* 00 00000 */ + 0x00, /* 00000000 */ + + /* 142 0x8e '\216' */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x7c, /* 0 00 */ + 0x40, /* 0 000000 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 143 0x8f '\217' */ + 0x20, /* 00 00000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x7c, /* 0 00 */ + 0x40, /* 0 000000 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 144 0x90 '\220' */ + 0x10, /* 000 0000 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x7c, /* 0 00 */ + 0x40, /* 0 000000 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 145 0x91 '\221' */ + 0x00, /* 00000000 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x7c, /* 0 00 */ + 0x40, /* 0 000000 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 146 0x92 '\222' */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 147 0x93 '\223' */ + 0x20, /* 00 00000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 148 0x94 '\224' */ + 0x10, /* 000 0000 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 149 0x95 '\225' */ + 0x00, /* 00000000 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 150 0x96 '\226' */ + 0x34, /* 00 0 00 */ + 0x58, /* 0 0 000 */ + 0x00, /* 00000000 */ + 0x58, /* 0 0 000 */ + 0x64, /* 0 00 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 151 0x97 '\227' */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 152 0x98 '\230' */ + 0x20, /* 00 00000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 153 0x99 '\231' */ + 0x10, /* 000 0000 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 154 0x9a '\232' */ + 0x00, /* 00000000 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 155 0x9b '\233' */ + 0x34, /* 00 0 00 */ + 0x58, /* 0 0 000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 156 0x9c '\234' */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x4c, /* 0 00 00 */ + 0x34, /* 00 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 157 0x9d '\235' */ + 0x20, /* 00 00000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x4c, /* 0 00 00 */ + 0x34, /* 00 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 158 0x9e '\236' */ + 0x10, /* 000 0000 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x4c, /* 0 00 00 */ + 0x34, /* 00 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 159 0x9f '\237' */ + 0x00, /* 00000000 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x4c, /* 0 00 00 */ + 0x34, /* 00 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 160 0xa0 '\240' */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x38, /* 00 000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 161 0xa1 '\241' */ + 0x18, /* 000 000 */ + 0x24, /* 00 00 00 */ + 0x24, /* 00 00 00 */ + 0x18, /* 000 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 162 0xa2 '\242' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x38, /* 00 000 */ + 0x54, /* 0 0 0 00 */ + 0x50, /* 0 0 0000 */ + 0x54, /* 0 0 0 00 */ + 0x38, /* 00 000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 163 0xa3 '\243' */ + 0x30, /* 00 0000 */ + 0x48, /* 0 00 000 */ + 0x40, /* 0 000000 */ + 0x70, /* 0 0000 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x44, /* 0 000 00 */ + 0x78, /* 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 164 0xa4 '\244' */ + 0x44, /* 0 000 00 */ + 0x24, /* 00 00 00 */ + 0x50, /* 0 0 0000 */ + 0x48, /* 0 00 000 */ + 0x24, /* 00 00 00 */ + 0x14, /* 000 0 00 */ + 0x48, /* 0 00 000 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 165 0xa5 '\245' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x7c, /* 0 00 */ + 0x7c, /* 0 00 */ + 0x7c, /* 0 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 166 0xa6 '\246' */ + 0x3c, /* 00 00 */ + 0x54, /* 0 0 0 00 */ + 0x54, /* 0 0 0 00 */ + 0x54, /* 0 0 0 00 */ + 0x3c, /* 00 00 */ + 0x14, /* 000 0 00 */ + 0x14, /* 000 0 00 */ + 0x14, /* 000 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 167 0xa7 '\247' */ + 0x18, /* 000 000 */ + 0x24, /* 00 00 00 */ + 0x44, /* 0 000 00 */ + 0x48, /* 0 00 000 */ + 0x48, /* 0 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x58, /* 0 0 000 */ + 0x40, /* 0 000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 168 0xa8 '\250' */ + 0x00, /* 00000000 */ + 0x70, /* 0 0000 */ + 0x08, /* 0000 000 */ + 0x64, /* 0 00 00 */ + 0x54, /* 0 0 0 00 */ + 0x64, /* 0 00 00 */ + 0x58, /* 0 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 169 0xa9 '\251' */ + 0x00, /* 00000000 */ + 0x70, /* 0 0000 */ + 0x08, /* 0000 000 */ + 0x34, /* 00 0 00 */ + 0x44, /* 0 000 00 */ + 0x34, /* 00 0 00 */ + 0x08, /* 0000 000 */ + 0x70, /* 0 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 170 0xaa '\252' */ + 0x00, /* 00000000 */ + 0x7a, /* 0 0 0 */ + 0x2e, /* 00 0 0 */ + 0x2e, /* 00 0 0 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 171 0xab '\253' */ + 0x00, /* 00000000 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 172 0xac '\254' */ + 0x00, /* 00000000 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 173 0xad '\255' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x08, /* 0000 000 */ + 0x7c, /* 0 00 */ + 0x10, /* 000 0000 */ + 0x7c, /* 0 00 */ + 0x20, /* 00 00000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 174 0xae '\256' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x50, /* 0 0 0000 */ + 0x50, /* 0 0 0000 */ + 0x78, /* 0 000 */ + 0x50, /* 0 0 0000 */ + 0x50, /* 0 0 0000 */ + 0x5c, /* 0 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 175 0xaf '\257' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x4c, /* 0 00 00 */ + 0x54, /* 0 0 0 00 */ + 0x64, /* 0 00 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 176 0xb0 '\260' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x6c, /* 0 0 00 */ + 0x54, /* 0 0 0 00 */ + 0x6c, /* 0 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 177 0xb1 '\261' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x7c, /* 0 00 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x7c, /* 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 178 0xb2 '\262' */ + 0x00, /* 00000000 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x20, /* 00 00000 */ + 0x10, /* 000 0000 */ + 0x08, /* 0000 000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 179 0xb3 '\263' */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x08, /* 0000 000 */ + 0x04, /* 00000 00 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x1c, /* 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 180 0xb4 '\264' */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x28, /* 00 0 000 */ + 0x7c, /* 0 00 */ + 0x10, /* 000 0000 */ + 0x7c, /* 0 00 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 181 0xb5 '\265' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x48, /* 0 00 000 */ + 0x48, /* 0 00 000 */ + 0x48, /* 0 00 000 */ + 0x48, /* 0 00 000 */ + 0x74, /* 0 0 00 */ + 0x40, /* 0 000000 */ + 0x40, /* 0 000000 */ + 0x00, /* 00000000 */ + + /* 182 0xb6 '\266' */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x08, /* 0000 000 */ + 0x0c, /* 0000 00 */ + 0x14, /* 000 0 00 */ + 0x24, /* 00 00 00 */ + 0x24, /* 00 00 00 */ + 0x18, /* 000 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 183 0xb7 '\267' */ + 0x00, /* 00000000 */ + 0x7c, /* 0 00 */ + 0x24, /* 00 00 00 */ + 0x10, /* 000 0000 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x24, /* 00 00 00 */ + 0x7c, /* 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 184 0xb8 '\270' */ + 0x00, /* 00000000 */ + 0x7c, /* 0 00 */ + 0x28, /* 00 0 000 */ + 0x28, /* 00 0 000 */ + 0x28, /* 00 0 000 */ + 0x28, /* 00 0 000 */ + 0x28, /* 00 0 000 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 185 0xb9 '\271' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7c, /* 0 00 */ + 0x28, /* 00 0 000 */ + 0x28, /* 00 0 000 */ + 0x28, /* 00 0 000 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 186 0xba '\272' */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x60, /* 0 00000 */ + 0x00, /* 00000000 */ + + /* 187 0xbb '\273' */ + 0x00, /* 00000000 */ + 0x1c, /* 000 00 */ + 0x24, /* 00 00 00 */ + 0x24, /* 00 00 00 */ + 0x1c, /* 000 00 */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 188 0xbc '\274' */ + 0x00, /* 00000000 */ + 0x18, /* 000 000 */ + 0x24, /* 00 00 00 */ + 0x24, /* 00 00 00 */ + 0x18, /* 000 000 */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 189 0xbd '\275' */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x28, /* 00 0 000 */ + 0x6c, /* 0 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 190 0xbe '\276' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x54, /* 0 0 0 00 */ + 0x5c, /* 0 0 00 */ + 0x50, /* 0 0 0000 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 191 0xbf '\277' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x4c, /* 0 00 00 */ + 0x54, /* 0 0 0 00 */ + 0x64, /* 0 00 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 192 0xc0 '\300' */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x20, /* 00 00000 */ + 0x40, /* 0 000000 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 193 0xc1 '\301' */ + 0x00, /* 00000000 */ + 0x08, /* 0000 000 */ + 0x00, /* 00000000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x08, /* 0000 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 194 0xc2 '\302' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7c, /* 0 00 */ + 0x04, /* 00000 00 */ + 0x04, /* 00000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 195 0xc3 '\303' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x0c, /* 0000 00 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x50, /* 0 0 0000 */ + 0x20, /* 00 00000 */ + 0x20, /* 00 00000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 196 0xc4 '\304' */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x38, /* 00 000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x60, /* 0 00000 */ + 0x00, /* 00000000 */ + + /* 197 0xc5 '\305' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x04, /* 00000 00 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x40, /* 0 000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 198 0xc6 '\306' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x10, /* 000 0000 */ + 0x28, /* 00 0 000 */ + 0x28, /* 00 0 000 */ + 0x44, /* 0 000 00 */ + 0x7c, /* 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 199 0xc7 '\307' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x24, /* 00 00 00 */ + 0x48, /* 0 00 000 */ + 0x48, /* 0 00 000 */ + 0x24, /* 00 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 200 0xc8 '\310' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x48, /* 0 00 000 */ + 0x24, /* 00 00 00 */ + 0x24, /* 00 00 00 */ + 0x48, /* 0 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 201 0xc9 '\311' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x54, /* 0 0 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 202 0xca '\312' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 203 0xcb '\313' */ + 0x10, /* 000 0000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x7c, /* 0 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 204 0xcc '\314' */ + 0x58, /* 0 0 000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x7c, /* 0 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 205 0xcd '\315' */ + 0x58, /* 0 0 000 */ + 0x38, /* 00 000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 206 0xce '\316' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x50, /* 0 0 0000 */ + 0x50, /* 0 0 0000 */ + 0x58, /* 0 0 000 */ + 0x50, /* 0 0 0000 */ + 0x50, /* 0 0 0000 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 207 0xcf '\317' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x28, /* 00 0 000 */ + 0x54, /* 0 0 0 00 */ + 0x5c, /* 0 0 00 */ + 0x50, /* 0 0 0000 */ + 0x2c, /* 00 0 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 208 0xd0 '\320' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 209 0xd1 '\321' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7e, /* 0 0 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 210 0xd2 '\322' */ + 0x00, /* 00000000 */ + 0x14, /* 000 0 00 */ + 0x28, /* 00 0 000 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 211 0xd3 '\323' */ + 0x00, /* 00000000 */ + 0x14, /* 000 0 00 */ + 0x14, /* 000 0 00 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 212 0xd4 '\324' */ + 0x00, /* 00000000 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x18, /* 000 000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 213 0xd5 '\325' */ + 0x00, /* 00000000 */ + 0x18, /* 000 000 */ + 0x08, /* 0000 000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 214 0xd6 '\326' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x7c, /* 0 00 */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 215 0xd7 '\327' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x10, /* 000 0000 */ + 0x28, /* 00 0 000 */ + 0x44, /* 0 000 00 */ + 0x28, /* 00 0 000 */ + 0x10, /* 000 0000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 216 0xd8 '\330' */ + 0x00, /* 00000000 */ + 0x28, /* 00 0 000 */ + 0x00, /* 00000000 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x44, /* 0 000 00 */ + 0x3c, /* 00 00 */ + 0x04, /* 00000 00 */ + 0x38, /* 00 000 */ + 0x00, /* 00000000 */ + + /* 217 0xd9 '\331' */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7e, /* 0 0 */ + 0x00, /* 00000000 */ + 0x7e, /* 0 0 */ + 0x00, /* 00000000 */ + 0x7e, /* 0 0 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 218 0xda '\332' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 219 0xdb '\333' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 220 0xdc '\334' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 221 0xdd '\335' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 222 0xde '\336' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 223 0xdf '\337' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 224 0xe0 '\340' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 225 0xe1 '\341' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 226 0xe2 '\342' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 227 0xe3 '\343' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 228 0xe4 '\344' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 229 0xe5 '\345' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 230 0xe6 '\346' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 231 0xe7 '\347' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 232 0xe8 '\350' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 233 0xe9 '\351' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 234 0xea '\352' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 235 0xeb '\353' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 236 0xec '\354' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 237 0xed '\355' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 238 0xee '\356' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 239 0xef '\357' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 240 0xf0 '\360' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 241 0xf1 '\361' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 242 0xf2 '\362' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 243 0xf3 '\363' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 244 0xf4 '\364' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 245 0xf5 '\365' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 246 0xf6 '\366' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 247 0xf7 '\367' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 248 0xf8 '\370' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 249 0xf9 '\371' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 250 0xfa '\372' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 251 0xfb '\373' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 252 0xfc '\374' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 253 0xfd '\375' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 254 0xfe '\376' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 255 0xff '\377' */ + 0x00, /* 00000000 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x3c, /* 00 00 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + +}; diff --git a/src/gtkglue.c b/src/gtkglue.c index ea66d2f..ba5cbf5 100644 --- a/src/gtkglue.c +++ b/src/gtkglue.c @@ -32,7 +32,7 @@ #include #include -#include /* Apollo/DomainOS needs this _before_ sys/stat.h */ +#include /* Apollo/DomainOS needs this _before_ sys/stat.h */ #include #include "gtkglue.h" @@ -47,8 +47,7 @@ #define DBG_info 3 #define DBG_debug 4 -#define DEBUG_NOT_STATIC -#define BACKEND_NAME xscanimage +#define BACKEND_NAME gtkglue #include "../include/sane/sanei_debug.h" int gsg_message_dialog_active = 0; @@ -63,11 +62,16 @@ unit_string (SANE_Unit unit) switch (unit) { - case SANE_UNIT_NONE: return "none"; - case SANE_UNIT_PIXEL: return "pixel"; - case SANE_UNIT_BIT: return "bit"; - case SANE_UNIT_DPI: return "dpi"; - case SANE_UNIT_PERCENT: return "%"; + case SANE_UNIT_NONE: + return "none"; + case SANE_UNIT_PIXEL: + return "pixel"; + case SANE_UNIT_BIT: + return "bit"; + case SANE_UNIT_DPI: + return "dpi"; + case SANE_UNIT_PERCENT: + return "%"; case SANE_UNIT_MM: d = preferences.length_unit; if (d > 9.9 && d < 10.1) @@ -75,13 +79,14 @@ unit_string (SANE_Unit unit) else if (d > 25.3 && d < 25.5) return "in"; return "mm"; - case SANE_UNIT_MICROSECOND: return "us"; + case SANE_UNIT_MICROSECOND: + return "us"; } return 0; } static void -set_tooltip (GtkTooltips *tooltips, GtkWidget *widget, const char *desc) +set_tooltip (GtkTooltips * tooltips, GtkWidget * widget, const char *desc) { if (desc && desc[0]) #ifdef HAVE_GTK_TOOLTIPS_SET_TIPS @@ -95,8 +100,7 @@ set_tooltip (GtkTooltips *tooltips, GtkWidget *widget, const char *desc) int gsg_make_path (size_t buf_size, char *buf, const char *prog_name, - const char *prefix, const char *dev_name, - const char *postfix) + const char *prefix, const char *dev_name, const char *postfix) { struct passwd *pw; size_t len, extra; @@ -112,7 +116,7 @@ gsg_make_path (size_t buf_size, char *buf, return -1; } snprintf (buf, buf_size, "%s/.sane", pw->pw_dir); - mkdir (buf, 0777); /* ensure ~/.sane directory exists */ + mkdir (buf, 0777); /* ensure ~/.sane directory exists */ len = strlen (buf); @@ -146,8 +150,8 @@ gsg_make_path (size_t buf_size, char *buf, if (dev_name) { /* Turn devicename into valid filename by replacing slashes by - "+-". A lonely `+' gets translated into "++" so we can tell - it from a substituted slash. */ + "+-". A lonely `+' gets translated into "++" so we can tell + it from a substituted slash. */ for (i = 0; dev_name[i]; ++i) { @@ -162,7 +166,7 @@ gsg_make_path (size_t buf_size, char *buf, break; #ifdef HAVE_OS2_H - case ':': /* OS2 can not handle colons in filenames */ + case ':': /* OS2 can not handle colons in filenames */ buf[len++] = '+'; buf[len++] = '_'; break; @@ -208,8 +212,8 @@ set_option (GSGDialog * dialog, int opt_num, void *val, SANE_Action action) if (status != SANE_STATUS_GOOD) { snprintf (buf, sizeof (buf), "Failed to set value of option %s: %s.", - sane_get_option_descriptor (dialog->dev, opt_num)->name, - sane_strstatus (status)); + sane_get_option_descriptor (dialog->dev, opt_num)->name, + sane_strstatus (status)); gsg_error (buf); return; } @@ -231,7 +235,7 @@ gsg_close_dialog_callback (GtkWidget * widget, gpointer data) } void -gsg_message (gchar *title, gchar *message) +gsg_message (gchar * title, gchar * message) { GtkWidget *main_vbox, *label; GtkWidget *button, *message_dialog; @@ -282,7 +286,7 @@ gsg_warning (gchar * warning) } static void -get_filename_button_clicked (GtkWidget *w, gpointer data) +get_filename_button_clicked (GtkWidget * w, gpointer data) { int *clicked = data; *clicked = 1; @@ -297,9 +301,10 @@ gsg_get_filename (const char *label, const char *default_name, filesel = gtk_file_selection_new ((char *) label); - gtk_window_set_modal(GTK_WINDOW(filesel), TRUE); + gtk_window_set_modal (GTK_WINDOW (filesel), TRUE); - gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (filesel)->cancel_button), + gtk_signal_connect (GTK_OBJECT + (GTK_FILE_SELECTION (filesel)->cancel_button), "clicked", (GtkSignalFunc) get_filename_button_clicked, &cancel); gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (filesel)->ok_button), @@ -371,8 +376,8 @@ autobutton_update (GtkWidget * widget, GSGDialogElement * elem) } static void -autobutton_new (GtkWidget *parent, GSGDialogElement *elem, - GtkWidget *label, GtkTooltips *tooltips) +autobutton_new (GtkWidget * parent, GSGDialogElement * elem, + GtkWidget * label, GtkTooltips * tooltips) { GtkWidget *button, *alignment; @@ -380,8 +385,7 @@ autobutton_new (GtkWidget *parent, GSGDialogElement *elem, gtk_container_border_width (GTK_CONTAINER (button), 0); gtk_widget_set_usize (button, 20, 20); gtk_signal_connect (GTK_OBJECT (button), "toggled", - (GtkSignalFunc) autobutton_update, - elem); + (GtkSignalFunc) autobutton_update, elem); set_tooltip (tooltips, button, "Turns on automatic mode."); alignment = gtk_alignment_new (0.0, 1.0, 0.5, 0.5); @@ -411,7 +415,7 @@ button_update (GtkWidget * widget, GSGDialogElement * elem) static void button_new (GtkWidget * parent, const char *name, SANE_Word val, - GSGDialogElement * elem, GtkTooltips *tooltips, const char *desc, + GSGDialogElement * elem, GtkTooltips * tooltips, const char *desc, gint is_settable) { GtkWidget *button; @@ -419,8 +423,7 @@ button_new (GtkWidget * parent, const char *name, SANE_Word val, button = gtk_check_button_new_with_label ((char *) name); gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (button), val); gtk_signal_connect (GTK_OBJECT (button), "toggled", - (GtkSignalFunc) button_update, - elem); + (GtkSignalFunc) button_update, elem); gtk_box_pack_start (GTK_BOX (parent), button, FALSE, TRUE, 0); if (!is_settable) gtk_widget_set_sensitive (GTK_WIDGET (button), FALSE); @@ -440,6 +443,11 @@ scale_update (GtkAdjustment * adj_data, GSGDialogElement * elem) double d; SANE_Status status; + DBG_INIT (); + + DBG (DBG_debug, "scale_update\n"); + + opt_num = elem - dialog->element; opt = sane_get_option_descriptor (dialog->dev, opt_num); switch (opt->type) @@ -460,11 +468,13 @@ scale_update (GtkAdjustment * adj_data, GSGDialogElement * elem) return; } set_option (dialog, opt_num, &val, SANE_ACTION_SET_VALUE); - status = sane_control_option (dialog->dev, opt_num, SANE_ACTION_GET_VALUE, &new_val, - 0); + status = + sane_control_option (dialog->dev, opt_num, SANE_ACTION_GET_VALUE, + &new_val, 0); if (status != SANE_STATUS_GOOD) { - DBG (DBG_fatal, "scale_update: sane_control_option failed: %s\n", sane_strstatus (status)); + DBG (DBG_fatal, "scale_update: sane_control_option failed: %s\n", + sane_strstatus (status)); return; } @@ -502,7 +512,7 @@ value_changed: static void scale_new (GtkWidget * parent, const char *name, gfloat val, gfloat min, gfloat max, gfloat quant, int automatic, - GSGDialogElement * elem, GtkTooltips *tooltips, const char *desc, + GSGDialogElement * elem, GtkTooltips * tooltips, const char *desc, gint is_settable) { GtkWidget *hbox, *label, *scale; @@ -603,10 +613,9 @@ option_menu_callback (GtkWidget * widget, gpointer data) } static void -option_menu_new (GtkWidget *parent, const char *name, char *str_list[], +option_menu_new (GtkWidget * parent, const char *name, char *str_list[], const char *val, GSGDialogElement * elem, - GtkTooltips *tooltips, const char *desc, - gint is_settable) + GtkTooltips * tooltips, const char *desc, gint is_settable) { GtkWidget *hbox, *label, *option_menu, *menu, *item; GSGMenuItem *menu_items; @@ -657,7 +666,7 @@ option_menu_new (GtkWidget *parent, const char *name, char *str_list[], } static void -text_entry_callback (GtkWidget *w, gpointer data) +text_entry_callback (GtkWidget * w, gpointer data) { GSGDialogElement *elem = data; const SANE_Option_Descriptor *opt; @@ -687,8 +696,7 @@ text_entry_callback (GtkWidget *w, gpointer data) static void text_entry_new (GtkWidget * parent, const char *name, const char *val, GSGDialogElement * elem, - GtkTooltips *tooltips, const char *desc, - gint is_settable) + GtkTooltips * tooltips, const char *desc, gint is_settable) { GtkWidget *hbox, *text, *label; @@ -716,9 +724,9 @@ text_entry_new (GtkWidget * parent, const char *name, const char *val, } static GtkWidget * -group_new (GtkWidget *parent, const char * title) +group_new (GtkWidget * parent, const char *title) { - GtkWidget * frame, * vbox; + GtkWidget *frame, *vbox; frame = gtk_frame_new ((char *) title); gtk_container_border_width (GTK_CONTAINER (frame), 4); @@ -732,10 +740,10 @@ group_new (GtkWidget *parent, const char * title) return vbox; } -static GtkWidget* -curve_new (GSGDialog *dialog, int optnum) +static GtkWidget * +curve_new (GSGDialog * dialog, int optnum) { - const SANE_Option_Descriptor * opt; + const SANE_Option_Descriptor *opt; gfloat fmin, fmax, val, *vector; SANE_Word *optval, min, max; GtkWidget *curve, *gamma; @@ -747,7 +755,7 @@ curve_new (GSGDialog *dialog, int optnum) curve = GTK_GAMMA_CURVE (gamma)->curve; dev = dialog->dev; - opt = sane_get_option_descriptor (dev, optnum); + opt = sane_get_option_descriptor (dev, optnum); optlen = opt->size / sizeof (SANE_Word); vector = alloca (optlen * (sizeof (vector[0]) + sizeof (optval[0]))); optval = (SANE_Word *) (vector + optlen); @@ -818,7 +826,7 @@ curve_new (GSGDialog *dialog, int optnum) } static void -vector_new (GSGDialog * dialog, GtkWidget *vbox, int num_vopts, int *vopts) +vector_new (GSGDialog * dialog, GtkWidget * vbox, int num_vopts, int *vopts) { GtkWidget *notebook, *label, *curve; const SANE_Option_Descriptor *opt; @@ -833,7 +841,7 @@ vector_new (GSGDialog * dialog, GtkWidget *vbox, int num_vopts, int *vopts) opt = sane_get_option_descriptor (dialog->dev, vopts[i]); label = gtk_label_new ((char *) opt->title); - vbox = gtk_vbox_new (/* homogeneous */ FALSE, 0); + vbox = gtk_vbox_new ( /* homogeneous */ FALSE, 0); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), vbox, label); gtk_widget_show (vbox); gtk_widget_show (label); @@ -863,7 +871,7 @@ panel_destroy (GSGDialog * dialog) gtk_object_sink (GTK_OBJECT (dialog->tooltips)); # else gtk_object_unref (GTK_OBJECT (dialog->tooltips)); -# endif /* GTK_MAJOR_VERSION == 2 */ +# endif /* GTK_MAJOR_VERSION == 2 */ #endif gtk_widget_destroy (dialog->main_hbox); @@ -886,7 +894,7 @@ panel_destroy (GSGDialog * dialog) } } memset (dialog->element, 0, - dialog->num_elements*sizeof (dialog->element[0])); + dialog->num_elements * sizeof (dialog->element[0])); } static void @@ -907,40 +915,40 @@ panel_build (GSGDialog * dialog) int num_vector_opts = 0, *vector_opts; main_hbox = gtk_hbox_new (FALSE, 2); - + if (dialog->twocolumn) - { - option_vbox = gtk_hbox_new (FALSE, 2); /* two column display */ - } - else - { - option_vbox = gtk_vbox_new (FALSE, 2); /* one column display */ - } + { + option_vbox = gtk_hbox_new (FALSE, 2); /* two column display */ + } + else + { + option_vbox = gtk_vbox_new (FALSE, 2); /* one column display */ + } gtk_box_pack_start (GTK_BOX (main_hbox), option_vbox, FALSE, FALSE, 0); gtk_widget_show (option_vbox); /* standard options vbox */ - standard_vbox = gtk_vbox_new (/* homogeneous */ FALSE, 0); + standard_vbox = gtk_vbox_new ( /* homogeneous */ FALSE, 0); gtk_widget_show (standard_vbox); gtk_box_pack_start (GTK_BOX (option_vbox), standard_vbox, FALSE, FALSE, 0); /* advanced options page */ - advanced_vbox = gtk_vbox_new (/* homogeneous */ FALSE, 0); + advanced_vbox = gtk_vbox_new ( /* homogeneous */ FALSE, 0); gtk_box_pack_start (GTK_BOX (option_vbox), advanced_vbox, TRUE, TRUE, 0); /* use black as foreground: */ dialog->tooltips = gtk_tooltips_new (); - dialog->tooltips_fg.red = 0; + dialog->tooltips_fg.red = 0; dialog->tooltips_fg.green = 0; - dialog->tooltips_fg.blue = 0; + dialog->tooltips_fg.blue = 0; /* postit yellow (khaki) as background: */ gdk_color_alloc (gtk_widget_get_colormap (main_hbox), &dialog->tooltips_fg); - dialog->tooltips_bg.red = 61669; + dialog->tooltips_bg.red = 61669; dialog->tooltips_bg.green = 59113; - dialog->tooltips_bg.blue = 35979; + dialog->tooltips_bg.blue = 35979; gdk_color_alloc (gtk_widget_get_colormap (main_hbox), &dialog->tooltips_bg); /* GTK2 doesn't have the function (seems like it's not needed with GTK2 anyway) */ @@ -1027,7 +1035,7 @@ panel_build (GSGDialog * dialog) goto get_value_failed; button_new (parent, title, val, elem, dialog->tooltips, opt->desc, - SANE_OPTION_IS_SETTABLE(opt->cap)); + SANE_OPTION_IS_SETTABLE (opt->cap)); gtk_widget_show (parent->parent); break; @@ -1058,7 +1066,7 @@ panel_build (GSGDialog * dialog) opt->constraint.range->max, quant, (opt->cap & SANE_CAP_AUTOMATIC), elem, dialog->tooltips, opt->desc, - SANE_OPTION_IS_SETTABLE(opt->cap)); + SANE_OPTION_IS_SETTABLE (opt->cap)); gtk_widget_show (parent->parent); break; @@ -1075,14 +1083,14 @@ panel_build (GSGDialog * dialog) sprintf (str, "%d", val); option_menu_new (parent, title, str_list, str, elem, dialog->tooltips, opt->desc, - SANE_OPTION_IS_SETTABLE(opt->cap)); + SANE_OPTION_IS_SETTABLE (opt->cap)); free (str_list); gtk_widget_show (parent->parent); break; case SANE_CONSTRAINT_NONE: /* having no constraint for an int is strange but allowed - by the SANE standard so we just ignore such options here */ + by the SANE standard so we just ignore such options here */ break; default: @@ -1128,7 +1136,7 @@ panel_build (GSGDialog * dialog) scale_new (parent, title, dval, dmin, dmax, dquant, (opt->cap & SANE_CAP_AUTOMATIC), elem, dialog->tooltips, opt->desc, - SANE_OPTION_IS_SETTABLE(opt->cap)); + SANE_OPTION_IS_SETTABLE (opt->cap)); gtk_widget_show (parent->parent); break; @@ -1146,14 +1154,14 @@ panel_build (GSGDialog * dialog) sprintf (str, "%g", SANE_UNFIX (val)); option_menu_new (parent, title, str_list, str, elem, dialog->tooltips, opt->desc, - SANE_OPTION_IS_SETTABLE(opt->cap)); + SANE_OPTION_IS_SETTABLE (opt->cap)); free (str_list); gtk_widget_show (parent->parent); break; case SANE_CONSTRAINT_NONE: /* having no constraint for a fixed is strange but allowed - by the SANE standard so we just ignore such options here */ + by the SANE standard so we just ignore such options here */ break; default: @@ -1184,14 +1192,14 @@ panel_build (GSGDialog * dialog) option_menu_new (parent, title, (char **) opt->constraint.string_list, buf, elem, dialog->tooltips, opt->desc, - SANE_OPTION_IS_SETTABLE(opt->cap)); + SANE_OPTION_IS_SETTABLE (opt->cap)); gtk_widget_show (parent->parent); break; case SANE_CONSTRAINT_NONE: text_entry_new (parent, title, buf, elem, dialog->tooltips, opt->desc, - SANE_OPTION_IS_SETTABLE(opt->cap)); + SANE_OPTION_IS_SETTABLE (opt->cap)); gtk_widget_show (parent->parent); break; @@ -1265,8 +1273,9 @@ panel_rebuild (GSGDialog * dialog) GSGDialog * gsg_create_dialog (GtkWidget * window, const char *device_name, - GSGCallback option_reload_callback, void *option_reload_arg, - GSGCallback param_change_callback, void *param_change_arg) + GSGCallback option_reload_callback, + void *option_reload_arg, GSGCallback param_change_callback, + void *param_change_arg) { SANE_Int num_elements; GSGDialog *dialog; @@ -1313,7 +1322,7 @@ gsg_create_dialog (GtkWidget * window, const char *device_name, } void -gsg_refresh_dialog (GSGDialog *dialog) +gsg_refresh_dialog (GSGDialog * dialog) { panel_rebuild (dialog); if (dialog->param_change_callback) @@ -1321,7 +1330,7 @@ gsg_refresh_dialog (GSGDialog *dialog) } void -gsg_update_scan_window (GSGDialog *dialog) +gsg_update_scan_window (GSGDialog * dialog) { const SANE_Option_Descriptor *opt; double old_val, new_val; @@ -1339,10 +1348,9 @@ gsg_update_scan_window (GSGDialog *dialog) opt = sane_get_option_descriptor (dialog->dev, optnum); status = sane_control_option (dialog->dev, optnum, - SANE_ACTION_GET_VALUE, - &word, 0); + SANE_ACTION_GET_VALUE, &word, 0); if (status != SANE_STATUS_GOOD) - continue; /* sliently ignore errors */ + continue; /* sliently ignore errors */ switch (opt->constraint_type) { @@ -1373,7 +1381,8 @@ gsg_update_scan_window (GSGDialog *dialog) sprintf (str, "%g", SANE_UNFIX (word)); /* XXX maybe we should call this only when the value changes... */ gtk_option_menu_set_history (GTK_OPTION_MENU (elem->widget), - option_menu_lookup (elem->menu, str)); + option_menu_lookup (elem->menu, + str)); break; default: @@ -1386,7 +1395,7 @@ gsg_update_scan_window (GSGDialog *dialog) vectors, all option values are kept current. Vectors are downloaded into the device during this call. */ void -gsg_sync (GSGDialog *dialog) +gsg_sync (GSGDialog * dialog) { const SANE_Option_Descriptor *opt; gfloat val, *vector; @@ -1400,8 +1409,7 @@ gsg_sync (GSGDialog *dialog) if (!SANE_OPTION_IS_ACTIVE (opt->cap)) continue; - if (opt->type != SANE_TYPE_INT && - opt->type != SANE_TYPE_FIXED) + if (opt->type != SANE_TYPE_INT && opt->type != SANE_TYPE_FIXED) continue; if (opt->size == sizeof (SANE_Word)) @@ -1429,14 +1437,14 @@ gsg_sync (GSGDialog *dialog) } void -gsg_set_advanced (GSGDialog *dialog, int advanced) +gsg_set_advanced (GSGDialog * dialog, int advanced) { dialog->advanced = advanced; panel_rebuild (dialog); } void -gsg_set_tooltips (GSGDialog *dialog, int enable) +gsg_set_tooltips (GSGDialog * dialog, int enable) { if (!dialog->tooltips) return; @@ -1448,14 +1456,14 @@ gsg_set_tooltips (GSGDialog *dialog, int enable) } void -gsg_set_twocolumn (GSGDialog *dialog, int twocolumn) +gsg_set_twocolumn (GSGDialog * dialog, int twocolumn) { dialog->twocolumn = twocolumn; - panel_rebuild (dialog); + panel_rebuild (dialog); } void -gsg_set_sensitivity (GSGDialog *dialog, int sensitive) +gsg_set_sensitivity (GSGDialog * dialog, int sensitive) { const SANE_Option_Descriptor *opt; int i; @@ -1465,8 +1473,7 @@ gsg_set_sensitivity (GSGDialog *dialog, int sensitive) opt = sane_get_option_descriptor (dialog->dev, i); if (!SANE_OPTION_IS_ACTIVE (opt->cap) - || opt->type == SANE_TYPE_GROUP - || !dialog->element[i].widget) + || opt->type == SANE_TYPE_GROUP || !dialog->element[i].widget) continue; if (!(opt->cap & SANE_CAP_ALWAYS_SETTABLE)) diff --git a/src/preview.c b/src/preview.c index c91de50..6fb21c0 100644 --- a/src/preview.c +++ b/src/preview.c @@ -85,8 +85,7 @@ #define DBG_info 3 #define DBG_debug 4 -#define DEBUG_DECLARE_ONLY -#define BACKEND_NAME xscanimage +#define BACKEND_NAME preview #include "../include/sane/sanei_debug.h" #ifndef PATH_MAX @@ -111,11 +110,11 @@ #endif /* forward declarations */ -static void scan_start (Preview *p); -static void scan_done (Preview *p); +static void scan_start (Preview * p); +static void scan_done (Preview * p); static void -draw_rect (GdkWindow *win, GdkGC *gc, int coord[4]) +draw_rect (GdkWindow * win, GdkGC * gc, int coord[4]) { gint x, y, w, h; @@ -137,7 +136,7 @@ draw_rect (GdkWindow *win, GdkGC *gc, int coord[4]) } static void -draw_selection (Preview *p) +draw_selection (Preview * p) { if (!p->gc) /* window isn't mapped yet */ @@ -153,7 +152,7 @@ draw_selection (Preview *p) } static void -update_selection (Preview *p) +update_selection (Preview * p) { float min, max, normal, dev_selection[4]; const SANE_Option_Descriptor *opt; @@ -192,8 +191,9 @@ update_selection (Preview *p) normal = ((i == 0) ? p->preview_width : p->preview_height) - 1; normal /= (max - min); p->selection.active = TRUE; - p->selection.coord[i] = ((dev_selection[i] - min)*normal) + 0.5; - p->selection.coord[i + 2] = ((dev_selection[i + 2] - min)*normal) + 0.5; + p->selection.coord[i] = ((dev_selection[i] - min) * normal) + 0.5; + p->selection.coord[i + 2] = + ((dev_selection[i + 2] - min) * normal) + 0.5; if (p->selection.coord[i + 2] < p->selection.coord[i]) p->selection.coord[i + 2] = p->selection.coord[i]; } @@ -201,7 +201,7 @@ update_selection (Preview *p) } static void -get_image_scale (Preview *p, float *xscalep, float *yscalep) +get_image_scale (Preview * p, float *xscalep, float *yscalep) { float xscale, yscale; @@ -209,9 +209,9 @@ get_image_scale (Preview *p, float *xscalep, float *yscalep) xscale = 1.0; else { - xscale = p->image_width/(float) p->preview_width; - if (p->image_height > 0 && p->preview_height*xscale < p->image_height) - xscale = p->image_height/(float) p->preview_height; + xscale = p->image_width / (float) p->preview_width; + if (p->image_height > 0 && p->preview_height * xscale < p->image_height) + xscale = p->image_height / (float) p->preview_height; } yscale = xscale; @@ -222,32 +222,32 @@ get_image_scale (Preview *p, float *xscalep, float *yscalep) float swidth, sheight; assert (p->surface_type == SANE_TYPE_INT); - swidth = (p->surface[GSG_BR_X] - p->surface[GSG_TL_X] + 1); + swidth = (p->surface[GSG_BR_X] - p->surface[GSG_TL_X] + 1); sheight = (p->surface[GSG_BR_Y] - p->surface[GSG_TL_Y] + 1); xscale = 1.0; yscale = 1.0; if (p->image_width > 0 && swidth < INF) - xscale = p->image_width/swidth; + xscale = p->image_width / swidth; if (p->image_height > 0 && sheight < INF) - yscale = p->image_height/sheight; + yscale = p->image_height / sheight; } *xscalep = xscale; *yscalep = yscale; } static void -paint_image (Preview *p) +paint_image (Preview * p) { float xscale, yscale, src_x, src_y; int dst_x, dst_y, height, x, y, src_offset; gint gwidth, gheight; - gwidth = p->preview_width; + gwidth = p->preview_width; gheight = p->preview_height; get_image_scale (p, &xscale, &yscale); - memset (p->preview_row, 0xff, 3*gwidth); + memset (p->preview_row, 0xff, 3 * gwidth); /* don't draw last line unless it's complete: */ height = p->image_y; @@ -262,7 +262,7 @@ paint_image (Preview *p) y = (int) (src_y + 0.5); if (y >= height) break; - src_offset = y*3*p->image_width; + src_offset = y * 3 * p->image_width; if (p->image_data) for (dst_x = 0; dst_x < gwidth; ++dst_x) @@ -271,9 +271,12 @@ paint_image (Preview *p) if (x >= p->image_width) break; - p->preview_row[3*dst_x + 0] = p->image_data[src_offset + 3*x + 0]; - p->preview_row[3*dst_x + 1] = p->image_data[src_offset + 3*x + 1]; - p->preview_row[3*dst_x + 2] = p->image_data[src_offset + 3*x + 2]; + p->preview_row[3 * dst_x + 0] = + p->image_data[src_offset + 3 * x + 0]; + p->preview_row[3 * dst_x + 1] = + p->image_data[src_offset + 3 * x + 1]; + p->preview_row[3 * dst_x + 2] = + p->image_data[src_offset + 3 * x + 2]; src_x += xscale; } gtk_preview_draw_row (GTK_PREVIEW (p->window), p->preview_row, @@ -284,7 +287,7 @@ paint_image (Preview *p) } static void -display_partial_image (Preview *p) +display_partial_image (Preview * p) { paint_image (p); @@ -293,8 +296,8 @@ display_partial_image (Preview *p) GtkPreview *preview = GTK_PREVIEW (p->window); int src_x, src_y; - src_x = (p->window->allocation.width - preview->buffer_width)/2; - src_y = (p->window->allocation.height - preview->buffer_height)/2; + src_x = (p->window->allocation.width - preview->buffer_width) / 2; + src_y = (p->window->allocation.height - preview->buffer_height) / 2; gtk_preview_put (preview, p->window->window, p->window->style->black_gc, src_x, src_y, 0, 0, p->preview_width, p->preview_height); @@ -302,7 +305,7 @@ display_partial_image (Preview *p) } static void -display_maybe (Preview *p) +display_maybe (Preview * p) { time_t now; @@ -315,13 +318,13 @@ display_maybe (Preview *p) } static void -display_image (Preview *p) +display_image (Preview * p) { if (p->params.lines <= 0 && p->image_y < p->image_height) { p->image_height = p->image_y; p->image_data = realloc (p->image_data, - 3*p->image_width*p->image_height); + 3 * p->image_width * p->image_height); assert (p->image_data); } display_partial_image (p); @@ -329,20 +332,20 @@ display_image (Preview *p) } static void -preview_area_resize (GtkWidget *widget) +preview_area_resize (GtkWidget * widget) { float min_x, max_x, min_y, max_y, xscale, yscale, f; Preview *p; p = gtk_object_get_data (GTK_OBJECT (widget), "PreviewPointer"); - p->preview_width = widget->allocation.width; + p->preview_width = widget->allocation.width; p->preview_height = widget->allocation.height; if (p->preview_row) - p->preview_row = realloc (p->preview_row, 3*p->preview_width); + p->preview_row = realloc (p->preview_row, 3 * p->preview_width); else - p->preview_row = malloc (3*p->preview_width); + p->preview_row = malloc (3 * p->preview_width); /* set the ruler ranges: */ @@ -351,7 +354,7 @@ preview_area_resize (GtkWidget *widget) min_x = 0.0; max_x = p->surface[GSG_BR_X]; - if (max_x >= INF) + if (max_x >= INF) max_x = p->preview_width - 1; min_y = p->surface[GSG_TL_Y]; @@ -359,35 +362,38 @@ preview_area_resize (GtkWidget *widget) min_y = 0.0; max_y = p->surface[GSG_BR_Y]; - if (max_y >= INF) + if (max_y >= INF) max_y = p->preview_height - 1; /* convert mm to inches if that's what the user wants: */ if (p->surface_unit == SANE_UNIT_MM) { - double factor = 1.0/preferences.length_unit; - min_x *= factor; max_x *= factor; min_y *= factor; max_y *= factor; + double factor = 1.0 / preferences.length_unit; + min_x *= factor; + max_x *= factor; + min_y *= factor; + max_y *= factor; } get_image_scale (p, &xscale, &yscale); if (p->surface_unit == SANE_UNIT_PIXEL) - f = 1.0/xscale; + f = 1.0 / xscale; else if (p->image_width) - f = xscale*p->preview_width/p->image_width; + f = xscale * p->preview_width / p->image_width; else f = 1.0; - gtk_ruler_set_range (GTK_RULER (p->hruler), f*min_x, f*max_x, f*min_x, + gtk_ruler_set_range (GTK_RULER (p->hruler), f * min_x, f * max_x, f * min_x, /* max_size */ 20); if (p->surface_unit == SANE_UNIT_PIXEL) - f = 1.0/yscale; + f = 1.0 / yscale; else if (p->image_height) - f = yscale*p->preview_height/p->image_height; + f = yscale * p->preview_height / p->image_height; else f = 1.0; - gtk_ruler_set_range (GTK_RULER (p->vruler), f*min_y, f*max_y, f*min_y, + gtk_ruler_set_range (GTK_RULER (p->vruler), f * min_y, f * max_y, f * min_y, /* max_size */ 20); paint_image (p); @@ -395,13 +401,13 @@ preview_area_resize (GtkWidget *widget) } static void -get_bounds (const SANE_Option_Descriptor *opt, float *minp, float *maxp) +get_bounds (const SANE_Option_Descriptor * opt, float *minp, float *maxp) { float min, max; int i; min = -INF; - max = INF; + max = INF; switch (opt->constraint_type) { case SANE_CONSTRAINT_RANGE: @@ -410,7 +416,7 @@ get_bounds (const SANE_Option_Descriptor *opt, float *minp, float *maxp) break; case SANE_CONSTRAINT_WORD_LIST: - min = INF; + min = INF; max = -INF; for (i = 1; i <= opt->constraint.word_list[0]; ++i) { @@ -436,7 +442,7 @@ get_bounds (const SANE_Option_Descriptor *opt, float *minp, float *maxp) } static void -save_option (Preview *p, int option, SANE_Word *save_loc, int *valid) +save_option (Preview * p, int option, SANE_Word * save_loc, int *valid) { SANE_Status status; @@ -451,7 +457,7 @@ save_option (Preview *p, int option, SANE_Word *save_loc, int *valid) } static void -restore_option (Preview *p, int option, SANE_Word saved_value, int valid) +restore_option (Preview * p, int option, SANE_Word saved_value, int valid) { const SANE_Option_Descriptor *opt; SANE_Status status; @@ -474,7 +480,7 @@ restore_option (Preview *p, int option, SANE_Word saved_value, int valid) } static SANE_Status -set_option_float (Preview *p, int option, float value) +set_option_float (Preview * p, int option, float value) { const SANE_Option_Descriptor *opt; SANE_Handle dev; @@ -504,7 +510,7 @@ set_option_float (Preview *p, int option, float value) } static void -set_option_bool (Preview *p, int option, SANE_Bool value) +set_option_bool (Preview * p, int option, SANE_Bool value) { SANE_Handle dev; SANE_Status status; @@ -513,7 +519,8 @@ set_option_bool (Preview *p, int option, SANE_Bool value) return; dev = p->dialog->dev; - status = sane_control_option (dev, option, SANE_ACTION_SET_VALUE, &value, 0); + status = + sane_control_option (dev, option, SANE_ACTION_SET_VALUE, &value, 0); if (status != SANE_STATUS_GOOD) { DBG (DBG_fatal, "set_option_bool: sane_control_option failed: %s\n", @@ -523,7 +530,7 @@ set_option_bool (Preview *p, int option, SANE_Bool value) } static int -increment_image_y (Preview *p) +increment_image_y (Preview * p) { size_t extra_size, offset; char buf[256]; @@ -532,8 +539,8 @@ increment_image_y (Preview *p) ++p->image_y; if (p->params.lines <= 0 && p->image_y >= p->image_height) { - offset = 3*p->image_width*p->image_height; - extra_size = 3*32*p->image_width; + offset = 3 * p->image_width * p->image_height; + extra_size = 3 * 32 * p->image_width; p->image_height += 32; p->image_data = realloc (p->image_data, offset + extra_size); if (!p->image_data) @@ -560,6 +567,10 @@ input_available (gpointer data, gint source, GdkInputCondition cond) SANE_Int len; int i, j; + DBG_INIT (); + + DBG (DBG_debug, "input_available: enter\n"); + dev = p->dialog->dev; while (1) { @@ -596,7 +607,7 @@ input_available (gpointer data, gint source, GdkInputCondition cond) scan_done (p); return; } - if (!len) /* out of data for now */ + if (!len) /* out of data for now */ { if (p->input_tag < 0) { @@ -618,7 +629,7 @@ input_available (gpointer data, gint source, GdkInputCondition cond) for (i = 0; i < len; ++i) { u_char mask = buf[i]; - + for (j = 7; j >= 0; --j) { u_char gl = (mask & (1 << j)) ? 0xff : 0x00; @@ -649,7 +660,7 @@ input_available (gpointer data, gint source, GdkInputCondition cond) for (i = 0; i < len; ++i) { p->image_data[p->image_offset++] = buf[i]; - if (p->image_offset%3 == 0) + if (p->image_offset % 3 == 0) { if (++p->image_x >= p->image_width && increment_image_y (p) < 0) @@ -660,10 +671,10 @@ input_available (gpointer data, gint source, GdkInputCondition cond) case 16: for (i = 0; i < len; ++i) { - guint16 value = buf [i]; + guint16 value = buf[i]; if ((i % 2) == 1) p->image_data[p->image_offset++] = *(guint8 *) (&value); - if (p->image_offset%6 == 0) + if (p->image_offset % 6 == 0) { if (++p->image_x >= p->image_width && increment_image_y (p) < 0) @@ -715,17 +726,14 @@ input_available (gpointer data, gint source, GdkInputCondition cond) case 16: for (i = 0; i < len; ++i) { - guint16 value = buf [i]; + guint16 value = buf[i]; if ((i % 2) == 1) { - p->image_data[p->image_offset++] = - *(guint8 *) (&value); - p->image_data[p->image_offset++] = - *(guint8 *) (&value); - p->image_data[p->image_offset++] = - *(guint8 *) (&value); + p->image_data[p->image_offset++] = *(guint8 *) (&value); + p->image_data[p->image_offset++] = *(guint8 *) (&value); + p->image_data[p->image_offset++] = *(guint8 *) (&value); } - if (p->image_offset%2 == 0) + if (p->image_offset % 2 == 0) { if (++p->image_x >= p->image_width && increment_image_y (p) < 0) @@ -771,14 +779,14 @@ input_available (gpointer data, gint source, GdkInputCondition cond) return; } break; - + case 16: for (i = 0; i < len; ++i) { - guint16 value = buf [i]; + guint16 value = buf[i]; if ((i % 2) == 1) { - p->image_data[p->image_offset] = *(guint8 *) (&value); + p->image_data[p->image_offset] = *(guint8 *) (&value); p->image_offset += 3; } if (p->image_offset % 2 == 0) @@ -820,7 +828,7 @@ bad_depth: } static void -scan_done (Preview *p) +scan_done (Preview * p) { int i; @@ -846,7 +854,7 @@ scan_done (Preview *p) } static void -scan_start (Preview *p) +scan_start (Preview * p) { SANE_Handle dev = p->dialog->dev; SANE_Status status; @@ -859,7 +867,7 @@ scan_start (Preview *p) gtk_widget_set_sensitive (p->dialog->window->parent->parent->parent, FALSE); /* clear old preview: */ - memset (p->preview_row, 0xff, 3*p->preview_width); + memset (p->preview_row, 0xff, 3 * p->preview_width); for (y = 0; y < p->preview_height; ++y) gtk_preview_draw_row (GTK_PREVIEW (p->window), p->preview_row, 0, y, p->preview_width); @@ -892,10 +900,9 @@ scan_start (Preview *p) return; } - if ((p->params.format >= SANE_FRAME_RGB && + if ((p->params.format >= SANE_FRAME_RGB && p->params.format <= SANE_FRAME_BLUE) && - p->params.depth == 1 && - p->params.pixels_per_line % 8 != 0) + p->params.depth == 1 && p->params.pixels_per_line % 8 != 0) { snprintf (buf, sizeof (buf), "Can't handle unaligned 1 bit RGB or three-pass mode."); @@ -903,7 +910,7 @@ scan_start (Preview *p) scan_done (p); return; } - + p->image_offset = p->image_x = p->image_y = 0; if (p->params.format >= SANE_FRAME_RED @@ -917,7 +924,7 @@ scan_start (Preview *p) if (p->image_data) free (p->image_data); - p->image_width = p->params.pixels_per_line; + p->image_width = p->params.pixels_per_line; p->image_height = p->params.lines; if (p->image_height < 0) p->image_height = 32; /* may have to adjust as we go... */ @@ -931,7 +938,7 @@ scan_start (Preview *p) scan_done (p); return; } - memset (p->image_data, 0xff, 3*p->image_width*p->image_height); + memset (p->image_data, 0xff, 3 * p->image_width * p->image_height); } if (p->selection.active) @@ -944,13 +951,15 @@ scan_start (Preview *p) if (sane_set_io_mode (dev, SANE_TRUE) == SANE_STATUS_GOOD && sane_get_select_fd (dev, &fd) == SANE_STATUS_GOOD) - p->input_tag = gdk_input_add (fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, input_available, p); + p->input_tag = + gdk_input_add (fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, + input_available, p); else input_available (p, -1, GDK_INPUT_READ); } static void -establish_selection (Preview *p) +establish_selection (Preview * p) { float min, max, normal, dev_selection[4]; int i; @@ -966,10 +975,11 @@ establish_selection (Preview *p) if (max >= INF) max = p->preview_width; - normal = 1.0/(((i == 0) ? p->preview_width : p->preview_height) - 1); + normal = + 1.0 / (((i == 0) ? p->preview_width : p->preview_height) - 1); normal *= (max - min); - dev_selection[i] = p->selection.coord[i]*normal + min; - dev_selection[i + 2] = p->selection.coord[i + 2]*normal + min; + dev_selection[i] = p->selection.coord[i] * normal + min; + dev_selection[i + 2] = p->selection.coord[i + 2] * normal + min; } for (i = 0; i < 4; ++i) set_option_float (p, p->dialog->well_known.coord[i], dev_selection[i]); @@ -980,14 +990,14 @@ establish_selection (Preview *p) } static int -make_preview_image_path (Preview *p, size_t filename_size, char *filename) +make_preview_image_path (Preview * p, size_t filename_size, char *filename) { return gsg_make_path (filename_size, filename, 0, "preview-", p->dialog->dev_name, ".ppm"); } static void -restore_preview_image (Preview *p) +restore_preview_image (Preview * p) { u_int psurface_type, psurface_unit; char filename[PATH_MAX]; @@ -1009,8 +1019,7 @@ restore_preview_image (Preview *p) (e.g., consider an image whose first image byte is 13 (`\r'). */ if (fscanf (in, "P6\n# surface: %g %g %g %g %u %u\n%d %d\n255%*[\n]", psurface + 0, psurface + 1, psurface + 2, psurface + 3, - &psurface_type, &psurface_unit, - &width, &height) != 8) + &psurface_type, &psurface_unit, &width, &height) != 8) return; if (GROSSLY_DIFFERENT (psurface[0], p->surface[0]) @@ -1025,19 +1034,19 @@ restore_preview_image (Preview *p) p->image_height = height; if ((width == 0) || (height == 0)) return; - p->image_data = malloc (3*width*height); + p->image_data = malloc (3 * width * height); if (!p->image_data) return; - nread = fread (p->image_data, 3, width*height, in); + nread = fread (p->image_data, 3, width * height, in); - p->image_y = nread/width; - p->image_x = nread%width; + p->image_y = nread / width; + p->image_x = nread % width; } /* This is executed _after_ the gtkpreview's expose routine. */ static gint -expose_handler (GtkWidget *window, GdkEvent *event, gpointer data) +expose_handler (GtkWidget * window, GdkEvent * event, gpointer data) { Preview *p = data; @@ -1047,7 +1056,7 @@ expose_handler (GtkWidget *window, GdkEvent *event, gpointer data) } static gint -event_handler (GtkWidget *window, GdkEvent *event, gpointer data) +event_handler (GtkWidget * window, GdkEvent * event, gpointer data) { Preview *p = data; int i, tmp; @@ -1135,19 +1144,19 @@ event_handler (GtkWidget *window, GdkEvent *event, gpointer data) } static void -start_button_clicked (GtkWidget *widget, gpointer data) +start_button_clicked (GtkWidget * widget, gpointer data) { preview_scan (data); } static void -cancel_button_clicked (GtkWidget *widget, gpointer data) +cancel_button_clicked (GtkWidget * widget, gpointer data) { scan_done (data); } static void -top_destroyed (GtkWidget *widget, gpointer call_data) +top_destroyed (GtkWidget * widget, gpointer call_data) { Preview *p = call_data; @@ -1155,7 +1164,7 @@ top_destroyed (GtkWidget *widget, gpointer call_data) } Preview * -preview_new (GSGDialog *dialog) +preview_new (GSGDialog * dialog) { static int first_time = 1; GtkWidget *table, *frame; @@ -1200,7 +1209,7 @@ preview_new (GSGDialog *dialog) /* padding */ 0); /* the empty box in the top-left corner */ - frame = gtk_frame_new (/* label */ 0); + frame = gtk_frame_new ( /* label */ 0); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT); gtk_table_attach (GTK_TABLE (table), frame, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 0, 0); @@ -1223,8 +1232,7 @@ preview_new (GSGDialog *dialog) GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | - GDK_BUTTON_PRESS_MASK | - GDK_BUTTON_RELEASE_MASK); + GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK); gtk_signal_connect (GTK_OBJECT (p->window), "event", (GtkSignalFunc) event_handler, p); gtk_signal_connect_after (GTK_OBJECT (p->window), "expose_event", @@ -1254,7 +1262,7 @@ preview_new (GSGDialog *dialog) gtk_signal_connect_object (GTK_OBJECT (p->window), "motion_notify_event", signal_func, GTK_OBJECT (p->vruler)); - p->viewport = gtk_frame_new (/* label */ 0); + p->viewport = gtk_frame_new ( /* label */ 0); gtk_frame_set_shadow_type (GTK_FRAME (p->viewport), GTK_SHADOW_IN); gtk_container_add (GTK_CONTAINER (p->viewport), p->window); @@ -1297,7 +1305,7 @@ preview_new (GSGDialog *dialog) } void -preview_update (Preview *p) +preview_update (Preview * p) { float val, width, height, max_width, max_height; const SANE_Option_Descriptor *opt; @@ -1352,16 +1360,16 @@ preview_update (Preview *p) /* guess the initial preview window size: */ - width = p->surface[GSG_BR_X] - p->surface[GSG_TL_X]; + width = p->surface[GSG_BR_X] - p->surface[GSG_TL_X]; height = p->surface[GSG_BR_Y] - p->surface[GSG_TL_Y]; if (p->surface_type == SANE_TYPE_INT) { - width += 1.0; + width += 1.0; height += 1.0; } else { - width += SANE_UNFIX (1.0); + width += SANE_UNFIX (1.0); height += SANE_UNFIX (1.0); } @@ -1370,46 +1378,46 @@ preview_update (Preview *p) if (width >= INF || height >= INF) p->aspect = 1.0; else - p->aspect = width/height; + p->aspect = width / height; if (surface_changed) { - max_width = 0.5 * gdk_screen_width(); - max_height = 0.5 * gdk_screen_height(); + max_width = 0.5 * gdk_screen_width (); + max_height = 0.5 * gdk_screen_height (); } else { - max_width = p->window->allocation.width; + max_width = p->window->allocation.width; max_height = p->window->allocation.height; } if (p->surface_unit != SANE_UNIT_PIXEL) { - width = max_width; + width = max_width; height = width / p->aspect; if (height > max_height) { height = max_height; - width = height * p->aspect; + width = height * p->aspect; } } else { if (width > max_width) - width = max_width; + width = max_width; if (height > max_height) height = max_height; } /* re-adjust so we maintain aspect without exceeding max size: */ - if (width/height != p->aspect) + if (width / height != p->aspect) { if (p->aspect > 1.0) - height = width/p->aspect; + height = width / p->aspect; else - width = height*p->aspect; + width = height * p->aspect; } p->preview_width = width + 0.5; @@ -1428,7 +1436,7 @@ preview_update (Preview *p) } void -preview_scan (Preview *p) +preview_scan (Preview * p) { float min, max, swidth, sheight, width, height, dpi = 0; const SANE_Option_Descriptor *opt; @@ -1450,25 +1458,25 @@ preview_scan (Preview *p) opt = sane_get_option_descriptor (p->dialog->dev, p->dialog->well_known.dpi); - gwidth = p->preview_width; + gwidth = p->preview_width; gheight = p->preview_height; height = gheight; - width = height*p->aspect; + width = height * p->aspect; if (width > gwidth) { - width = gwidth; - height = width/p->aspect; + width = gwidth; + height = width / p->aspect; } swidth = (p->surface[GSG_BR_X] - p->surface[GSG_TL_X]); if (swidth < INF) - dpi = MM_PER_INCH*width/swidth; + dpi = MM_PER_INCH * width / swidth; else { sheight = (p->surface[GSG_BR_Y] - p->surface[GSG_TL_Y]); if (sheight < INF) - dpi = MM_PER_INCH*height/sheight; + dpi = MM_PER_INCH * height / sheight; else dpi = 18.0; } @@ -1493,7 +1501,7 @@ preview_scan (Preview *p) } void -preview_destroy (Preview *p) +preview_destroy (Preview * p) { char filename[PATH_MAX]; FILE *out; @@ -1512,7 +1520,7 @@ preview_destroy (Preview *p) p->surface[0], p->surface[1], p->surface[2], p->surface[3], p->surface_type, p->surface_unit, p->image_width, p->image_height); - fwrite (p->image_data, 3, p->image_width*p->image_height, out); + fwrite (p->image_data, 3, p->image_width * p->image_height, out); fclose (out); } } diff --git a/src/xcam.c b/src/xcam.c index ea88490..bd07553 100644 --- a/src/xcam.c +++ b/src/xcam.c @@ -1,6 +1,11 @@ /* xcam -- X-based camera frontend Uses the SANE library. Copyright (C) 1997 David Mosberger and Tristan Tarrant + + Update 2005 Gerard Klaver + The add_text routine and font_6x11.h file are taken from the (GPLed) + webcam.c file, part of xawtv, (c) 1998-2002 Gerd Knorr. + add_text was modified for this program (xcam_add_text). This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -18,26 +23,44 @@ #include "../include/sane/config.h" +#include "../include/lalloca.h" + #include #include #include +#include #include +#include #include #include #include #include +#include + +/* for xcam_add-text routine */ +#include "font_6x11.h" +/*-----------------------*/ + #include +#include #include "gtkglue.h" #include "preferences.h" + #include +#include #include "../include/sane/sanei.h" +#define BACKEND_NAME xcam +#include "../include/sane/sanei_debug.h" + #ifndef PATH_MAX # define PATH_MAX 1024 #endif +#define OUTFILENAME "out.pnm" + #define MAX_LUM 64 /* how many graylevels for 8 bit displays */ #ifndef HAVE_ATEXIT @@ -45,51 +68,110 @@ #endif typedef struct Canvas - { - GtkWidget *preview; - GdkGC *gc; - GdkImage *gdk_image; - GdkColormap *graylevel_cmap; /* for 8 bit displays */ - guint32 graylevel[MAX_LUM]; /* graylevel pixels */ - GdkColormap *cube_cmap; - GdkColor cube_colors[5 * 6 * 5]; - } +{ + GtkWidget *preview; + GdkGC *gc; + GdkImage *gdk_image; + GdkColormap *graylevel_cmap; /* for 8 bit displays */ + guint32 graylevel[MAX_LUM]; /* graylevel pixels */ + GdkColormap *cube_cmap; + GdkColor cube_colors[5 * 6 * 5]; +} Canvas; static const char *prog_name; static const SANE_Device **device; static GSGDialog *dialog; -static char settings_filename[1024] = "settings.dat"; +static char device_settings_filename[1024] = "device.rc"; + +#define DBG_fatal 0 +#define DBG_error 1 +#define DBG_warning 2 +#define DBG_info 3 +#define DBG_debug 4 static struct +{ + GtkWidget *shell; + GtkWidget *dialog_box; + GtkWidget *play_stop_label; + GtkWidget *info_label; + GtkWidget *device_info_label; + GtkWidget *save_frame_label; + GtkWidget *rgb_bgr_label; + GtkWidget *txt_label; + struct { - GtkWidget *shell; - GtkWidget *dialog_box; - GtkWidget *play_stop_label; - GtkWidget *device_info_label; - struct - { - GtkWidget *item; /* the menu bar item */ - GtkWidget *menu; /* the associated menu */ - } - devices; - Canvas canvas; - gint gdk_input_tag; /* tag returned by gdk_input_add () */ - int playing; /* are we playing video? */ - - SANE_Byte buf[32768]; - SANE_Int remaining; - SANE_Parameters params; - gpointer data; /* image data */ - int x; /* x position */ + GtkWidget *item; /* the menu bar item */ + GtkWidget *menu; /* the associated menu */ } + devices; + Canvas canvas; + gint gdk_input_tag; /* tag returned by gdk_input_add () */ + int playing; /* are we playing video? */ + int saving; /* are we saving to file */ + + SANE_Byte *buf; + size_t buf_backend_size; + SANE_Int remaining; + SANE_Parameters params; + gpointer data; /* image data */ + int x, y; /* x and y position */ + int input_tag; +/* for standalone mode: */ + GtkWidget *filename_entry; + FILE *out; + long header_size; + gboolean have_odd_byte; + guint8 odd_byte; + + int num_bytes; + int bytes_read; + char picmsg_ps[50]; + int value_rgb; + int value_txt; + + double fps; + double fps_av; + long f_count; + time_t time1; + time_t time2; +} win; + + /* forward declarations: */ -static void rescan_devices (GtkWidget *widget, gpointer client_data, +int main (int argc, char **argv); + +static void rescan_devices (GtkWidget * widget, gpointer client_data, gpointer call_data); static void next_frame (void); +static void save_frame (void); + +static void update_param (GSGDialog * dialog, void *arg); + +static void load_defaults (int silent); + +static struct option long_options[] = { + {"help", no_argument, NULL, 'h'}, + {"version", no_argument, NULL, 'V'}, + {"buffersize", no_argument, NULL, 'B'}, + {0, 0, 0, 0} +}; + +/* Test if this machine is little endian (from coolscan.c) */ +/* static gboolean +calc_little_endian (void) +{ + SANE_Int testvalue = 255; + u_int8_t *firstbyte = (u_int8_t *) & testvalue; + + if (*firstbyte == 255) + return TRUE; + return FALSE; +} */ #define CANVAS_EVENT_MASK GDK_BUTTON1_MOTION_MASK | \ GDK_EXPOSURE_MASK | \ @@ -97,7 +179,7 @@ static void next_frame (void); GDK_ENTER_NOTIFY_MASK static void -display_image (Canvas *canvas) +display_image (Canvas * canvas) { if (canvas->gdk_image) { @@ -109,7 +191,7 @@ display_image (Canvas *canvas) } static gint -canvas_events (GtkWidget *widget, GdkEvent *event) +canvas_events (GtkWidget * widget, GdkEvent * event) { Canvas *canvas = &win.canvas; if (!canvas) @@ -135,7 +217,7 @@ canvas_events (GtkWidget *widget, GdkEvent *event) case GDK_ENTER_NOTIFY: #if 0 gdk_colors_store (win.canvas.cube_cmap, win.canvas.cube_colors, - NELEMS(win.canvas.cube_colors)); + NELEMS (win.canvas.cube_colors)); #endif break; @@ -148,22 +230,31 @@ canvas_events (GtkWidget *widget, GdkEvent *event) static void stop_camera (void) { + DBG (DBG_debug, "xcam: stop_camera: enter\n"); + if (dialog) sane_cancel (gsg_dialog_get_device (dialog)); if (win.gdk_input_tag >= 0) - gdk_input_remove (win.gdk_input_tag); + { + gdk_input_remove (win.gdk_input_tag); + } else win.playing = FALSE; win.gdk_input_tag = -1; if (!win.playing) - gtk_label_set (GTK_LABEL (win.play_stop_label), "Play"); + gtk_label_set (GTK_LABEL (win.play_stop_label), " Play "); + else + gtk_label_set (GTK_LABEL (win.play_stop_label), " Stop "); + + DBG (DBG_debug, "xcam: stop_camera: exit\n"); } static void -switch_device (const SANE_Device *dev) +switch_device (const SANE_Device * dev) { char buf[512]; + DBG (DBG_debug, "xcam: switch_device: enter\n"); if (win.playing) { win.playing = FALSE; @@ -176,9 +267,11 @@ switch_device (const SANE_Device *dev) dialog = gsg_create_dialog (GTK_WIDGET (win.dialog_box), dev->name, 0, 0, 0, 0); buf[0] = '\0'; + if (dialog) sprintf (buf, "%s %s %s", dev->vendor, dev->model, dev->type); gtk_label_set (GTK_LABEL (win.device_info_label), buf); + DBG (DBG_debug, "xcam: switch_device: exit\n"); } static void @@ -187,6 +280,7 @@ switch_device_by_name (const char *device_name) SANE_Device dev_info; int i; + DBG (DBG_debug, "xcam: switch_device_by_name: enter\n"); for (i = 0; device[i]; ++i) if (strcmp (device[i]->name, device_name) == 0) { @@ -195,17 +289,12 @@ switch_device_by_name (const char *device_name) } /* the backends don't know about this device yet---make up an entry: */ - dev_info.name = device_name; + dev_info.name = device_name; dev_info.vendor = "Unknown"; - dev_info.model = ""; - dev_info.type = ""; + dev_info.model = ""; + dev_info.type = ""; switch_device (&dev_info); -} - -static int -make_default_filename (size_t buf_size, char *buf, const char *dev_name) -{ - return gsg_make_path (buf_size, buf, "xcam", 0, dev_name, ".rc"); + DBG (DBG_debug, "xcam: switch_device_by_name: exit\n"); } static void @@ -213,6 +302,8 @@ save_settings (const char *filename) { int fd; + DBG (DBG_debug, "xcam: save_settings: enter\n"); + fd = open (filename, O_WRONLY | O_CREAT | O_TRUNC, 0666); if (fd < 0) { @@ -227,15 +318,168 @@ save_settings (const char *filename) write (fd, "\n", 1); sanei_save_values (fd, dialog->dev); close (fd); + DBG (DBG_debug, "xcam: save_settings: exit\n"); } +#define MSG_MAXLEN 45 +#define CHAR_HEIGHT 11 +#define CHAR_WIDTH 6 +#define CHAR_START 4 + +static SANE_Status +xcam_add_text (SANE_Byte * image, int width, int height, char *txt) +{ + SANE_Status status; + time_t t; + struct tm *tm; + char line[MSG_MAXLEN + 1]; + SANE_Byte *ptr; + int i, x, y, f, len; + char fmtstring[25] = " %Y-%m-%d %H:%M:%S"; + char fmttxt[46]; + + DBG (DBG_debug, "xcam_add_text: enter\n"); + time (&t); + tm = localtime (&t); + if (strlen (txt) > (MSG_MAXLEN - 23)) + strncpy (fmttxt, txt, (MSG_MAXLEN - 23)); + else + strcpy (fmttxt, txt); + strcat (fmttxt, fmtstring); + + len = strftime (line, MSG_MAXLEN, fmttxt, tm); + + for (y = 0; y < CHAR_HEIGHT; y++) + { + ptr = image + 3 * width * (height - CHAR_HEIGHT - 2 + y) + 12; + + for (x = 0; x < len; x++) + { + f = fontdata[line[x] * CHAR_HEIGHT + y]; + for (i = CHAR_WIDTH - 1; i >= 0; i--) + { + if (f & (CHAR_START << i)) + { + ptr[0] = 255; + ptr[1] = 255; + ptr[2] = 255; + } + ptr += 3; + } /* for i */ + } /* for x */ + } /* for y */ + + DBG (DBG_debug, "xcam_add_text: exit vw=%d, vh=%d\n", width, height); + status = (SANE_STATUS_GOOD); + return status; + +} + + +/* Update the info line with the latest size information. */ +static void +update_param (GSGDialog * dialog, void *arg) +{ + gchar buf[200]; + + DBG (DBG_debug, "xcam: update_param: enter\n"); + if (!win.info_label) + return; + + if (sane_get_parameters (gsg_dialog_get_device (dialog), &win.params) + == SANE_STATUS_GOOD) + { + double size = + (double) win.params.bytes_per_line * (double) win.params.lines; + const char *unit = "B"; + + if (win.params.lines == -1) + { + snprintf (buf, sizeof (buf), "%dxunknown: unknown size", + win.params.pixels_per_line); + } + else + { + if (win.params.format >= SANE_FRAME_RED + && win.params.format <= SANE_FRAME_BLUE) + size *= 3; + + if (size >= 1024 * 1024) + { + size /= 1024 * 1024; + unit = "MByte"; + } + else if (size >= 1024) + { + size /= 1024; + unit = "kByte"; + } + snprintf (buf, sizeof (buf), + "%dx%d %1.1f %s \n%6ld f_count\n%2.2f fps %2.2f fps_av", + win.params.pixels_per_line, win.params.lines, size, unit, + win.f_count, win.fps, win.fps_av); + } + } + else + snprintf (buf, sizeof (buf), "Invalid parameters."); + gtk_label_set (GTK_LABEL (win.info_label), buf); + + DBG (DBG_debug, "xcam: update_param: exit\n"); +} + +static void +pref_xcam_save (void) +{ + char filename[PATH_MAX]; + int fd; + + DBG (DBG_debug, "xcam: pref_xcam_save: enter\n"); + /* first save xcam-specific preferences: */ + gsg_make_path (sizeof (filename), filename, "xcam", "xcam", 0, ".rc"); + fd = open (filename, O_WRONLY | O_CREAT | O_TRUNC, 0666); + if (fd < 0) + { + char buf[256]; + + snprintf (buf, sizeof (buf), "Failed to create file: %s.", + strerror (errno)); + gsg_error (buf); + return; + } + preferences_save (fd); + close (fd); + DBG (DBG_debug, "xcam: pref_xcam_save: exit\n"); +} + +static void +pref_xcam_restore (void) +{ + char filename[PATH_MAX]; + int fd; + + DBG (DBG_debug, "xcam: pref_xcam_restore: enter\n"); + gsg_make_path (sizeof (filename), filename, "xcam", "xcam", 0, ".rc"); + fd = open (filename, O_RDONLY); + if (fd >= 0) + { + preferences_restore (fd); + close (fd); + } + if (!preferences.filename) + preferences.filename = strdup (OUTFILENAME); + DBG (DBG_debug, "xcam: pref_xcam_restore: exit\n"); +} + + static void load_settings (const char *filename, int silent) { - char buf[2*PATH_MAX]; + char buf[2 * PATH_MAX]; char *end; int fd; + DBG (DBG_debug, "xcam: load_settings: enter\n"); + fd = open (filename, O_RDONLY); if (fd < 0) { @@ -245,7 +489,7 @@ load_settings (const char *filename, int silent) filename, strerror (errno)); gsg_error (buf); } - return; /* fail silently */ + return; /* fail silently */ } /* first, read off the devicename that these settings are for: */ @@ -272,42 +516,57 @@ load_settings (const char *filename, int silent) close (fd); gsg_refresh_dialog (dialog); + + DBG (DBG_debug, "xcam: load_settings: exit\n"); +} + +static int +make_default_filename (size_t buf_size, char *buf, const char *dev_name) +{ + return gsg_make_path (buf_size, buf, "xcam", 0, dev_name, ".rc"); } static void load_defaults (int silent) { char filename[PATH_MAX]; + int fd; + DBG (DBG_debug, "xcam, load_defaults: enter\n"); if (make_default_filename (sizeof (filename), filename, dialog->dev_name) < 0) return; + if (fd < 0) + return; load_settings (filename, silent); + sanei_load_values (fd, dialog->dev); + DBG (DBG_debug, "xcam, load_defaults: exit\n"); } void -device_name_dialog_cancel (GtkWidget *widget, gpointer data) +device_name_dialog_cancel (GtkWidget * widget, gpointer data) { gtk_widget_destroy (data); } void -device_name_dialog_ok (GtkWidget *widget, gpointer data) +device_name_dialog_ok (GtkWidget * widget, gpointer data) { GtkWidget *text = data; const char *name; name = gtk_entry_get_text (GTK_ENTRY (text)); if (!name) - return; /* huh? how come? */ + return; /* huh? how come? */ switch_device_by_name (name); gtk_widget_destroy (gtk_widget_get_toplevel (text)); } static void -prompt_for_device_name (GtkWidget *widget, gpointer data) +prompt_for_device_name (GtkWidget * widget, gpointer data) { + DBG (DBG_debug, "xcam: prompt_for_device_name: enter\n"); GtkWidget *vbox, *hbox, *label, *text; GtkWidget *button, *dialog; @@ -354,10 +613,11 @@ prompt_for_device_name (GtkWidget *widget, gpointer data) gtk_widget_show (text); gtk_widget_show (vbox); gtk_widget_show (dialog); + DBG (DBG_debug, "xcam: prompt_for_device_name: exit\n"); } static void -exit_callback (GtkWidget *widget, gpointer data) +exit_callback (GtkWidget * widget, gpointer data) { if (dialog) gsg_destroy_dialog (dialog); @@ -366,7 +626,7 @@ exit_callback (GtkWidget *widget, gpointer data) } static void -save_defaults_callback (GtkWidget *widget, gpointer data) +save_defaults_callback (GtkWidget * widget, gpointer data) { char buf[PATH_MAX]; @@ -376,32 +636,65 @@ save_defaults_callback (GtkWidget *widget, gpointer data) } static void -load_defaults_callback (GtkWidget *widget, gpointer data) +load_defaults_callback (GtkWidget * widget, gpointer data) { load_defaults (0); } static void -save_as_callback (GtkWidget *widget, gpointer data) +save_as_callback (GtkWidget * widget, gpointer data) { - if (gsg_get_filename ("File to save settings to", settings_filename, - sizeof (settings_filename), settings_filename) < 0) + if (gsg_get_filename ("File to save settings to", device_settings_filename, + sizeof (device_settings_filename), + device_settings_filename) < 0) return; - save_settings (settings_filename); + save_settings (device_settings_filename); } static void -load_from_callback (GtkWidget *widget, gpointer data) +load_from_callback (GtkWidget * widget, gpointer data) { - if (gsg_get_filename ("File to load settings from", settings_filename, - sizeof (settings_filename), settings_filename) < 0) + if (gsg_get_filename + ("File to load settings from", device_settings_filename, + sizeof (device_settings_filename), device_settings_filename) < 0) return; - load_settings (settings_filename, 0); + load_settings (device_settings_filename, 0); +} + +static void +buttons_disable (void) +{ + + DBG (DBG_debug, "xcam: buttons_disable: enter\n"); + + gsg_set_sensitivity (dialog, FALSE); + gtk_widget_set_sensitive (win.play_stop_label, FALSE); + gtk_widget_set_sensitive (win.save_frame_label, FALSE); + gtk_widget_set_sensitive (win.rgb_bgr_label, FALSE); + gtk_widget_set_sensitive (win.txt_label, FALSE); + + DBG (DBG_debug, "xcam: buttons_disable: exit\n"); +} + +static void +buttons_enable (void) +{ + + DBG (DBG_debug, "xcam: buttons_enable: enter\n"); + + gsg_set_sensitivity (dialog, TRUE); + gtk_widget_set_sensitive (win.play_stop_label, TRUE); + gtk_widget_set_sensitive (win.save_frame_label, TRUE); + gtk_widget_set_sensitive (win.rgb_bgr_label, TRUE); + gtk_widget_set_sensitive (win.txt_label, TRUE); + + DBG (DBG_debug, "xcam: buttons_enable: exit\n"); } static GtkWidget * build_files_menu (void) { + DBG (DBG_debug, "xcam: build_files_menu: enter\n"); GtkWidget *menu, *item; menu = gtk_menu_new (); @@ -416,6 +709,7 @@ build_files_menu (void) (GtkSignalFunc) exit_callback, 0); gtk_widget_show (item); + DBG (DBG_debug, "xcam: build_files_menu: exit\n"); return menu; } @@ -428,7 +722,7 @@ delayed_switch (gpointer data) } static void -device_activate_callback (GtkWidget *widget, gpointer data) +device_activate_callback (GtkWidget * widget, gpointer data) { gtk_idle_add (delayed_switch, data); } @@ -437,18 +731,18 @@ static GtkWidget * build_device_menu (void) { GtkWidget *menu, *item; - SANE_Status result; + SANE_Status status; int i; menu = gtk_menu_new (); - result = sane_get_devices (&device, SANE_FALSE); - if (result != SANE_STATUS_GOOD) + status = sane_get_devices (&device, SANE_FALSE); + if (status != SANE_STATUS_GOOD) { - fprintf (stderr, "%s: %s\n", prog_name, sane_strstatus (result)); + fprintf (stderr, "%s: %s\n", prog_name, sane_strstatus (status)); exit (1); } - + for (i = 0; device[i]; ++i) { item = gtk_menu_item_new_with_label ((char *) device[i]->name); @@ -479,28 +773,31 @@ build_device_menu (void) } static void -pref_toggle_advanced (GtkWidget *widget, gpointer data) +pref_toggle_advanced (GtkWidget * widget, gpointer data) { preferences.advanced = (GTK_CHECK_MENU_ITEM (widget)->active != 0); gsg_set_advanced (dialog, preferences.advanced); + pref_xcam_save (); } static void -pref_toggle_tooltips (GtkWidget *widget, gpointer data) +pref_toggle_tooltips (GtkWidget * widget, gpointer data) { preferences.tooltips_enabled = (GTK_CHECK_MENU_ITEM (widget)->active != 0); gsg_set_tooltips (dialog, preferences.tooltips_enabled); + pref_xcam_save (); } static void -pref_toggle_twocolumn (GtkWidget *widget, gpointer data) +pref_toggle_twocolumn (GtkWidget * widget, gpointer data) { preferences.twocolumn_enabled = (GTK_CHECK_MENU_ITEM (widget)->active != 0); gsg_set_twocolumn (dialog, preferences.twocolumn_enabled); + pref_xcam_save (); } static GtkWidget * -build_preferences_menu (GSGDialog *dialog) +build_preferences_menu (GSGDialog * dialog) { GtkWidget *menu, *item; @@ -524,7 +821,7 @@ build_preferences_menu (GSGDialog *dialog) gtk_widget_show (item); gtk_signal_connect (GTK_OBJECT (item), "toggled", (GtkSignalFunc) pref_toggle_tooltips, 0); - + /* twocolumn submenu: */ item = gtk_check_menu_item_new_with_label ("Show two column display"); @@ -571,7 +868,7 @@ build_preferences_menu (GSGDialog *dialog) } static void -rescan_devices (GtkWidget *widget, gpointer client_data, gpointer call_data) +rescan_devices (GtkWidget * widget, gpointer client_data, gpointer call_data) { gtk_widget_destroy (GTK_WIDGET (win.devices.menu)); win.devices.menu = build_device_menu (); @@ -722,15 +1019,17 @@ input_available (gpointer ignore, gint source, GdkInputCondition cond) GdkByteOrder byte_order; u_long bytes_per_pixel; SANE_Frame format; - SANE_Status result; + SANE_Status status; SANE_Int len; u_char *dst; + DBG (DBG_debug, "xcam: input available: enter\n"); + if (!win.playing) /* looks like we got cancelled */ goto stop_and_exit; - buf_size = sizeof (win.buf); + buf_size = win.buf_backend_size; format = win.params.format; src_depth = win.params.depth; dst_depth = win.canvas.gdk_image->depth; @@ -741,7 +1040,7 @@ input_available (gpointer ignore, gint source, GdkInputCondition cond) x = win.x; dst = win.data; - src_mask = 0x80; /* SANE has left most bit is most significant bit */ + src_mask = 0x80; /* SANE has left most bit is most significant bit */ dst_mask = 0x01; r_shift = win.canvas.gdk_image->visual->red_shift; @@ -750,24 +1049,25 @@ input_available (gpointer ignore, gint source, GdkInputCondition cond) while (1) { - result = sane_read (gsg_dialog_get_device (dialog), + status = sane_read (gsg_dialog_get_device (dialog), win.buf + remaining, buf_size - remaining, &len); - if (result != SANE_STATUS_GOOD) + if (status != SANE_STATUS_GOOD) { - if (result == SANE_STATUS_EOF) + if (status == SANE_STATUS_EOF) { display_image (&win.canvas); stop_camera (); if (win.playing) { - next_frame (); /* arrange for next frame */ + next_frame (); /* arrange for next frame */ return; } } else { char buf[256]; - sprintf (buf, "Error during read: %s.", sane_strstatus (result)); + sprintf (buf, "Error during read: %s.", + sane_strstatus (status)); gsg_error (buf); } win.playing = FALSE; @@ -777,13 +1077,35 @@ input_available (gpointer ignore, gint source, GdkInputCondition cond) if (!len) break; + if (win.value_txt == 1) + { + strcpy (win.picmsg_ps, "xcam "); + + status = + xcam_add_text (win.buf, win.params.pixels_per_line, + win.params.lines, win.picmsg_ps); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_info, "xcam: input available status NOK\n"); + return; + } + } + src = win.buf; src_end = src + len + remaining; + while (1) { - READ_SANE_PIXEL(src, src_end, format, src_depth, r, g, b); - PUT_X11_PIXEL(dst, byte_order, dst_depth, bytes_per_pixel, r, g, b, - win.canvas.graylevel); + if (win.value_rgb == 0) + { + READ_SANE_PIXEL (src, src_end, format, src_depth, r, g, b); + } + else if (win.value_rgb == 1) + { + READ_SANE_PIXEL (src, src_end, format, src_depth, b, g, r); + } + PUT_X11_PIXEL (dst, byte_order, dst_depth, bytes_per_pixel, r, g, b, + win.canvas.graylevel); if (++x >= pixels_per_line) { x = 0; @@ -796,11 +1118,13 @@ input_available (gpointer ignore, gint source, GdkInputCondition cond) win.data = dst; win.x = x; win.remaining = remaining; + DBG (DBG_debug, "xcam: input available: exit\n"); return; stop_and_exit: win.playing = FALSE; stop_camera (); + DBG (DBG_debug, "xcam: input available: stop and exit\n"); return; } @@ -808,25 +1132,34 @@ static void next_frame (void) { char buf[256]; - SANE_Status result; + SANE_Status status; int fd; + double max_value = 60; /* min. 1 frame per min. */ + double frame_time = 50; /* dummy value */ + double fps_old1 = 0; + double fps_old2 = 0; + double fps_old3 = 0; + DBG (DBG_debug, "xcam: next frame enter\n"); + buttons_disable (); + + DBG (DBG_debug, "xcam: next frame, start gsg_sync\n"); gsg_sync (dialog); - result = sane_start (gsg_dialog_get_device (dialog)); - if (result != SANE_STATUS_GOOD) + status = sane_start (gsg_dialog_get_device (dialog)); + if (status != SANE_STATUS_GOOD) { - sprintf (buf, "Failed to start scanner: %s.", sane_strstatus (result)); + sprintf (buf, "Failed to start webcam: %s.", sane_strstatus (status)); gsg_error (buf); win.playing = FALSE; stop_camera (); return; } - result = sane_get_parameters (gsg_dialog_get_device (dialog), &win.params); - if (result != SANE_STATUS_GOOD) + status = sane_get_parameters (gsg_dialog_get_device (dialog), &win.params); + if (status != SANE_STATUS_GOOD) { - sprintf (buf, "Failed to get parameters: %s.", sane_strstatus (result)); + sprintf (buf, "Failed to get parameters: %s.", sane_strstatus (status)); gsg_error (buf); win.playing = FALSE; stop_camera (); @@ -843,47 +1176,281 @@ next_frame (void) gdk_image_destroy (win.canvas.gdk_image); #ifdef __alpha__ /* Some X servers seem to have a problem with shared images that - have a width that is not a multiple of 8. Duh... ;-( */ + have a width that is not a multiple of 8. Duh... ;-( */ if (win.params.pixels_per_line % 8) image_type = GDK_IMAGE_NORMAL; #endif win.canvas.gdk_image = - gdk_image_new (image_type, - gdk_window_get_visual (win.canvas.preview->window), - win.params.pixels_per_line, - win.params.lines); + gdk_image_new (image_type, + gdk_window_get_visual (win.canvas.preview->window), + win.params.pixels_per_line, win.params.lines); gtk_widget_set_usize (win.canvas.preview, win.params.pixels_per_line, win.params.lines); } - win.data = win.canvas.gdk_image->mem; win.x = 0; win.remaining = 0; + win.f_count++; + + time (&win.time2); /* time marker */ + + frame_time = difftime (win.time2, win.time1); + + if (frame_time >= max_value) + { + frame_time = max_value; + } + fps_old3 = fps_old2; + fps_old2 = fps_old1; + fps_old1 = win.fps; + win.fps = 1 / frame_time; + /* avarage last 4 frames times */ + win.fps_av = (fps_old3 + fps_old2 + fps_old1 + win.fps) / 4; + + DBG (DBG_debug, "xcam: fps count=%d, fps=%2.3f, fps_av=%2.3f\n", win.f_count, + win.fps, win.fps_av); + + update_param (dialog, 0); + + time (&win.time1); /* time marker for new sequence */ + + buttons_enable (); if (sane_set_io_mode (gsg_dialog_get_device (dialog), SANE_TRUE) == SANE_STATUS_GOOD && sane_get_select_fd (gsg_dialog_get_device (dialog), &fd) == SANE_STATUS_GOOD) - win.gdk_input_tag = gdk_input_add (fd, GDK_INPUT_READ, input_available, 0); + win.gdk_input_tag = + gdk_input_add (fd, GDK_INPUT_READ, input_available, 0); else input_available (0, -1, 0); + + DBG (DBG_debug, "xcam: next frame: exit\n"); } static void -play_stop_button (GtkWidget *widget, gpointer client_data, gpointer call_data) +play_stop_button (GtkWidget * widget, gpointer client_data, + gpointer call_data) { + DBG (DBG_debug, "xcam: play_stop_button: enter\n"); if (!dialog) return; if (win.playing) - win.playing = FALSE; + { + win.playing = FALSE; + gtk_label_set (GTK_LABEL (win.play_stop_label), " Play "); + DBG (DBG_debug, "xcam: wait for play button to be pushed\n"); + } else if (win.gdk_input_tag < 0) { - win.playing = TRUE; - gtk_label_set (GTK_LABEL (win.play_stop_label), "Stop"); - + win.playing = TRUE; + gtk_label_set (GTK_LABEL (win.play_stop_label), " Stop "); + DBG (DBG_debug, "xcam: wait for stop button to be pushed\n"); next_frame (); } + DBG (DBG_debug, "xcam: play_stop_button: exit\n"); +} + +/* Invoked when the save frame button is pressed */ +static void +save_frame_button (GtkWidget * widget, gpointer client_data, + gpointer call_data) +{ + char buf[256]; + char testfilename[256]; + + DBG (DBG_debug, "xcam: save_frame_button\n"); + if (!dialog) + return; + + if (win.saving) + win.saving = FALSE; + else if (win.gdk_input_tag < 0) + { + win.saving = TRUE; + gtk_label_set (GTK_LABEL (win.save_frame_label), "Saving started"); +/* ------------------------------------------ */ + + /* test for pnm formats */ + strncpy (testfilename, preferences.filename, sizeof (testfilename)); + testfilename[sizeof (testfilename)] = 0; + g_strreverse (testfilename); + if (!((!strncmp (testfilename, "mnp.", 4)) || + (!strncmp (testfilename, "mgp.", 4)) || + (!strncmp (testfilename, "mbp.", 4)) || + (!strncmp (testfilename, "mpp.", 4)) || + (!strncmp (testfilename, "MNP.", 4)) || + (!strncmp (testfilename, "MGP.", 4)) || + (!strncmp (testfilename, "MBP.", 4)) || + (!strncmp (testfilename, "MPP.", 4)))) + { + snprintf (buf, sizeof (buf), + "Failed to scan, wrong file extension, use pnm, pgm, pbm or ppm `%s'", + preferences.filename); + gsg_error (buf); + return; + } + win.out = fopen (preferences.filename, "w"); + if (!win.out) + { + snprintf (buf, sizeof (buf), "Failed to open `%s': %s", + preferences.filename, strerror (errno)); + gsg_error (buf); + return; + } + } + buttons_disable (); + save_frame (); + buttons_enable (); + gsg_sync (dialog); + gtk_label_set (GTK_LABEL (win.save_frame_label), "Save\nFrame"); + DBG (DBG_debug, "xcam: save_frame_button: exit\n"); +} + +/* Invoked when the TXT button is pressed */ +static void +txt_button (GtkWidget * widget, gpointer client_data, gpointer call_data) +{ + DBG (DBG_debug, "xcam: txt_button\n"); + if (!dialog) + return; + + if (win.saving) + { + win.saving = FALSE; + win.value_txt = 0; + gtk_label_set (GTK_LABEL (win.txt_label), " TXT \n OFF "); + } + else if (win.gdk_input_tag < 0) + { + win.saving = TRUE; + gtk_label_set (GTK_LABEL (win.txt_label), " TXT \n ON "); + win.value_txt = 1; + } + gsg_sync (dialog); + DBG (DBG_debug, "xcam: txt_button: exit\n"); +} + +/* Invoked when the RGB-BGR button is pressed */ +static void +rgb_bgr_button (GtkWidget * widget, gpointer client_data, gpointer call_data) +{ + DBG (DBG_debug, "xcam: rgb_bgr_button\n"); + if (!dialog) + return; + + if (win.saving) + { + win.saving = FALSE; + win.value_rgb = 0; + gtk_label_set (GTK_LABEL (win.rgb_bgr_label), "RGB"); + } + else if (win.gdk_input_tag < 0) + { + win.saving = TRUE; + gtk_label_set (GTK_LABEL (win.rgb_bgr_label), "BGR"); + win.value_rgb = 1; + } + gsg_sync (dialog); + DBG (DBG_debug, "xcam: rgb_bgr_button: exit\n"); +} + +static void +save_frame (void) +{ + SANE_Handle dev = gsg_dialog_get_device (dialog); + + const char *frame_type = 0; + char buf[256]; + int fd; + + DBG (DBG_debug, "xcam: save_frame: enter\n"); + + win.x = win.y = 0; + + win.num_bytes = win.params.lines * win.params.bytes_per_line; + win.bytes_read = 0; + win.have_odd_byte = FALSE; + + switch (win.params.format) + { + case SANE_FRAME_RGB: + frame_type = "RGB"; + break; + case SANE_FRAME_RED: + frame_type = "red"; + break; + case SANE_FRAME_GREEN: + frame_type = "green"; + break; + case SANE_FRAME_BLUE: + frame_type = "blue"; + break; + case SANE_FRAME_GRAY: + frame_type = "gray"; + break; + } + + if (!win.header_size) + { + switch (win.params.format) + { + case SANE_FRAME_RED: + case SANE_FRAME_GREEN: + case SANE_FRAME_BLUE: + if (win.params.depth > 8) + { + gsg_set_sensitivity (dialog, TRUE); + snprintf (buf, sizeof (buf), + "Separate channel transfers are not supported " + "with %d bits/channel.", win.params.depth); + gsg_error (buf); + + buttons_enable (); + return; + } + /*FALLTHROUGH*/ case SANE_FRAME_RGB: + fprintf (win.out, "P6\n# SANE data follows\n%d %d\n%d\n", + win.params.pixels_per_line, win.params.lines, + (win.params.depth <= 8) ? 255 : 65535); + break; + + case SANE_FRAME_GRAY: + if (win.params.depth == 1) + fprintf (win.out, "P4\n# SANE data follows\n%d %d\n", + win.params.pixels_per_line, win.params.lines); + else + fprintf (win.out, "P5\n# SANE data follows\n%d %d\n%d\n", + win.params.pixels_per_line, win.params.lines, + (win.params.depth <= 8) ? 255 : 65535); + break; + } + win.header_size = ftell (win.out); + fwrite (win.buf, 1, win.num_bytes, win.out); + fclose (win.out); + win.out = 0; + } + if (win.params.format >= SANE_FRAME_RED + && win.params.format <= SANE_FRAME_BLUE) + fseek (win.out, + win.header_size + win.params.format - SANE_FRAME_RED, SEEK_SET); + snprintf (buf, sizeof (buf), "Receiving %s data for `%s'...", + frame_type, preferences.filename); + + win.input_tag = -1; + if (sane_set_io_mode (dev, SANE_TRUE) == SANE_STATUS_GOOD + && sane_get_select_fd (dev, &fd) == SANE_STATUS_GOOD) + win.input_tag = gdk_input_add (fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, + input_available, 0); + else + { + while (gtk_events_pending ()) + gtk_main_iteration (); + input_available (0, -1, GDK_INPUT_READ); + } + + DBG (DBG_debug, "xcam: save_frame: exit\n"); } static void @@ -891,30 +1458,92 @@ xcam_exit (void) { static int active = 0; + DBG (DBG_debug, "xcam: xcam_exit: enter\n"); if (active) return; active = 1; + pref_xcam_save (); sane_exit (); /* this has the habit of calling exit itself: */ gtk_exit (0); + DBG (DBG_debug, "xcam: xcam_exit: exit\n"); } /* Invoked when window manager's "delete" (or "close") function is invoked. */ static gint -xcam_win_delete (GtkWidget *w, gpointer data) +xcam_win_delete (GtkWidget * w, gpointer data) { - xcam_exit(); + xcam_exit (); return FALSE; } +static void +browse_filename_callback (GtkWidget * widget, gpointer data) +{ + char filename[1024]; + + DBG (DBG_debug, "xcam: browse_filename_callback\n"); + if (preferences.filename) + { + strncpy (filename, preferences.filename, sizeof (filename)); + filename[sizeof (filename) - 1] = '\0'; + } + else + strcpy (filename, OUTFILENAME); + gsg_get_filename ("Output Filename", filename, sizeof (filename), filename); + gtk_entry_set_text (GTK_ENTRY (win.filename_entry), filename); + + if (preferences.filename) + free ((void *) preferences.filename); + preferences.filename = strdup (filename); + DBG (DBG_debug, "xcam: browse_filename_callback: exit\n"); +} + +static void +filename_changed_callback (GtkWidget * widget, gpointer data) +{ + DBG (DBG_debug, "xcam: filename_changed_callback\n"); + if (preferences.filename) + free ((void *) preferences.filename); + preferences.filename = strdup (gtk_entry_get_text (GTK_ENTRY (widget))); + pref_xcam_save (); + DBG (DBG_debug, "xcam: filename_changed_callbackcallback: exit\n"); +} + +static void +usage (void) +{ + printf ("Usage: %s [OPTION]... [DEVICE]\n\ +\n\ +Start up graphical user interface to access SANE (Scanner Access Now\n\ +Easy) devices.\n\ +\n\ +-h, --help display this help message and exit\n\ +-B, --buffersize set buffersize 1024 * 1024\n\ +-V, --version print version information\n", prog_name); +} + int main (int argc, char **argv) { GtkWidget *menu, *menu_bar, *menu_bar_item, *preview_vbox; - GtkWidget *hbox, *vbox, *button, *alignment, *frame, *scrolled_window; + GtkWidget *hbox, *vbox, *button, *alignment, *frame, *label, *text, + *scrolled_window; int i; + int ch; + SANE_Status status; + + DBG_INIT (); + + DBG (DBG_debug, "xcam: main\n"); + DBG (DBG_error, "xcam (version: %s, package: %s) starting\n", VERSION, + PACKAGE); + + win.buf_backend_size = (32 * 1024); + + pref_xcam_restore (); prog_name = strrchr (argv[0], '/'); if (prog_name) @@ -925,7 +1554,39 @@ main (int argc, char **argv) /* turn on by default as we don't support graphical geometry selection */ preferences.advanced = 1; - sane_init (NULL, 0); + status = sane_init (0, 0); + if (status != SANE_STATUS_GOOD) + { + DBG (DBG_fatal, "init: sane_main failed: %s\n", + sane_strstatus (status)); + exit (1); + } + + if (argc > 1) + { + + while ((ch = getopt_long (argc, argv, "hBV", long_options, 0)) != EOF) + { + switch (ch) + { + case 'V': + printf ("xcam (%s) %s\n", PACKAGE, VERSION); + exit (0); + + case 'B': + win.buf_backend_size = 1024 * 1024; + break; + case 'h': + default: + usage (); + exit (0); + } + } + } + + DBG (DBG_debug, "xcam.main: buf_backend_size 0x%x\n", win.buf_backend_size); + + win.buf = malloc (win.buf_backend_size); gdk_set_show_events (0); gtk_init (&argc, &argv); @@ -939,7 +1600,7 @@ main (int argc, char **argv) GTK_SIGNAL_FUNC (xcam_win_delete), NULL); vbox = gtk_vbox_new (FALSE, 0); - gtk_container_border_width (GTK_CONTAINER (vbox), 0); + gtk_container_border_width (GTK_CONTAINER (vbox), 0); gtk_container_add (GTK_CONTAINER (win.shell), vbox); gtk_widget_show (vbox); @@ -990,11 +1651,12 @@ main (int argc, char **argv) win.dialog_box = gtk_vbox_new (FALSE, 0); gtk_widget_show (win.dialog_box); + DBG (DBG_debug, "xcam main, preview vbox on the left hand side \n"); /* the preview vbox on the left hand side: */ preview_vbox = gtk_vbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox), preview_vbox, TRUE, TRUE, 0); - frame = gtk_frame_new ("Preview"); + frame = gtk_frame_new ("Image view"); gtk_container_border_width (GTK_CONTAINER (frame), 8); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN); gtk_container_add (GTK_CONTAINER (preview_vbox), frame); @@ -1003,8 +1665,7 @@ main (int argc, char **argv) gtk_box_pack_start (GTK_BOX (preview_vbox), alignment, TRUE, TRUE, 0); win.canvas.preview = gtk_drawing_area_new (); - gtk_drawing_area_size (GTK_DRAWING_AREA (win.canvas.preview), - 320, 200); + gtk_drawing_area_size (GTK_DRAWING_AREA (win.canvas.preview), 320, 200); gtk_widget_set_events (win.canvas.preview, CANVAS_EVENT_MASK); gtk_signal_connect (GTK_OBJECT (win.canvas.preview), "event", (GtkSignalFunc) canvas_events, 0); @@ -1016,40 +1677,42 @@ main (int argc, char **argv) gtk_widget_show (preview_vbox); win.canvas.graylevel_cmap = gdk_colormap_get_system (); - for (i = 0; i < NELEMS(win.canvas.graylevel); ++i) + for (i = 0; i < NELEMS (win.canvas.graylevel); ++i) { GdkColor color; color.red = color.green = color.blue = - i * 0xffff / (NELEMS(win.canvas.graylevel) - 1); + i * 0xffff / (NELEMS (win.canvas.graylevel) - 1); gdk_color_alloc (win.canvas.graylevel_cmap, &color); win.canvas.graylevel[i] = color.pixel; } #if 0 { - win.canvas.cube_cmap - = gdk_colormap_new (win.canvas.preview->window->visual, 1); - for (i = 0; i < NELEMS(win.canvas.cube_colors); ++i) - { - win.canvas.cube_colors[i].pixel = i; - win.canvas.cube_colors[i].red = ((i / 30) % 5) * 0xffff / 4; - win.canvas.cube_colors[i].green = ((i / 5) % 6) * 0xffff / 5; - win.canvas.cube_colors[i].blue = ((i % 5)) * 0xffff / 4; - } - gdk_colors_store (win.canvas.cube_cmap, win.canvas.cube_colors, - NELEMS(win.canvas.cube_colors)); - gdk_window_set_colormap (win.shell->window, win.canvas.cube_cmap); + win.canvas.cube_cmap + = gdk_colormap_new (win.canvas.preview->window->visual, 1); + for (i = 0; i < NELEMS (win.canvas.cube_colors); ++i) + { + win.canvas.cube_colors[i].pixel = i; + win.canvas.cube_colors[i].red = ((i / 30) % 5) * 0xffff / 4; + win.canvas.cube_colors[i].green = ((i / 5) % 6) * 0xffff / 5; + win.canvas.cube_colors[i].blue = ((i % 5)) * 0xffff / 4; + } + gdk_colors_store (win.canvas.cube_cmap, win.canvas.cube_colors, + NELEMS (win.canvas.cube_colors)); + gdk_window_set_colormap (win.shell->window, win.canvas.cube_cmap); } #endif + DBG (DBG_debug, "xcam main, use a scrolled window \n"); + /* use a scrolled window to show the device options, as in xscanimage */ scrolled_window = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); gtk_scrolled_window_set_placement (GTK_SCROLLED_WINDOW (scrolled_window), GTK_CORNER_TOP_RIGHT); - gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled_window), - win.dialog_box); + gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW + (scrolled_window), win.dialog_box); gtk_container_add (GTK_CONTAINER (hbox), scrolled_window); gtk_widget_show (GTK_WIDGET (scrolled_window)); @@ -1059,23 +1722,133 @@ main (int argc, char **argv) switch_device (device[0]); load_defaults (1); } + else + { + DBG (DBG_fatal, + " No vidcams were identified. If you were expecting something\n" + " different, check that the vidcam is plugged in, turned on and\n" + " detected by sane-find-scanner (if appropriate). Please read\n" + " the documentation which came with this software (README, FAQ,\n" + " manpages).\n"); + atexit (xcam_exit); + } if (dialog && gsg_dialog_get_device (dialog) && (sane_get_parameters (gsg_dialog_get_device (dialog), &win.params) == SANE_STATUS_GOOD)) - gtk_widget_set_usize (win.canvas.preview, - win.params.pixels_per_line, win.params.lines); + { + gtk_widget_set_usize (win.canvas.preview, + win.params.pixels_per_line, win.params.lines); + } - /* buttons at the bottom: */ - button = gtk_button_new_with_label ("Play"); + /* The bottom row */ + + DBG (DBG_debug, "xcam main, button row: info\n"); + + /* The info row */ + hbox = gtk_hbox_new (FALSE, 5); + gtk_container_border_width (GTK_CONTAINER (hbox), 3); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); + gtk_widget_show (hbox); + + frame = gtk_frame_new (NULL); + gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); + gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0); + gtk_widget_show (frame); + + hbox = gtk_hbox_new (FALSE, 5); + gtk_container_border_width (GTK_CONTAINER (hbox), 2); + gtk_container_add (GTK_CONTAINER (frame), hbox); + gtk_widget_show (hbox); + + win.info_label = gtk_label_new ("0 x 0 0 kByte \n0 f_count \n0 fps 0 fps_av"); + gtk_box_pack_start (GTK_BOX (hbox), win.info_label, FALSE, FALSE, 0); + gtk_widget_show (win.info_label); + + win.f_count = 0; + win.fps = 0; + win.fps_av = 0; + time (&win.time1); /* first time marker */ + update_param (dialog, 0); + + DBG (DBG_debug, "xcam main, bottom row: rgb-bgr button\n"); + + /* The TXT button */ + button = gtk_button_new_with_label (" TXT "); + win.txt_label = GTK_BIN (button)->child; + gtk_signal_connect (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) txt_button, dialog); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_widget_show (button); + DBG (DBG_debug, "xcam main, bottom row: txt button\n"); + + /* The RGB-BGR button */ + button = gtk_button_new_with_label ("RGB"); + win.rgb_bgr_label = GTK_BIN (button)->child; + gtk_signal_connect (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) rgb_bgr_button, dialog); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_widget_show (button); + + DBG (DBG_debug, "xcam main, bottom row: play button\n"); + + /* The Play button */ + button = gtk_button_new_with_label (" Play "); win.play_stop_label = GTK_BIN (button)->child; gtk_signal_connect (GTK_OBJECT (button), "clicked", (GtkSignalFunc) play_stop_button, dialog); - gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); gtk_widget_show (button); + DBG (DBG_debug, "xcam main, bottom row: save frame button\n"); + + /* The Save Frame button */ + button = gtk_button_new_with_label ("Save\nFrame"); + win.save_frame_label = GTK_BIN (button)->child; + gtk_signal_connect (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) save_frame_button, dialog); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_widget_show (button); + + DBG (DBG_debug, "xcam main, bottom row: output filename part\n"); + + /* output filename part */ + frame = gtk_frame_new ("Output"); + gtk_container_border_width (GTK_CONTAINER (frame), 4); + gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN); + gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0); + + hbox = gtk_hbox_new (FALSE, 2); + gtk_container_border_width (GTK_CONTAINER (hbox), 2); + gtk_container_add (GTK_CONTAINER (frame), hbox); + + label = gtk_label_new ("Filename"); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2); + + text = gtk_entry_new (); + gtk_entry_set_text (GTK_ENTRY (text), (char *) preferences.filename); + gtk_box_pack_start (GTK_BOX (hbox), text, TRUE, TRUE, 2); + gtk_signal_connect (GTK_OBJECT (text), "changed", + (GtkSignalFunc) filename_changed_callback, 0); + + win.filename_entry = text; + + button = gtk_button_new_with_label ("Browse"); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 2); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) browse_filename_callback, 0); + + gtk_widget_show (button); + gtk_widget_show (label); + gtk_widget_show (text); + gtk_widget_show (hbox); + gtk_widget_show (frame); + gtk_widget_show (win.shell); gtk_main (); + pref_xcam_save (); + + DBG (DBG_debug, "xcam main exit\n"); return 0; } diff --git a/src/xscanimage.c b/src/xscanimage.c index 1825313..a36324f 100644 --- a/src/xscanimage.c +++ b/src/xscanimage.c @@ -45,7 +45,6 @@ #include #include "../include/sane/sanei.h" -#define DEBUG_DECLARE_ONLY #define BACKEND_NAME xscanimage #include "../include/sane/sanei_debug.h" @@ -67,7 +66,7 @@ # include # elif defined(ENABLE_GIMP_1_2) # define GIMP_CHECK_VERSION(major, minor, micro) 0 -# endif /* HAVE_LIBGIMP_GIMPFEATURES_H */ +# endif /* HAVE_LIBGIMP_GIMPFEATURES_H */ #ifndef ENABLE_GIMP_1_2 # define GIMP_HAVE_RESOLUTION_INFO @@ -78,26 +77,25 @@ /* ok, we have the new gimp interface */ # else /* we have the old gimp interface and need the compatibility header file */ -# include "xscanimage-gimp-1_0-compat.h" +# include "xscanimage-gimp-1_0-compat.h" # endif # else # ifdef ENABLE_GIMP_1_2 /* we have the old gimp interface and need the compatibility header file */ -# include "xscanimage-gimp-1_0-compat.h" +# include "xscanimage-gimp-1_0-compat.h" # endif /* ENABLE_GIMP_1_2 */ # endif static void query (void); #ifndef ENABLE_GIMP_1_2 -static void run (const gchar *name, gint nparams, const GimpParam * param, - gint *nreturn_vals, GimpParam ** return_vals); +static void run (const gchar * name, gint nparams, const GimpParam * param, + gint * nreturn_vals, GimpParam ** return_vals); #else static void run (char *name, int nparams, GimpParam * param, int *nreturn_vals, GimpParam ** return_vals); #endif /* !ENABLE_GIMP_1_2 */ -GimpPlugInInfo PLUG_IN_INFO = -{ +GimpPlugInInfo PLUG_IN_INFO = { NULL, /* init_proc */ NULL, /* quit_proc */ query, /* query_proc */ @@ -113,44 +111,44 @@ GimpPlugInInfo PLUG_IN_INFO = #define DBG_debug 4 enum - { - STANDALONE, SANE_GIMP_EXTENSION - }; +{ + STANDALONE, SANE_GIMP_EXTENSION +}; static struct - { - GtkWidget *shell; - GtkWidget *menubar; - GtkWidget *hruler; - GtkWidget *vruler; - GtkWidget *info_label; - GtkWidget *preview_button; - GtkWidget *scan_button; - Preview *preview; - gint32 mode; - /* various scanning related state: */ - size_t num_bytes; - size_t bytes_read; - Progress_t *progress; - int input_tag; - SANE_Parameters param; - int x, y; - /* for standalone mode: */ - GtkWidget *filename_entry; - FILE *out; - long header_size; - gboolean have_odd_byte; - guint8 odd_byte; +{ + GtkWidget *shell; + GtkWidget *menubar; + GtkWidget *hruler; + GtkWidget *vruler; + GtkWidget *info_label; + GtkWidget *preview_button; + GtkWidget *scan_button; + Preview *preview; + gint32 mode; + /* various scanning related state: */ + size_t num_bytes; + size_t bytes_read; + Progress_t *progress; + int input_tag; + SANE_Parameters param; + int x, y; + /* for standalone mode: */ + GtkWidget *filename_entry; + FILE *out; + long header_size; + gboolean have_odd_byte; + guint8 odd_byte; #ifdef HAVE_LIBGIMP_GIMP_H - /* for GIMP mode: */ - gint32 image_ID; - GimpDrawable *drawable; - guchar *tile; - unsigned tile_offset; - GimpPixelRgn region; - int first_frame; /* used for RED/GREEN/BLUE frames */ + /* for GIMP mode: */ + gint32 image_ID; + GimpDrawable *drawable; + guchar *tile; + unsigned tile_offset; + GimpPixelRgn region; + int first_frame; /* used for RED/GREEN/BLUE frames */ #endif - } +} scan_win; static const char *prog_name; @@ -160,21 +158,20 @@ static const SANE_Device **devlist; static gint seldev = -1; /* The selected device */ static gint defdev = -1; /* The default device */ static gint ndevs; /* The number of available devices */ -static gboolean little_endian; /* Is this computer little-endian ?*/ -static struct option long_options[] = - { - {"help", no_argument, NULL, 'h'}, - {"version", no_argument, NULL, 'V'}, - {0, 0, 0, 0 } - }; +static gboolean little_endian; /* Is this computer little-endian ? */ +static struct option long_options[] = { + {"help", no_argument, NULL, 'h'}, + {"version", no_argument, NULL, 'V'}, + {0, 0, 0, 0} +}; -static int gtk_quit_flag; /* Call gtk_main_quit() only if at least one device - device is found. */ +static int gtk_quit_flag; /* Call gtk_main_quit() only if at least one device + device is found. */ /* forward declarations: */ -int main (int argc, char ** argv); +int main (int argc, char **argv); static void interface (int argc, char **argv); static void scan_start (void); static void scan_done (void); @@ -201,7 +198,9 @@ encode_devname (const char *devname, int n, char *buf) const char *src; char ch; - DBG(DBG_debug, "encode_devname\n"); + DBG_INIT (); + + DBG (DBG_debug, "encode_devname\n"); limit = buf + n; for (src = devname, dst = buf; *src; ++src) { @@ -210,10 +209,9 @@ encode_devname (const char *devname, int n, char *buf) ch = *src; /* don't use the ctype.h macros here since we don't want to - allow anything non-ASCII here... */ + allow anything non-ASCII here... */ if ((ch >= '0' && ch <= '9') - || (ch >= 'a' && ch <= 'z') - || (ch >= 'A' && ch <= 'Z')) + || (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) *dst++ = ch; else { @@ -236,7 +234,7 @@ encode_devname (const char *devname, int n, char *buf) if (dst >= limit) return -1; *dst = '\0'; - DBG(DBG_debug, "encode_devname: %s --> %s\n", devname, buf); + DBG (DBG_debug, "encode_devname: %s --> %s\n", devname, buf); return 0; } @@ -248,7 +246,9 @@ decode_devname (const char *encoded_devname, int n, char *buf) const char *src; char ch, val; - DBG(DBG_debug, "decode_devname\n"); + DBG_INIT (); + + DBG (DBG_debug, "decode_devname\n"); limit = buf + n; for (src = encoded_devname, dst = buf; *src; ++dst) { @@ -257,7 +257,7 @@ decode_devname (const char *encoded_devname, int n, char *buf) ch = *src++; /* don't use the ctype.h macros here since we don't want to - allow anything non-ASCII here... */ + allow anything non-ASCII here... */ if (ch != '-') *dst = ch; else @@ -283,24 +283,23 @@ decode_devname (const char *encoded_devname, int n, char *buf) *dst = val; - ++src; /* simply skip terminating '-' for now... */ + ++src; /* simply skip terminating '-' for now... */ } } } if (dst >= limit) return -1; *dst = '\0'; - DBG(DBG_debug, "deccode_devname: %s -> %s\n", encoded_devname, buf); + DBG (DBG_debug, "deccode_devname: %s -> %s\n", encoded_devname, buf); return 0; } static void query (void) { - static GimpParamDef args[] = - { - {GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive"}, - }; + static GimpParamDef args[] = { + {GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive"}, + }; static GimpParamDef *return_vals = NULL; static int nargs = sizeof (args) / sizeof (args[0]); static int nreturn_vals = 0; @@ -310,40 +309,43 @@ query (void) int i, j; SANE_Status status; - DBG(DBG_debug, "query\n"); - gimp_install_procedure ( - "xscanimage", - "Front-end to the SANE interface", - "This function provides access to scanners and other image acquisition " - "devices through the SANE (Scanner Access Now Easy) interface.", - "Andy Beck, Tristan Tarrant, and David Mosberger", - "Andy Beck, Tristan Tarrant, and David Mosberger", - "8th June 1997", - "/File/Acquire/xscanimage/Device dialog...", - "RGB, GRAY", - GIMP_EXTENSION, - nargs, nreturn_vals, - args, return_vals); + DBG_INIT (); + + DBG (DBG_debug, "query\n"); + gimp_install_procedure ("xscanimage", + "Front-end to the SANE interface", + "This function provides access to scanners and other image acquisition " + "devices through the SANE (Scanner Access Now Easy) interface.", + "Andy Beck, Tristan Tarrant, and David Mosberger", + "Andy Beck, Tristan Tarrant, and David Mosberger", + "8th June 1997", + "/File/Acquire/xscanimage/Device dialog...", + "RGB, GRAY", + GIMP_EXTENSION, + nargs, nreturn_vals, args, return_vals); status = sane_init (0, 0); if (status != SANE_STATUS_GOOD) { - DBG (DBG_fatal, "query: sane_init failed: %s\n", sane_strstatus (status)); + DBG (DBG_fatal, "query: sane_init failed: %s\n", + sane_strstatus (status)); exit (1); } status = sane_get_devices (&devlist, SANE_FALSE); if (status != SANE_STATUS_GOOD) { - DBG (DBG_fatal, "query: sane_get_devices failed: %s\n", sane_strstatus (status)); + DBG (DBG_fatal, "query: sane_get_devices failed: %s\n", + sane_strstatus (status)); exit (1); } for (i = 0; devlist[i]; ++i) { strcpy (name, "xscanimage-"); - if (encode_devname (devlist[i]->name, sizeof (name) - 11, name + 11) < 0) - continue; /* name too long... */ + if (encode_devname (devlist[i]->name, sizeof (name) - 11, name + 11) < + 0) + continue; /* name too long... */ strncpy (mpath, "/File/Acquire/xscanimage/", sizeof (mpath)); len = strlen (mpath); @@ -367,18 +369,18 @@ query (void) nargs, nreturn_vals, args, return_vals); } sane_exit (); - DBG(DBG_debug, "query: finished\n"); + DBG (DBG_debug, "query: finished\n"); } #ifndef ENABLE_GIMP_1_2 static void -run (const gchar *name, gint nparams, const GimpParam * param, - gint *nreturn_vals, GimpParam ** return_vals) +run (const gchar * name, gint nparams, const GimpParam * param, + gint * nreturn_vals, GimpParam ** return_vals) #else static void run (char *name, int nparams, GimpParam * param, int *nreturn_vals, GimpParam ** return_vals) -#endif /* !ENABLE_GIMP_1_2 */ +#endif /* !ENABLE_GIMP_1_2 */ { static GimpParam values[2]; #ifndef ENABLE_GIMP_1_2 @@ -390,7 +392,7 @@ run (char *name, int nparams, GimpParam * param, char *args[2]; int nargs; - DBG(DBG_debug, "run\n"); + DBG (DBG_debug, "run\n"); run_mode = param[0].data.d_int32; scan_win.mode = SANE_GIMP_EXTENSION; @@ -415,7 +417,7 @@ run (char *name, int nparams, GimpParam * param, { case GIMP_RUN_INTERACTIVE: #ifndef ENABLE_GIMP_1_2 - gimp_extension_ack(); + gimp_extension_ack (); #endif /* !ENABLE_GIMP_1_2 */ interface (nargs, args); values[0].data.d_status = GIMP_PDB_SUCCESS; @@ -432,57 +434,58 @@ run (char *name, int nparams, GimpParam * param, default: break; } - DBG(DBG_debug, "run: finished\n"); + DBG (DBG_debug, "run: finished\n"); } static void -null_print_func (const gchar *msg) +null_print_func (const gchar * msg) { } #endif /* HAVE_LIBGIMP_GIMP_H */ -static -SANE_Word get_resolution (SANE_Handle dev) +static SANE_Word +get_resolution (SANE_Handle dev) { SANE_Status status; SANE_Word resolution; SANE_Int num_options, i; const SANE_Option_Descriptor *option_desc; - DBG(DBG_debug, "get_resolution\n"); - status = sane_control_option (dev, 0, SANE_ACTION_GET_VALUE, &num_options, 0); + DBG (DBG_debug, "get_resolution\n"); + status = + sane_control_option (dev, 0, SANE_ACTION_GET_VALUE, &num_options, 0); if (status != SANE_STATUS_GOOD) return 0; - + for (i = 1; i < num_options; i++) { option_desc = sane_get_option_descriptor (dev, i); if (option_desc) - if (option_desc->name) + if (option_desc->name) { - if (strncmp (option_desc->name, SANE_NAME_SCAN_RESOLUTION, - sizeof(SANE_NAME_SCAN_RESOLUTION)) == 0) + if (strncmp (option_desc->name, SANE_NAME_SCAN_RESOLUTION, + sizeof (SANE_NAME_SCAN_RESOLUTION)) == 0) { status = sane_control_option (dev, i, SANE_ACTION_GET_VALUE, &resolution, 0); - if (status == SANE_STATUS_GOOD) + if (status == SANE_STATUS_GOOD) { if (option_desc->type == SANE_TYPE_INT) return resolution; else if (option_desc->type == SANE_TYPE_FIXED) return (SANE_Word) SANE_UNFIX (resolution); } - return 0; + return 0; } } - } - DBG(DBG_debug, "get_resolution: finished\n"); - return 0; + } + DBG (DBG_debug, "get_resolution: finished\n"); + return 0; } static void -update_preview (GSGDialog *dialog, void *arg) +update_preview (GSGDialog * dialog, void *arg) { if (scan_win.preview) preview_update (scan_win.preview); @@ -490,12 +493,12 @@ update_preview (GSGDialog *dialog, void *arg) /* Update the info line with the latest size information. */ static void -update_param (GSGDialog *dialog, void *arg) +update_param (GSGDialog * dialog, void *arg) { SANE_Parameters params; gchar buf[200]; - DBG(DBG_debug, "update_param\n"); + DBG (DBG_debug, "update_param\n"); if (!scan_win.info_label) return; @@ -507,14 +510,15 @@ update_param (GSGDialog *dialog, void *arg) if (params.lines == -1) { - snprintf (buf, sizeof (buf), "%dxunknown: unknown size", + snprintf (buf, sizeof (buf), "%dxunknown: unknown size", params.pixels_per_line); } else { - if (params.format >= SANE_FRAME_RED && params.format <= SANE_FRAME_BLUE) + if (params.format >= SANE_FRAME_RED + && params.format <= SANE_FRAME_BLUE) size *= 3; - + if (size >= 1024 * 1024) { size /= 1024 * 1024; @@ -525,17 +529,17 @@ update_param (GSGDialog *dialog, void *arg) size /= 1024; unit = "KB"; } - snprintf (buf, sizeof(buf), "%dx%d: %1.1f %s", params.pixels_per_line, - params.lines, size, unit); + snprintf (buf, sizeof (buf), "%dx%d: %1.1f %s", + params.pixels_per_line, params.lines, size, unit); } } else - snprintf (buf, sizeof(buf), "Invalid parameters."); + snprintf (buf, sizeof (buf), "Invalid parameters."); gtk_label_set (GTK_LABEL (scan_win.info_label), buf); if (scan_win.preview) preview_update (scan_win.preview); - DBG(DBG_debug, "update_param: finished\n"); + DBG (DBG_debug, "update_param: finished\n"); } static void @@ -544,7 +548,7 @@ pref_xscanimage_save (void) char filename[PATH_MAX]; int fd; - DBG(DBG_debug, "pref_xscanimage_save\n"); + DBG (DBG_debug, "pref_xscanimage_save\n"); /* first save xscanimage-specific preferences: */ gsg_make_path (sizeof (filename), filename, "xscanimage", "xscanimage", 0, ".rc"); @@ -560,7 +564,7 @@ pref_xscanimage_save (void) } preferences_save (fd); close (fd); - DBG(DBG_debug, "pref_xscanimage_save: finished\n"); + DBG (DBG_debug, "pref_xscanimage_save: finished\n"); } static void @@ -569,7 +573,7 @@ pref_xscanimage_restore (void) char filename[PATH_MAX]; int fd; - DBG(DBG_debug, "pref_xscanimage_restore\n"); + DBG (DBG_debug, "pref_xscanimage_restore\n"); gsg_make_path (sizeof (filename), filename, "xscanimage", "xscanimage", 0, ".rc"); fd = open (filename, O_RDONLY); @@ -580,7 +584,7 @@ pref_xscanimage_restore (void) } if (!preferences.filename) preferences.filename = strdup (OUTFILENAME); - DBG(DBG_debug, "pref_xscanimage_restore: finished\n"); + DBG (DBG_debug, "pref_xscanimage_restore: finished\n"); } static void @@ -616,14 +620,14 @@ quit_xscanimage (void) /* Invoked when window manager's "delete" (or "close") function is invoked. */ static gint -scan_win_delete (GtkWidget *w, gpointer data) +scan_win_delete (GtkWidget * w, gpointer data) { - quit_xscanimage(); + quit_xscanimage (); return FALSE; } static void -preview_window_destroyed (GtkWidget *widget, gpointer call_data) +preview_window_destroyed (GtkWidget * widget, gpointer call_data) { gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (call_data), FALSE); } @@ -633,7 +637,7 @@ preview_window_destroyed (GtkWidget *widget, gpointer call_data) static void scan_preview (GtkWidget * widget, gpointer call_data) { - DBG(DBG_debug, "scan_preview\n"); + DBG (DBG_debug, "scan_preview\n"); if (GTK_TOGGLE_BUTTON (widget)->active) { @@ -647,8 +651,8 @@ scan_preview (GtkWidget * widget, gpointer call_data) widget); else gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (widget), FALSE); - if (scan_win.progress) - gtk_widget_set_sensitive (scan_win.preview->preview, FALSE); + if (scan_win.progress) + gtk_widget_set_sensitive (scan_win.preview->preview, FALSE); } } else if (scan_win.preview) @@ -656,14 +660,14 @@ scan_preview (GtkWidget * widget, gpointer call_data) preview_destroy (scan_win.preview); scan_win.preview = 0; } - DBG(DBG_debug, "scan_preview: finished\n"); + DBG (DBG_debug, "scan_preview: finished\n"); } #ifdef HAVE_LIBGIMP_GIMP_H static void advance (void) { - DBG(DBG_debug, "advance\n"); + DBG (DBG_debug, "advance\n"); if (++scan_win.x >= scan_win.param.pixels_per_line) { @@ -675,7 +679,8 @@ advance (void) { gimp_pixel_rgn_set_rect (&scan_win.region, scan_win.tile, 0, scan_win.y - tile_height, - scan_win.param.pixels_per_line, tile_height); + scan_win.param.pixels_per_line, + tile_height); if (scan_win.param.format >= SANE_FRAME_RED && scan_win.param.format <= SANE_FRAME_BLUE) { @@ -698,26 +703,26 @@ advance (void) scan_win.tile_offset = 0; } } - DBG(DBG_debug, "advance: finished\n"); + DBG (DBG_debug, "advance: finished\n"); } #endif /* HAVE_LIBGIMP_GIMP_H */ static void -write_swapped_words(FILE *f, char *buf, guint len) +write_swapped_words (FILE * f, char *buf, guint len) { char tmp_buf[2]; char tmp; unsigned int i; - DBG(DBG_debug, "write_swapped_words\n"); + DBG (DBG_debug, "write_swapped_words\n"); if (!len) return; if (scan_win.have_odd_byte) { tmp_buf[0] = *buf++; tmp_buf[1] = scan_win.odd_byte; - fwrite(tmp_buf, 1, 2, f); + fwrite (tmp_buf, 1, 2, f); --len; scan_win.have_odd_byte = FALSE; } @@ -729,14 +734,14 @@ write_swapped_words(FILE *f, char *buf, guint len) buf[i] = buf[i - 1]; buf[i - 1] = tmp; } - fwrite(buf, 1, len & ~1, f); + fwrite (buf, 1, len & ~1, f); if (len & 1) { scan_win.have_odd_byte = TRUE; scan_win.odd_byte = buf[len - 1]; } } - DBG(DBG_debug, "write_swapped_words: finished\n"); + DBG (DBG_debug, "write_swapped_words: finished\n"); } static void @@ -748,7 +753,7 @@ input_available (gpointer data, gint source, GdkInputCondition cond) SANE_Int len; int i; - DBG(DBG_debug, "input_available\n"); + DBG (DBG_debug, "input_available\n"); while (1) { status = sane_read (dev, (unsigned char *) buf, sizeof (buf), &len); @@ -781,7 +786,7 @@ input_available (gpointer data, gint source, GdkInputCondition cond) scan_done (); return; } - if (!len) /* out of data for now */ + if (!len) /* out of data for now */ { if (scan_win.input_tag < 0) { @@ -806,7 +811,7 @@ input_available (gpointer data, gint source, GdkInputCondition cond) if (scan_win.mode == STANDALONE) { if (scan_win.param.depth > 8 && little_endian) - write_swapped_words(scan_win.out, buf, len); + write_swapped_words (scan_win.out, buf, len); else fwrite (buf, 1, len, scan_win.out); } @@ -852,7 +857,7 @@ input_available (gpointer data, gint source, GdkInputCondition cond) if (scan_win.mode == STANDALONE) { if (scan_win.param.depth > 8 && little_endian) - write_swapped_words(scan_win.out, buf, len); + write_swapped_words (scan_win.out, buf, len); else fwrite (buf, 1, len, scan_win.out); } @@ -952,7 +957,7 @@ input_available (gpointer data, gint source, GdkInputCondition cond) return; } } - DBG(DBG_debug, "input_available: finished\n"); + DBG (DBG_debug, "input_available: finished\n"); return; #ifdef HAVE_LIBGIMP_GIMP_H @@ -968,7 +973,7 @@ bad_depth: static void scan_done (void) { - DBG(DBG_debug, "scan_done\n"); + DBG (DBG_debug, "scan_done\n"); gsg_set_sensitivity (dialog, TRUE); if (scan_win.preview) gtk_widget_set_sensitive (scan_win.preview->preview, TRUE); @@ -1016,15 +1021,15 @@ scan_done (void) scan_win.tile = 0; } #endif /* HAVE_LIBGIMP_GIMP_H */ - DBG(DBG_debug, "scan_done: finished\n"); + DBG (DBG_debug, "scan_done: finished\n"); } static void progress_cancel (void) { - DBG(DBG_debug, "progress_cancel\n"); + DBG (DBG_debug, "progress_cancel\n"); sane_cancel (gsg_dialog_get_device (dialog)); - DBG(DBG_debug, "progress_cancel: done\n"); + DBG (DBG_debug, "progress_cancel: done\n"); } static void @@ -1033,15 +1038,15 @@ scan_start (void) SANE_Status status; SANE_Handle dev = gsg_dialog_get_device (dialog); -#ifdef HAVE_LIBGIMP_GIMP_H +#ifdef HAVE_LIBGIMP_GIMP_H SANE_Word resolution; #endif /* HAVE_LIBGIMP_GIMP_H */ - + const char *frame_type = 0; char buf[256]; int fd; - DBG(DBG_debug, "scan_start\n"); + DBG (DBG_debug, "scan_start\n"); gsg_set_sensitivity (dialog, FALSE); if (scan_win.preview) @@ -1075,8 +1080,8 @@ scan_start (void) } #endif /* HAVE_LIBGIMP_GIMP_H */ -#ifdef GIMP_HAVE_RESOLUTION_INFO - resolution = get_resolution(dev); +#ifdef GIMP_HAVE_RESOLUTION_INFO + resolution = get_resolution (dev); #endif scan_win.x = scan_win.y = 0; @@ -1119,11 +1124,21 @@ scan_start (void) switch (scan_win.param.format) { - case SANE_FRAME_RGB: frame_type = "RGB"; break; - case SANE_FRAME_RED: frame_type = "red"; break; - case SANE_FRAME_GREEN: frame_type = "green"; break; - case SANE_FRAME_BLUE: frame_type = "blue"; break; - case SANE_FRAME_GRAY: frame_type = "gray"; break; + case SANE_FRAME_RGB: + frame_type = "RGB"; + break; + case SANE_FRAME_RED: + frame_type = "red"; + break; + case SANE_FRAME_GREEN: + frame_type = "green"; + break; + case SANE_FRAME_BLUE: + frame_type = "blue"; + break; + case SANE_FRAME_GRAY: + frame_type = "gray"; + break; } if (scan_win.mode == STANDALONE) @@ -1145,8 +1160,7 @@ scan_start (void) scan_done (); return; } - /*FALLTHROUGH*/ - case SANE_FRAME_RGB: + /*FALLTHROUGH*/ case SANE_FRAME_RGB: fprintf (scan_win.out, "P6\n# SANE data follows\n%d %d\n%d\n", scan_win.param.pixels_per_line, scan_win.param.lines, (scan_win.param.depth <= 8) ? 255 : 65535); @@ -1155,7 +1169,8 @@ scan_start (void) case SANE_FRAME_GRAY: if (scan_win.param.depth == 1) fprintf (scan_win.out, "P4\n# SANE data follows\n%d %d\n", - scan_win.param.pixels_per_line, scan_win.param.lines); + scan_win.param.pixels_per_line, + scan_win.param.lines); else fprintf (scan_win.out, "P5\n# SANE data follows\n%d %d\n%d\n", scan_win.param.pixels_per_line, scan_win.param.lines, @@ -1180,18 +1195,18 @@ scan_start (void) /* We are running under the GIMP */ /* Check whether the selected bit depth is supported by the Gimp */ if (scan_win.param.depth > 8) - { - gsg_set_sensitivity (dialog, TRUE); - snprintf (buf, sizeof (buf), "The Gimp doesn't support images " - "with %d bits/channel.", scan_win.param.depth); - gsg_error (buf); - return; - } + { + gsg_set_sensitivity (dialog, TRUE); + snprintf (buf, sizeof (buf), "The Gimp doesn't support images " + "with %d bits/channel.", scan_win.param.depth); + gsg_error (buf); + return; + } scan_win.tile_offset = 0; tile_size = scan_win.param.pixels_per_line * gimp_tile_height (); if (scan_win.param.format != SANE_FRAME_GRAY) - tile_size *= 3; /* 24 bits/pixel */ + tile_size *= 3; /* 24 bits/pixel */ if (scan_win.tile) scan_win.first_frame = 0; else @@ -1207,14 +1222,15 @@ scan_start (void) } scan_win.image_ID = gimp_image_new (scan_win.param.pixels_per_line, - scan_win.param.lines, image_type); + scan_win.param.lines, + image_type); /* the following is supported since gimp-1.1.0 */ -#ifdef GIMP_HAVE_RESOLUTION_INFO +#ifdef GIMP_HAVE_RESOLUTION_INFO if (resolution > 0) - gimp_image_set_resolution(scan_win.image_ID, resolution, - resolution); -#endif + gimp_image_set_resolution (scan_win.image_ID, resolution, + resolution); +#endif layer_ID = gimp_layer_new (scan_win.image_ID, "Background", scan_win.param.pixels_per_line, @@ -1244,15 +1260,16 @@ scan_start (void) scan_win.input_tag = -1; if (sane_set_io_mode (dev, SANE_TRUE) == SANE_STATUS_GOOD && sane_get_select_fd (dev, &fd) == SANE_STATUS_GOOD) - scan_win.input_tag = gdk_input_add (fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, - input_available, 0); - else + scan_win.input_tag = + gdk_input_add (fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, + input_available, 0); + else { while (gtk_events_pending ()) gtk_main_iteration (); input_available (0, -1, GDK_INPUT_READ); } - DBG(DBG_debug, "scan_start: finished\n"); + DBG (DBG_debug, "scan_start: finished\n"); } /* Invoked when the scan button is pressed */ @@ -1261,24 +1278,25 @@ scan_dialog (GtkWidget * widget, gpointer call_data) { char buf[256]; char testfilename[256]; - - DBG(DBG_debug, "scan_dialog\n"); + + DBG (DBG_debug, "scan_dialog\n"); if (scan_win.mode == STANDALONE) { /* We are running in standalone mode */ - /* test for pnm formats*/ + /* test for pnm formats */ strncpy (testfilename, preferences.filename, sizeof (testfilename)); - testfilename [sizeof (testfilename)] = 0; + testfilename[sizeof (testfilename)] = 0; g_strreverse (testfilename); - if (! ((!strncmp(testfilename,"mnp.",4)) || - (!strncmp(testfilename,"mgp.",4)) || - (!strncmp(testfilename,"mbp.",4)) || - (!strncmp(testfilename,"mpp.",4)) || - (!strncmp(testfilename,"MNP.",4)) || - (!strncmp(testfilename,"MGP.",4)) || - (!strncmp(testfilename,"MBP.",4)) || - (!strncmp(testfilename,"MPP.",4)) )) + if (!((!strncmp (testfilename, "mnp.", 4)) || + (!strncmp (testfilename, "mgp.", 4)) || + (!strncmp (testfilename, "mbp.", 4)) || + (!strncmp (testfilename, "mpp.", 4)) || + (!strncmp (testfilename, "MNP.", 4)) || + (!strncmp (testfilename, "MGP.", 4)) || + (!strncmp (testfilename, "MBP.", 4)) || + (!strncmp (testfilename, "MPP.", 4)))) { - snprintf (buf, sizeof (buf), "Failed to scan, wrong file extension, use pnm, pgm, pbm or ppm `%s'", + snprintf (buf, sizeof (buf), + "Failed to scan, wrong file extension, use pnm, pgm, pbm or ppm `%s'", preferences.filename); gsg_error (buf); return; @@ -1294,7 +1312,7 @@ scan_dialog (GtkWidget * widget, gpointer call_data) } gsg_sync (dialog); scan_start (); - DBG(DBG_debug, "scan_dialog: finished\n"); + DBG (DBG_debug, "scan_dialog: finished\n"); } #if 0 @@ -1303,8 +1321,7 @@ static void zoom_in_preview (GtkWidget * widget, gpointer data) { if (Selection.x1 >= Selection.x2 - || Selection.y1 >= Selection.y2 - || !Selection.active) + || Selection.y1 >= Selection.y2 || !Selection.active) return; Selection.active = FALSE; @@ -1328,7 +1345,7 @@ zoom_out_preview (GtkWidget * widget, gpointer data) #endif /* 0 */ static void -files_exit_callback (GtkWidget *widget, gpointer data) +files_exit_callback (GtkWidget * widget, gpointer data) { quit_xscanimage (); } @@ -1338,7 +1355,7 @@ files_build_menu (void) { GtkWidget *menu, *item; - DBG(DBG_debug, "files_build_menu\n"); + DBG (DBG_debug, "files_build_menu\n"); menu = gtk_menu_new (); item = gtk_menu_item_new (); @@ -1351,17 +1368,17 @@ files_build_menu (void) (GtkSignalFunc) files_exit_callback, 0); gtk_widget_show (item); - DBG(DBG_debug, "files_build_menu: finished\n"); + DBG (DBG_debug, "files_build_menu: finished\n"); return menu; } static void -pref_set_unit_callback (GtkWidget *widget, gpointer data) +pref_set_unit_callback (GtkWidget * widget, gpointer data) { const char *unit = data; double unit_conversion_factor = 1.0; - DBG(DBG_debug, "pref_set_unit_callback\n"); + DBG (DBG_debug, "pref_set_unit_callback\n"); if (strcmp (unit, "cm") == 0) unit_conversion_factor = 10.0; @@ -1375,11 +1392,11 @@ pref_set_unit_callback (GtkWidget *widget, gpointer data) preview_update (scan_win.preview); pref_xscanimage_save (); - DBG(DBG_debug, "pref_set_unit_callback: finished\n"); + DBG (DBG_debug, "pref_set_unit_callback: finished\n"); } static void -update_int_callback (GtkWidget *widget, gpointer data) +update_int_callback (GtkWidget * widget, gpointer data) { int *valuep = data; @@ -1387,7 +1404,7 @@ update_int_callback (GtkWidget *widget, gpointer data) } static void -update_double_callback (GtkWidget *widget, gpointer data) +update_double_callback (GtkWidget * widget, gpointer data) { double *valuep = data; const char *start; @@ -1404,17 +1421,18 @@ update_double_callback (GtkWidget *widget, gpointer data) } static void -preview_options_ok_callback (GtkWidget *widget, gpointer data) +preview_options_ok_callback (GtkWidget * widget, gpointer data) { GtkWidget *dialog = data; char buf[1024]; - DBG(DBG_debug, "preview_options_ok_callback\n"); + DBG (DBG_debug, "preview_options_ok_callback\n"); - /* gamma min, max test*/ + /* gamma min, max test */ if (preferences.preview_gamma < 0.0 || preferences.preview_gamma > 255.0) - { - snprintf (buf, sizeof (buf), "Gamma value %g is < 0 or > 255, please change!", + { + snprintf (buf, sizeof (buf), + "Gamma value %g is < 0 or > 255, please change!", preferences.preview_gamma); gsg_warning (buf); return; @@ -1429,11 +1447,11 @@ preview_options_ok_callback (GtkWidget *widget, gpointer data) "It is necessary to restart %s for the changes to take effect.", prog_name); gsg_warning (buf); - DBG(DBG_debug, "preview_options_ok_callback: finished\n"); + DBG (DBG_debug, "preview_options_ok_callback: finished\n"); } static void -preview_options_cancel_callback (GtkWidget *widget, gpointer data) +preview_options_cancel_callback (GtkWidget * widget, gpointer data) { GtkWidget *dialog = data; @@ -1441,12 +1459,12 @@ preview_options_cancel_callback (GtkWidget *widget, gpointer data) } static void -preview_options_dialog (GtkWidget *widget, gpointer data) +preview_options_dialog (GtkWidget * widget, gpointer data) { GtkWidget *dialog, *vbox, *hbox, *button, *label, *text; char buf[64]; - DBG(DBG_debug, "preview_options_dialog\n"); + DBG (DBG_debug, "preview_options_dialog\n"); dialog = gtk_dialog_new (); sprintf (buf, "%s preview options", prog_name); gtk_window_set_title (GTK_WINDOW (dialog), buf); @@ -1455,7 +1473,7 @@ preview_options_dialog (GtkWidget *widget, gpointer data) /* preserve preview image: */ - hbox = gtk_hbox_new (/* homogeneous */ FALSE, 0); + hbox = gtk_hbox_new ( /* homogeneous */ FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 2); button = gtk_check_button_new_with_label ("Preserve preview image"); gtk_signal_connect (GTK_OBJECT (button), "toggled", @@ -1470,7 +1488,7 @@ preview_options_dialog (GtkWidget *widget, gpointer data) /* private colormap: */ - hbox = gtk_hbox_new (/* homogeneous */ FALSE, 0); + hbox = gtk_hbox_new ( /* homogeneous */ FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 2); button = gtk_check_button_new_with_label ("Use private colormap"); gtk_signal_connect (GTK_OBJECT (button), "toggled", @@ -1485,7 +1503,7 @@ preview_options_dialog (GtkWidget *widget, gpointer data) /* gamma correction value: */ - hbox = gtk_hbox_new (/* homogeneous */ FALSE, 0); + hbox = gtk_hbox_new ( /* homogeneous */ FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 2); gtk_widget_show (hbox); @@ -1515,21 +1533,22 @@ preview_options_dialog (GtkWidget *widget, gpointer data) button = gtk_button_new_with_label ("Cancel"); gtk_signal_connect (GTK_OBJECT (button), "clicked", - (GtkSignalFunc) preview_options_cancel_callback, dialog); + (GtkSignalFunc) preview_options_cancel_callback, + dialog); gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0); gtk_widget_show (button); gtk_widget_show (dialog); - DBG(DBG_debug, "preview_options_dialog: finished\n"); + DBG (DBG_debug, "preview_options_dialog: finished\n"); } static void -pref_device_save (GtkWidget *widget, gpointer data) +pref_device_save (GtkWidget * widget, gpointer data) { char filename[PATH_MAX]; int fd; - DBG(DBG_debug, "pref_device_save\n"); + DBG (DBG_debug, "pref_device_save\n"); gsg_make_path (sizeof (filename), filename, "xscanimage", 0, dialog->dev_name, ".rc"); fd = open (filename, O_WRONLY | O_CREAT | O_TRUNC, 0666); @@ -1545,7 +1564,7 @@ pref_device_save (GtkWidget *widget, gpointer data) gsg_sync (dialog); sanei_save_values (fd, dialog->dev); close (fd); - DBG(DBG_debug, "pref_device_save: finished\n"); + DBG (DBG_debug, "pref_device_save: finished\n"); } static void @@ -1554,7 +1573,7 @@ pref_device_restore (void) char filename[PATH_MAX]; int fd; - DBG(DBG_debug, "pref_device_restore\n"); + DBG (DBG_debug, "pref_device_restore\n"); gsg_make_path (sizeof (filename), filename, "xscanimage", 0, dialog->dev_name, ".rc"); fd = open (filename, O_RDONLY); @@ -1564,11 +1583,11 @@ pref_device_restore (void) close (fd); gsg_refresh_dialog (dialog); - DBG(DBG_debug, "pref_device_restore: finished\n"); + DBG (DBG_debug, "pref_device_restore: finished\n"); } static void -pref_toggle_advanced (GtkWidget *widget, gpointer data) +pref_toggle_advanced (GtkWidget * widget, gpointer data) { preferences.advanced = (GTK_CHECK_MENU_ITEM (widget)->active != 0); gsg_set_advanced (dialog, preferences.advanced); @@ -1576,7 +1595,7 @@ pref_toggle_advanced (GtkWidget *widget, gpointer data) } static void -pref_toggle_tooltips (GtkWidget *widget, gpointer data) +pref_toggle_tooltips (GtkWidget * widget, gpointer data) { preferences.tooltips_enabled = (GTK_CHECK_MENU_ITEM (widget)->active != 0); gsg_set_tooltips (dialog, preferences.tooltips_enabled); @@ -1584,7 +1603,7 @@ pref_toggle_tooltips (GtkWidget *widget, gpointer data) } static void -pref_toggle_twocolumn (GtkWidget *widget, gpointer data) +pref_toggle_twocolumn (GtkWidget * widget, gpointer data) { preferences.twocolumn_enabled = (GTK_CHECK_MENU_ITEM (widget)->active != 0); gsg_set_twocolumn (dialog, preferences.twocolumn_enabled); @@ -1599,7 +1618,7 @@ pref_build_menu (void) GSList *units_group = NULL; double unit; - DBG(DBG_debug, "pref_build_menu\n"); + DBG (DBG_debug, "pref_build_menu\n"); menu = gtk_menu_new (); /* advanced user option: */ @@ -1620,7 +1639,7 @@ pref_build_menu (void) gtk_widget_show (item); gtk_signal_connect (GTK_OBJECT (item), "toggled", (GtkSignalFunc) pref_toggle_tooltips, 0); - + /* two column submenu: */ item = gtk_check_menu_item_new_with_label ("Show two column display"); @@ -1668,7 +1687,7 @@ pref_build_menu (void) gtk_signal_connect (GTK_OBJECT (unit_cm), "toggled", (GtkSignalFunc) pref_set_unit_callback, "cm"); gtk_signal_connect (GTK_OBJECT (unit_in), "toggled", - (GtkSignalFunc) pref_set_unit_callback, "in"); + (GtkSignalFunc) pref_set_unit_callback, "in"); gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), submenu); @@ -1697,16 +1716,16 @@ pref_build_menu (void) (GtkSignalFunc) pref_device_restore, 0); gtk_widget_show (item); - DBG(DBG_debug, "pref_build_menu: finished\n"); + DBG (DBG_debug, "pref_build_menu: finished\n"); return menu; } static void -browse_filename_callback (GtkWidget *widget, gpointer data) +browse_filename_callback (GtkWidget * widget, gpointer data) { char filename[1024]; - DBG(DBG_debug, "browse_filename_callback\n"); + DBG (DBG_debug, "browse_filename_callback\n"); if (preferences.filename) { strncpy (filename, preferences.filename, sizeof (filename)); @@ -1720,11 +1739,11 @@ browse_filename_callback (GtkWidget *widget, gpointer data) if (preferences.filename) free ((void *) preferences.filename); preferences.filename = strdup (filename); - DBG(DBG_debug, "browse_filename_callback: finished\n"); + DBG (DBG_debug, "browse_filename_callback: finished\n"); } static void -filename_changed_callback (GtkWidget *widget, gpointer data) +filename_changed_callback (GtkWidget * widget, gpointer data) { if (preferences.filename) free ((void *) preferences.filename); @@ -1735,11 +1754,12 @@ filename_changed_callback (GtkWidget *widget, gpointer data) static void device_dialog (void) { - GtkWidget *vbox, *hbox, *button, *frame, *scrolled_window, *dialog_window, *label, *text; + GtkWidget *vbox, *hbox, *button, *frame, *scrolled_window, *dialog_window, + *label, *text; GtkWidget *menubar_item; const gchar *devname; - DBG(DBG_debug, "device_dialog\n"); + DBG (DBG_debug, "device_dialog\n"); /* first, restore xscanimage preferences */ pref_xscanimage_restore (); @@ -1818,10 +1838,10 @@ device_dialog (void) GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); gtk_scrolled_window_set_placement (GTK_SCROLLED_WINDOW (scrolled_window), GTK_CORNER_TOP_RIGHT); - dialog_window = gtk_hbox_new (/* homogeneous */ FALSE, 0); - gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled_window), - dialog_window); - + dialog_window = gtk_hbox_new ( /* homogeneous */ FALSE, 0); + gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW + (scrolled_window), dialog_window); + gtk_box_pack_start (GTK_BOX (vbox), scrolled_window, TRUE, TRUE, 0); gtk_widget_show (scrolled_window); gtk_widget_show (dialog_window); @@ -1859,13 +1879,13 @@ device_dialog (void) /* The Scan button */ scan_win.scan_button = gtk_button_new_with_label ("Scan"); gtk_signal_connect (GTK_OBJECT (scan_win.scan_button), "clicked", - (GtkSignalFunc) scan_dialog, - NULL); + (GtkSignalFunc) scan_dialog, NULL); gtk_box_pack_start (GTK_BOX (hbox), scan_win.scan_button, TRUE, TRUE, 0); gtk_widget_show (scan_win.scan_button); /* The Preview button */ - scan_win.preview_button = gtk_toggle_button_new_with_label ("Preview Window"); + scan_win.preview_button = + gtk_toggle_button_new_with_label ("Preview Window"); gtk_signal_connect (GTK_OBJECT (scan_win.preview_button), "clicked", (GtkSignalFunc) scan_preview, NULL); gtk_box_pack_start (GTK_BOX (hbox), scan_win.preview_button, TRUE, TRUE, 0); @@ -1875,23 +1895,21 @@ device_dialog (void) /* The Zoom in button */ button = gtk_button_new_with_label ("Zoom"); gtk_signal_connect (GTK_OBJECT (button), "clicked", - (GtkSignalFunc) zoom_in_preview, - NULL); + (GtkSignalFunc) zoom_in_preview, NULL); gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0); gtk_widget_show (button); /* The Zoom out button */ button = gtk_button_new_with_label ("Zoom out"); gtk_signal_connect (GTK_OBJECT (button), "clicked", - (GtkSignalFunc) zoom_out_preview, - NULL); + (GtkSignalFunc) zoom_out_preview, NULL); gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0); gtk_widget_show (button); #endif pref_device_restore (); /* restore device-settings */ gtk_widget_show (scan_win.shell); - DBG(DBG_debug, "device_dialog: finished\n"); + DBG (DBG_debug, "device_dialog: finished\n"); } static void @@ -1902,7 +1920,7 @@ ok_choose_dialog_callback (void) } static int -select_device_callback (GtkWidget * widget, GdkEventButton *event, +select_device_callback (GtkWidget * widget, GdkEventButton * event, gpointer data) { seldev = (long) data; @@ -1920,7 +1938,7 @@ choose_device (void) const SANE_Device *adev; gint i; - DBG(DBG_debug, "choose_device\n"); + DBG (DBG_debug, "choose_device\n"); choose_device_dialog = gtk_dialog_new (); gtk_window_set_title (GTK_WINDOW (choose_device_dialog), "Select device"); gtk_signal_connect (GTK_OBJECT (choose_device_dialog), "delete_event", @@ -1948,7 +1966,7 @@ choose_device (void) gtk_widget_show (button); owner = gtk_radio_button_group (GTK_RADIO_BUTTON (button)); if (i == defdev) - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (button), TRUE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); } /* The bottom row of buttons */ @@ -1958,8 +1976,7 @@ choose_device (void) button = gtk_button_new_with_label ("OK"); GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); gtk_signal_connect (GTK_OBJECT (button), "clicked", - (GtkSignalFunc) ok_choose_dialog_callback, - NULL); + (GtkSignalFunc) ok_choose_dialog_callback, NULL); gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0); gtk_widget_grab_default (button); gtk_widget_show (button); @@ -1972,14 +1989,14 @@ choose_device (void) gtk_widget_show (button); gtk_widget_show (choose_device_dialog); - DBG(DBG_debug, "choose_device: finished\n"); + DBG (DBG_debug, "choose_device: finished\n"); return 0; } static void usage (void) { - printf ("Usage: %s [OPTION]... [DEVICE]\n\ + printf ("Usage: %s [OPTION]... [DEVICE]\n\ \n\ Start up graphical user interface to access SANE (Scanner Access Now\n\ Easy) devices.\n\ @@ -1995,7 +2012,9 @@ init (int argc, char **argv) struct stat st; SANE_Status status; - DBG(DBG_debug, "init\n"); + DBG_INIT (); + + DBG (DBG_debug, "init\n"); gtk_init (&argc, &argv); #ifdef HAVE_LIBGIMP_GIMP_H gtk_rc_parse (gimp_gtkrc ()); @@ -2006,7 +2025,7 @@ init (int argc, char **argv) gdk_set_use_xshm (TRUE); # else gdk_set_use_xshm (gimp_use_xshm ()); -# endif /* !ENABLE_GIMP_1_2 */ +# endif /* !ENABLE_GIMP_1_2 */ #endif gsg_make_path (sizeof (filename), filename, 0, "sane-style", 0, ".rc"); @@ -2014,7 +2033,7 @@ init (int argc, char **argv) gtk_rc_parse (filename); else { - strncpy (filename, STRINGIFY(PATH_SANE_DATA_DIR) "/sane-style.rc", + strncpy (filename, STRINGIFY (PATH_SANE_DATA_DIR) "/sane-style.rc", sizeof (filename)); filename[sizeof (filename) - 1] = '\0'; if (stat (filename, &st) >= 0) @@ -2024,7 +2043,8 @@ init (int argc, char **argv) status = sane_init (0, 0); if (status != SANE_STATUS_GOOD) { - DBG (DBG_fatal, "init: sane_init failed: %s\n", sane_strstatus (status)); + DBG (DBG_fatal, "init: sane_init failed: %s\n", + sane_strstatus (status)); exit (1); } @@ -2056,31 +2076,32 @@ init (int argc, char **argv) if (optind < argc) { memset (&dev, 0, sizeof (dev)); - dev.name = argv[argc - 1]; + dev.name = argv[argc - 1]; dev.vendor = "Unknown"; - dev.type = "unknown"; - dev.model = "unknown"; + dev.type = "unknown"; + dev.model = "unknown"; devlist = device_list; seldev = 0; } } - + if (seldev < 0) { - char * defdevname; + char *defdevname; status = sane_get_devices (&devlist, SANE_FALSE); if (status != SANE_STATUS_GOOD) { - DBG (DBG_fatal, "init: sane_get_devices failed: %s\n", sane_strstatus (status)); + DBG (DBG_fatal, "init: sane_get_devices failed: %s\n", + sane_strstatus (status)); exit (1); } - if ((defdevname = getenv("SANE_DEFAULT_DEVICE")) != NULL) + if ((defdevname = getenv ("SANE_DEFAULT_DEVICE")) != NULL) { int i; - + for (i = 0; devlist[i] != 0; i++) { if (strcmp (devlist[i]->name, defdevname) == 0) @@ -2096,7 +2117,7 @@ init (int argc, char **argv) DBG (DBG_info, "default device is `%s'\n", defdevname); } } - DBG(DBG_debug, "init: finished\n"); + DBG (DBG_debug, "init: finished\n"); } static void @@ -2104,7 +2125,7 @@ interface (int argc, char **argv) { scan_win.info_label = NULL; - DBG(DBG_debug, "interface\n"); + DBG (DBG_debug, "interface\n"); init (argc, argv); for (ndevs = 0; devlist[ndevs]; ++ndevs); @@ -2137,7 +2158,8 @@ interface (int argc, char **argv) } else { - DBG (DBG_fatal, "No scanners were identified. If you were expecting something\n" + DBG (DBG_fatal, + "No scanners were identified. If you were expecting something\n" " different, check that the scanner is plugged in, turned on and\n" " detected by sane-find-scanner (if appropriate). Please read\n" " the documentation which came with this software (README, FAQ,\n" @@ -2146,20 +2168,20 @@ interface (int argc, char **argv) } } gtk_quit_flag = 1; - DBG(DBG_debug, "interface: now running gtk_main ()\n"); + DBG (DBG_debug, "interface: now running gtk_main ()\n"); gtk_main (); sane_exit (); - DBG(DBG_debug, "interface: finished\n"); + DBG (DBG_debug, "interface: finished\n"); } int main (int argc, char **argv) { - DBG_INIT(); - DBG(DBG_debug, "main\n"); - DBG(DBG_error, "xscanimage (version: %s, package: %s) starting\n", VERSION, - PACKAGE); - little_endian = calc_little_endian(); + DBG_INIT (); + DBG (DBG_debug, "main\n"); + DBG (DBG_error, "xscanimage (version: %s, package: %s) starting\n", VERSION, + PACKAGE); + little_endian = calc_little_endian (); scan_win.mode = STANDALONE; gtk_quit_flag = 0; prog_name = strrchr (argv[0], '/'); @@ -2179,16 +2201,16 @@ main (int argc, char **argv) gimp" messages when xscanimage gets invoked in stand-alone mode. */ old_print_func = g_set_print_handler (null_print_func); - old_printerr_func = g_set_printerr_handler(null_print_func); + old_printerr_func = g_set_printerr_handler (null_print_func); /* gimp_main () returns 1 if xscanimage wasn't invoked by GIMP */ # ifdef HAVE_OS2_H - set_gimp_PLUG_IN_INFO(&PLUG_IN_INFO); + set_gimp_PLUG_IN_INFO (&PLUG_IN_INFO); # endif # ifndef ENABLE_GIMP_1_2 result = gimp_main (&PLUG_IN_INFO, argc, argv); # else result = gimp_main (argc, argv); -# endif /* !ENABLE_GIMP_1_2 */ +# endif /* !ENABLE_GIMP_1_2 */ g_set_print_handler (old_print_func); g_set_printerr_handler (old_printerr_func); if (result) @@ -2197,6 +2219,6 @@ main (int argc, char **argv) #else interface (argc, argv); #endif /* HAVE_LIBGIMP_GIMP_H */ - DBG(DBG_debug, "main: finished\n"); + DBG (DBG_debug, "main: finished\n"); return 0; }