ADDED cursorshapes.h Index: cursorshapes.h ================================================================== --- /dev/null +++ cursorshapes.h @@ -0,0 +1,313 @@ +#ifndef XC_X_cursor +#define XC_X_cursor 0 +#define XC_arrow 2 +#define XC_based_arrow_down 4 +#define XC_based_arrow_up 6 +#define XC_boat 8 +#define XC_bogosity 10 +#define XC_bottom_left_corner 12 +#define XC_bottom_right_corner 14 +#define XC_bottom_side 16 +#define XC_bottom_tee 18 +#define XC_box_spiral 20 +#define XC_center_ptr 22 +#define XC_circle 24 +#define XC_clock 26 +#define XC_coffee_mug 28 +#define XC_cross 30 +#define XC_cross_reverse 32 +#define XC_crosshair 34 +#define XC_diamond_cross 36 +#define XC_dot 38 +#define XC_dot_box_mask 40 +#define XC_double_arrow 42 +#define XC_draft_large 44 +#define XC_draft_small 46 +#define XC_draped_box 48 +#define XC_exchange 50 +#define XC_fleur 52 +#define XC_gobbler 54 +#define XC_gumby 56 +#define XC_hand1 58 +#define XC_hand2 60 +#define XC_heart 62 +#define XC_icon 64 +#define XC_iron_cross 66 +#define XC_left_ptr 68 +#define XC_left_side 70 +#define XC_left_tee 72 +#define XC_leftbutton 74 +#define XC_ll_angle 76 +#define XC_lr_angle 78 +#define XC_man 80 +#define XC_middlebutton 82 +#define XC_mouse 84 +#define XC_pencil 86 +#define XC_pirate 88 +#define XC_plus 90 +#define XC_question_arrow 92 +#define XC_right_ptr 94 +#define XC_right_side 96 +#define XC_right_tee 98 +#define XC_rightbutton 100 +#define XC_rtl_logo 102 +#define XC_sailboat 104 +#define XC_sb_down_arrow 106 +#define XC_sb_h_double_arrow 108 +#define XC_sb_left_arrow 110 +#define XC_sb_right_arrow 112 +#define XC_sb_up_arrow 114 +#define XC_sb_v_double_arrow 116 +#define XC_shuttle 118 +#define XC_sizing 120 +#define XC_spider 122 +#define XC_spraycan 124 +#define XC_star 126 +#define XC_target 128 +#define XC_tcross 130 +#define XC_top_left_arrow 132 +#define XC_top_left_corner 134 +#define XC_top_right_corner 136 +#define XC_top_side 138 +#define XC_top_tee 140 +#define XC_trek 142 +#define XC_ul_angle 144 +#define XC_umbrella 146 +#define XC_ur_angle 148 +#define XC_watch 150 +#define XC_xterm 152 +#endif +static const Uint8 cursorimg[]={ +0,0,112,14,120,30,124,62,62,124,31,248,15,240,7,224,7,224,15,240,31,248,62,124,124,62,120,30,112,14,0,0, +240,15,248,31,252,63,254,127,127,254,63,252,31,248,15,240,15,240,31,248,63,252,127,254,254,127,252,63,248,31,240,15, +0,0,0,6,0,30,0,124,1,252,7,248,31,248,1,240,3,240,7,96,14,96,28,64,56,64,112,0,32,0,0,0, +0,7,0,31,0,127,1,254,7,254,31,252,63,252,63,248,7,248,15,240,31,240,62,224,124,224,248,64,112,0,32,0, +0,0,127,128,0,0,127,128,12,0,12,0,12,0,12,0,45,0,30,0,12,0,0,0,0,0,0,0,0,0,0,0, +255,192,255,192,255,192,255,192,255,192,30,0,30,0,127,128,127,128,127,128,63,0,30,0,0,0,0,0,0,0,0,0, +0,0,12,0,30,0,45,0,12,0,12,0,12,0,12,0,127,128,0,0,127,128,0,0,0,0,0,0,0,0,0,0, +12,0,30,0,127,128,127,128,127,128,30,0,30,0,255,192,255,192,255,192,255,192,255,192,0,0,0,0,0,0,0,0, +0,0,1,0,7,192,136,96,255,255,0,24,0,32,0,64,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +7,0,15,192,159,224,255,255,255,255,255,255,255,248,255,224,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,113,28,17,16,17,16,17,16,127,252,81,20,81,20,81,20,81,20,127,252,17,16,17,16,17,16,113,28,0,0, +251,190,251,190,251,190,59,184,255,254,255,254,255,254,251,190,251,190,255,254,255,254,255,254,59,184,251,190,251,190,251,190, +0,0,96,0,96,0,98,8,98,16,98,32,98,64,98,128,99,0,99,248,96,0,96,0,96,0,127,254,127,254,0,0, +240,0,240,0,247,12,247,28,247,56,247,112,247,224,247,192,247,252,247,252,247,252,240,0,255,255,255,255,255,255,255,255, +0,0,0,6,0,6,16,70,8,70,4,70,2,70,1,70,0,198,31,198,0,6,0,6,0,6,127,254,127,254,0,0, +0,15,0,15,48,239,56,239,28,239,14,239,7,239,3,239,63,239,63,239,63,239,0,15,255,255,255,255,255,255,255,255, +0,0,1,0,1,0,1,0,1,0,1,0,1,0,17,16,9,32,5,64,3,128,1,0,0,0,127,252,127,252,0,0, +3,128,3,128,3,128,3,128,3,128,3,128,51,152,59,184,31,240,15,224,7,192,3,128,255,254,255,254,255,254,255,254, +0,0,1,128,1,128,1,128,1,128,1,128,1,128,1,128,1,128,127,254,127,254,0,0,0,0,0,0,0,0,0,0, +3,192,3,192,3,192,3,192,3,192,3,192,3,192,3,192,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0, +255,254,128,0,191,254,160,2,175,250,168,10,171,234,170,42,170,170,171,170,168,42,175,234,160,10,191,250,128,2,255,254, +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, +0,0,6,0,6,0,15,0,15,0,31,128,31,128,63,192,63,192,102,96,70,32,6,0,6,0,6,0,6,0,0,0, +15,0,15,0,31,128,31,128,63,192,63,192,127,224,127,224,255,240,255,240,255,240,239,112,15,0,15,0,15,0,15,0, +0,0,3,192,15,240,31,248,60,60,56,28,112,14,112,14,112,14,112,14,56,28,60,60,31,248,15,240,3,192,0,0, +7,224,31,248,63,252,127,254,127,254,252,63,248,31,248,31,248,31,248,31,252,63,127,254,127,254,63,252,31,248,7,224, +63,240,103,152,200,204,147,36,158,36,136,68,199,140,127,248,83,40,83,40,83,40,87,168,211,44,240,60,255,252,255,252, +127,248,239,156,219,238,183,182,191,246,159,102,207,206,255,252,215,172,215,172,215,172,223,236,215,174,243,62,255,254,255,254, +31,240,32,8,96,6,80,26,79,226,192,2,192,2,64,2,64,2,89,26,106,170,235,170,218,154,64,2,64,2,63,252, +31,240,63,248,127,255,127,255,255,255,255,255,255,255,255,255,127,255,127,255,255,255,255,255,255,255,255,255,127,255,63,252, +2,128,2,128,2,128,2,128,2,128,2,128,254,255,0,0,254,255,2,128,2,128,2,128,2,128,2,128,2,128,0,0, +7,192,7,192,7,192,7,192,7,192,255,255,255,255,255,255,255,255,255,255,7,192,7,192,7,192,7,192,7,192,7,192, +66,132,162,138,82,148,42,168,22,208,10,160,253,127,2,128,253,127,10,160,22,208,42,168,82,148,162,138,66,132,0,0, +102,204,182,219,222,246,110,236,54,216,250,191,252,127,1,0,252,127,250,191,54,216,110,236,222,246,182,219,102,204,0,0, +1,0,1,0,1,0,1,0,1,0,1,0,1,0,254,255,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,0, +3,128,3,128,3,128,3,128,3,128,3,128,255,255,255,255,255,255,3,128,3,128,3,128,3,128,3,128,3,128,3,128, +2,128,6,192,10,160,18,144,34,136,66,132,254,254,0,0,254,254,66,132,34,136,18,144,10,160,6,192,2,128,0,0, +7,192,15,224,31,240,59,184,115,156,227,142,255,255,254,255,255,255,227,142,115,156,59,184,31,240,15,224,7,192,3,128, +0,0,15,0,63,192,63,192,127,224,127,224,127,224,127,224,63,192,63,192,15,0,0,0,0,0,0,0,0,0,0,0, +31,128,127,224,127,224,255,240,255,240,255,240,255,240,255,240,255,240,127,224,127,224,31,128,0,0,0,0,0,0,0,0, +0,0,127,248,64,8,64,8,64,8,64,8,67,8,67,8,64,8,64,8,64,8,64,8,127,248,0,0,0,0,0,0, +255,252,255,252,255,252,224,28,224,28,231,156,231,156,231,156,231,156,224,28,224,28,255,252,255,252,255,252,0,0,0,0, +0,0,6,0,15,0,31,128,54,192,102,96,6,0,6,0,6,0,6,0,102,96,54,192,31,128,15,0,6,0,0,0, +15,0,31,128,63,192,127,224,255,240,255,240,255,240,15,0,15,0,255,240,255,240,255,240,127,224,63,192,31,128,15,0, +0,2,0,12,0,60,0,248,3,248,15,240,63,240,1,224,2,224,4,192,8,192,16,128,32,128,64,0,128,0,0,0, +0,6,0,30,0,126,1,252,7,248,31,248,127,240,127,240,7,224,15,224,29,192,57,192,113,128,225,128,192,0,128,0, +0,2,0,12,0,60,0,248,3,248,0,112,0,176,1,32,2,32,4,0,8,0,16,0,32,0,64,0,128,0,0,0, +0,6,0,30,0,124,1,252,7,248,7,248,1,240,3,240,7,96,14,64,28,0,56,0,112,0,224,0,192,0,0,0, +0,0,127,248,68,136,76,200,88,104,112,56,67,8,67,8,112,56,88,104,76,200,68,136,127,248,0,0,0,0,0,0, +255,252,255,252,207,204,223,236,252,252,251,124,247,188,247,188,251,124,252,252,223,236,207,204,255,252,255,252,0,0,0,0, +0,0,71,224,111,240,124,24,72,8,76,0,126,0,0,0,0,0,0,126,0,50,16,18,24,62,15,246,7,226,0,0, +199,224,239,240,255,248,255,252,252,28,255,12,255,0,255,0,0,255,0,255,48,127,56,63,63,255,31,255,15,247,7,227, +0,0,1,128,3,192,7,224,1,128,17,136,49,140,127,254,127,254,49,140,17,136,1,128,7,224,3,192,1,128,0,0, +3,192,3,224,7,224,15,240,23,232,59,220,255,255,255,255,255,255,255,255,59,220,23,232,15,240,7,224,3,192,3,192, +0,0,0,120,0,112,128,51,159,176,255,240,254,48,252,48,96,56,0,240,31,224,8,0,8,0,8,0,8,0,30,0, +0,252,0,252,192,255,255,255,255,255,255,252,255,252,255,252,255,252,255,252,127,248,31,240,28,0,28,0,63,0,63,0, +63,0,16,128,200,64,234,160,200,32,203,160,248,60,56,63,8,39,8,39,9,47,9,39,9,32,17,16,33,8,62,248, +63,0,223,128,239,192,255,224,239,224,239,252,255,254,255,255,63,239,15,239,15,255,15,239,15,231,31,240,63,248,62,248, +0,24,0,120,1,224,3,192,7,128,15,192,31,224,95,192,255,224,191,224,15,192,15,128,148,0,196,0,104,0,48,0, +0,56,0,248,3,240,7,224,15,192,31,224,127,240,255,240,255,240,255,240,255,224,255,192,255,128,254,0,252,0,120,0, +0,0,127,128,128,64,126,32,16,16,14,16,16,16,14,40,16,68,12,130,3,4,2,72,1,16,0,160,0,64,0,0, +127,128,255,192,255,224,255,240,127,248,31,248,63,248,31,252,63,254,31,255,15,254,7,252,3,248,1,240,0,224,0,64, +62,248,99,140,193,6,128,2,128,2,128,2,128,2,192,6,96,12,48,24,24,48,12,96,6,192,3,128,0,0,0,0, +62,248,127,252,227,142,193,6,192,6,192,6,194,134,225,14,112,28,56,56,28,112,15,224,7,192,3,128,0,0,0,0, +255,255,213,85,170,171,213,85,160,11,208,5,160,11,208,5,160,11,208,5,160,11,208,5,170,171,213,85,170,171,255,255, +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, +0,0,63,252,31,248,79,242,103,230,115,206,121,158,127,254,127,254,121,158,115,206,103,230,79,242,31,248,63,252,0,0, +63,252,127,254,127,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,127,254,127,254,63,252, +0,0,64,0,96,0,112,0,120,0,124,0,126,0,127,0,127,128,124,0,108,0,70,0,6,0,3,0,3,0,0,0, +192,0,224,0,240,0,248,0,252,0,254,0,255,0,255,128,255,192,255,192,254,0,239,0,207,0,7,128,7,128,3,0, +0,0,96,0,96,0,96,128,97,0,98,0,100,0,111,254,100,0,98,0,97,0,96,128,96,0,96,0,0,0,0,0, +240,0,240,0,240,192,241,192,243,128,247,0,255,255,255,255,255,255,247,0,243,128,241,192,240,192,240,0,240,0,0,0, +0,0,96,0,96,0,96,0,96,0,96,0,96,0,127,224,127,224,96,0,96,0,96,0,96,0,96,0,96,0,0,0, +240,0,240,0,240,0,240,0,240,0,240,0,255,240,255,240,255,240,255,240,240,0,240,0,240,0,240,0,240,0,240,0, +128,3,127,253,127,253,68,69,69,85,69,85,69,85,69,85,68,69,127,253,127,253,127,253,127,253,127,253,127,253,128,3, +127,252,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,127,252, +0,0,96,0,96,0,96,0,96,0,96,0,96,0,96,0,96,0,127,224,127,224,0,0,0,0,0,0,0,0,0,0, +240,0,240,0,240,0,240,0,240,0,240,0,240,0,240,0,255,240,255,240,255,240,255,240,0,0,0,0,0,0,0,0, +0,0,0,96,0,96,0,96,0,96,0,96,0,96,0,96,0,96,127,224,127,224,0,0,0,0,0,0,0,0,0,0, +0,240,0,240,0,240,0,240,0,240,0,240,0,240,0,240,255,240,255,240,255,240,255,240,0,0,0,0,0,0,0,0, +3,128,30,240,2,128,129,0,67,135,36,75,29,112,5,64,4,64,2,128,4,64,9,32,18,144,20,80,120,60,248,63, +31,224,63,240,63,248,195,130,231,199,127,255,63,251,31,240,7,224,7,192,15,224,31,240,63,248,126,252,252,127,252,127, +128,3,127,253,127,253,68,69,84,85,84,85,84,85,84,85,68,69,127,253,127,253,127,253,127,253,127,253,127,253,128,3, +127,252,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,127,252, +7,0,12,0,6,0,3,0,127,248,128,4,179,54,179,54,179,54,128,6,128,6,96,28,24,96,7,128,0,0,0,0, +15,128,30,0,15,0,7,0,127,248,255,252,255,255,255,255,255,255,255,255,255,255,255,255,63,247,31,224,15,192,7,128, +56,0,68,0,70,0,37,0,61,0,16,128,8,128,8,64,4,64,6,32,2,32,1,16,0,240,0,112,0,48,0,16, +252,0,254,0,255,0,127,0,63,128,63,128,31,192,15,192,15,224,7,224,7,240,3,248,1,248,0,248,0,120,0,56, +7,128,15,192,31,224,51,48,51,48,31,224,15,192,7,128,135,132,135,134,67,8,56,112,7,128,31,226,240,62,128,4, +15,192,31,224,63,240,127,248,127,248,63,240,31,224,143,193,143,199,207,207,247,156,120,120,7,128,127,227,255,255,240,62, +0,0,6,0,6,0,6,0,6,0,127,224,127,224,6,0,6,0,6,0,6,0,0,0,0,0,0,0,0,0,0,0, +15,0,15,0,15,0,15,0,255,240,255,240,255,240,255,240,15,0,15,0,15,0,15,0,0,0,0,0,0,0,0,0, +0,0,31,0,63,128,113,192,96,192,112,192,49,192,3,128,15,0,14,0,10,0,10,0,59,128,27,0,14,0,4,0, +31,0,63,128,127,192,255,224,241,224,249,224,123,224,63,192,31,128,31,0,31,0,63,128,127,192,63,128,31,0,14,0, +0,0,0,128,1,128,3,128,7,128,15,128,31,128,63,128,127,128,15,128,13,128,24,128,24,0,48,0,48,0,0,0, +0,192,1,192,3,192,7,192,15,192,31,192,63,192,127,192,255,192,255,192,31,192,61,192,60,192,120,0,120,0,48,0, +0,0,0,6,0,6,1,6,0,134,0,70,0,38,127,246,0,38,0,70,0,134,1,6,0,6,0,6,0,0,0,0, +0,15,0,15,3,15,3,143,1,207,0,239,255,255,255,255,255,255,0,239,1,207,3,143,3,15,0,15,0,15,0,0, +0,0,0,96,0,96,0,96,0,96,0,96,0,96,127,224,127,224,0,96,0,96,0,96,0,96,0,96,0,96,0,0, +0,240,0,240,0,240,0,240,0,240,0,240,255,240,255,240,255,240,255,240,0,240,0,240,0,240,0,240,0,240,0,240, +128,3,127,253,127,253,68,69,85,69,85,69,85,69,85,69,68,69,127,253,127,253,127,253,127,253,127,253,127,253,128,3, +127,252,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,255,254,127,252, +0,0,127,254,64,34,64,34,64,34,127,226,68,34,68,34,68,34,68,34,71,254,68,2,68,2,68,2,127,254,0,0, +255,255,255,255,255,255,224,119,255,247,255,247,255,247,238,119,238,119,239,255,239,255,239,255,238,7,255,255,255,255,255,255, +0,0,0,64,0,64,1,96,1,96,3,96,3,112,7,112,7,112,15,120,15,120,31,120,31,124,62,56,0,0,0,0, +0,192,0,224,1,224,3,240,3,240,7,240,7,248,15,248,15,248,31,252,31,252,63,252,63,255,127,255,255,248,127,224, +20,0,20,0,20,0,20,0,20,0,20,0,20,0,20,0,20,0,20,0,20,0,127,0,62,0,28,0,8,0,0,0, +62,0,62,0,62,0,62,0,62,0,62,0,62,0,62,0,62,0,62,0,255,128,255,128,127,0,62,0,28,0,8,0, +0,0,16,16,48,24,127,252,240,30,127,252,48,24,16,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +24,48,56,56,127,252,255,254,255,254,255,254,127,252,56,56,24,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,8,0,24,0,63,255,120,0,63,255,24,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +12,0,28,0,63,255,127,255,255,255,127,255,63,255,28,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,16,0,24,255,252,0,30,255,252,0,24,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,48,0,56,255,252,255,254,255,255,255,254,255,252,0,56,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,8,0,28,0,62,0,127,0,20,0,20,0,20,0,20,0,20,0,20,0,20,0,20,0,20,0,20,0,20,0, +8,0,28,0,62,0,127,0,255,128,255,128,62,0,62,0,62,0,62,0,62,0,62,0,62,0,62,0,62,0,62,0, +8,0,28,0,62,0,127,0,20,0,20,0,20,0,20,0,20,0,20,0,20,0,127,0,62,0,28,0,8,0,0,0, +28,0,62,0,127,0,255,128,255,128,62,0,62,0,62,0,62,0,62,0,255,128,255,128,127,0,62,0,28,0,0,0, +0,16,0,56,0,124,0,239,2,239,4,239,8,239,8,239,8,239,8,239,24,239,56,239,126,239,12,68,0,60,0,24, +0,56,0,124,0,254,0,255,6,255,14,255,30,255,30,255,30,255,30,255,62,255,126,255,254,255,126,254,12,126,0,60, +0,0,127,128,64,0,64,0,64,0,71,224,68,32,68,34,68,34,4,34,7,226,0,18,0,10,0,6,1,254,0,0, +255,192,255,192,255,192,224,0,239,240,239,240,239,247,238,119,238,119,239,247,15,247,15,255,0,31,3,255,3,255,3,255, +32,16,16,32,16,32,8,64,8,64,135,135,103,152,31,224,31,224,103,152,135,135,8,64,8,64,16,32,16,32,32,16, +96,24,48,48,16,32,24,96,143,193,207,207,111,220,63,240,63,224,111,248,207,207,143,193,24,64,24,96,48,48,96,24, +0,48,0,128,26,48,60,128,52,48,126,0,66,0,114,0,82,0,114,0,82,0,114,0,114,0,66,0,66,0,126,0, +0,48,24,176,62,176,62,176,126,176,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, +1,0,2,128,2,128,2,128,4,64,4,64,4,64,57,56,192,6,56,56,9,32,18,144,36,72,40,40,48,24,32,8, +1,0,3,128,3,128,6,192,6,192,12,96,28,120,249,62,192,7,248,62,57,56,51,152,102,204,108,108,120,60,112,28, +0,0,3,128,15,224,28,112,48,24,96,12,193,6,194,134,193,6,96,12,48,24,28,112,15,224,3,128,0,0,0,0, +7,192,15,224,31,240,60,120,112,28,225,14,195,135,198,199,195,135,225,14,112,28,60,120,31,240,7,192,0,0,0,0, +0,0,1,0,1,0,1,0,1,0,1,0,1,0,127,252,1,0,1,0,1,0,1,0,1,0,1,0,0,0,0,0, +3,128,3,128,3,128,3,128,3,128,3,128,255,254,255,254,255,254,3,128,3,128,3,128,3,128,3,128,3,128,0,0, +0,0,96,0,120,0,62,0,63,128,31,224,31,248,15,128,15,128,6,64,6,32,2,16,2,8,0,4,0,2,0,0, +224,0,248,0,254,0,127,128,127,224,63,252,63,252,31,252,31,192,15,224,15,112,7,56,7,28,7,14,0,7,0,3, +0,0,127,254,127,254,96,0,96,0,96,0,99,248,99,0,98,128,98,64,98,32,98,16,98,8,96,0,96,0,0,0, +255,255,255,255,255,255,255,255,240,0,247,252,247,252,247,252,247,192,247,224,247,112,247,56,247,28,247,12,240,0,240,0, +0,0,127,254,127,254,0,6,0,6,0,6,31,198,0,198,1,70,2,70,4,70,8,70,16,70,0,6,0,6,0,0, +255,255,255,255,255,255,255,255,0,15,63,239,63,239,63,239,3,239,7,239,14,239,28,239,56,239,48,239,0,15,0,15, +0,0,127,252,127,252,0,0,1,0,3,128,5,64,9,32,17,16,1,0,1,0,1,0,1,0,1,0,1,0,0,0, +255,254,255,254,255,254,255,254,3,128,7,192,15,224,31,240,59,184,51,152,3,128,3,128,3,128,3,128,3,128,3,128, +0,0,127,254,127,254,1,128,1,128,1,128,1,128,1,128,1,128,1,128,1,128,0,0,0,0,0,0,0,0,0,0, +255,255,255,255,255,255,255,255,3,192,3,192,3,192,3,192,3,192,3,192,3,192,3,192,0,0,0,0,0,0,0,0, +8,0,0,0,28,0,62,0,127,0,119,0,127,0,62,0,28,0,8,0,93,0,107,0,73,0,65,0,65,0,65,0, +28,0,28,0,62,0,127,0,255,128,255,128,255,128,127,0,62,0,93,0,255,128,255,128,255,128,235,128,235,128,227,128, +0,0,127,224,127,224,96,0,96,0,96,0,96,0,96,0,96,0,96,0,96,0,0,0,0,0,0,0,0,0,0,0, +255,240,255,240,255,240,255,240,240,0,240,0,240,0,240,0,240,0,240,0,240,0,240,0,0,0,0,0,0,0,0,0, +8,144,2,40,73,166,39,200,25,48,97,12,1,0,1,0,1,0,1,0,1,0,1,64,1,64,0,128,0,0,0,0, +23,110,223,251,191,252,127,255,255,252,255,255,243,158,3,128,3,128,3,128,3,128,3,224,3,224,3,224,3,224,1,192, +0,0,127,224,127,224,0,96,0,96,0,96,0,96,0,96,0,96,0,96,0,96,0,0,0,0,0,0,0,0,0,0, +255,240,255,240,255,240,255,240,0,240,0,240,0,240,0,240,0,240,0,240,0,240,0,240,0,0,0,0,0,0,0,0, +31,224,31,224,31,224,63,240,97,24,193,12,129,7,131,135,131,135,132,7,200,12,96,24,63,240,31,224,31,224,31,224, +63,240,63,240,63,240,127,248,255,252,255,255,255,255,255,255,255,255,255,255,255,255,255,252,127,248,63,240,63,240,63,240, +0,0,119,0,28,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,28,0,119,0,0,0, +247,128,255,128,255,128,62,0,28,0,28,0,28,0,28,0,28,0,28,0,28,0,28,0,62,0,255,128,255,128,247,128, +}; static const Uint8 cursorhot[]={ +119, +225, +74, +74, +228, +119, +30, +238, +126, +138, +136, +81, +136, +99, +121, +119, +119, +119, +119, +102, +118, +104, +224, +224, +118, +119, +136, +227, +32, +192, +1, +104, +136, +135, +17, +23, +24, +136, +26, +170, +229, +136, +65, +191, +124, +86, +88, +129, +231, +168, +136, +119, +128, +79, +116, +4, +244, +64, +71, +176, +136, +103, +162, +119, +119, +119, +17, +17, +225, +113, +129, +64, +17, +130, +161, +249, +72, +}; ADDED main.c Index: main.c ================================================================== --- /dev/null +++ main.c @@ -0,0 +1,205 @@ +#if 0 +gcc -s -O2 -o ~/bin/heromesh main.c smallxrm.o sqlite3.o `sdl-config --cflags --libs` +exit +#endif + +/* + This program is part of Free Hero Mesh and is public domain. +*/ + +#define _BSD_SOURCE +#include "SDL.h" +#include +#include +#include +#include +#include "sqlite3.h" +#include "smallxrm.h" +#include "names.h" +#include "quarks.h" +#include "cursorshapes.h" +#include "pcfont.h" + +static const char schema[]= + "PRAGMA APPLICATION_ID(1296388936);" + "PRAGMA RECURSIVE_TRIGGERS(1);" + "CREATE TABLE IF NOT EXISTS `USERCACHEINDEX`(`ID` INTEGER PRIMARY KEY, `NAME` TEXT, `LVLTIME` INT, `SOLTIME` INT, `VERSION` INT);" + "CREATE TEMPORARY TABLE `HEROMESH_PICTURES`(`ID` INTEGER PRIMARY KEY, `NAME` TEXT, `DATA` BLOB);" +; + +static sqlite3*userdb; +static SDL_Cursor*cursor[77]; +static xrm_db*resourcedb; +static SDL_Surface*screen; +static const char*basefilename; +static const char*globalclassname; +static FILE*levelfp; +static FILE*solutionfp; +static xrm_quark optionquery[16]; +static FILE*hamarc_fp; +static long hamarc_pos; +static Uint16 picture_size; +static SDL_Surface*picture_surface; + +#define fatal(...) do{ fprintf(stderr,__VA_ARGS__); exit(1); }while(0) +#define boolxrm(a,b) (*a=='1'||*a=='y'||*a=='t'||*a=='Y'||*a=='T'?1:*a=='0'||*a=='n'||*a=='f'||*a=='N'||*a=='F'?0:b) + +static void hamarc_begin(FILE*fp,const char*name) { + while(*name) fputc(*name++,fp); + fwrite("\0\0\0\0",1,5,hamarc_fp=fp); + hamarc_pos=ftell(fp); +} + +static long hamarc_end(void) { + long end=ftell(hamarc_fp); + long len=end-hamarc_pos; + fseek(hamarc_fp,hamarc_pos-4,SEEK_SET); + fputc(len>>16,hamarc_fp); + fputc(len>>24,hamarc_fp); + fputc(len>>0,hamarc_fp); + fputc(len>>8,hamarc_fp); + fseek(hamarc_fp,end,SEEK_SET); +} + +static void init_sql(void) { + char*s; + char*p; + const char*v; + int z; + sqlite3_config(SQLITE_CONFIG_URI,0); + optionquery[1]=Q_sqlMemStatus; + v=xrm_get_resource(resourcedb,optionquery,optionquery,2)?:""; + sqlite3_config(SQLITE_CONFIG_MEMSTATUS,(int)boolxrm(v,0)); + optionquery[1]=Q_sqlSmallAllocations; + v=xrm_get_resource(resourcedb,optionquery,optionquery,2)?:""; + sqlite3_config(SQLITE_CONFIG_SMALL_MALLOC,(int)boolxrm(v,0)); + optionquery[1]=Q_sqlCoveringIndexScan; + v=xrm_get_resource(resourcedb,optionquery,optionquery,2)?:""; + sqlite3_config(SQLITE_CONFIG_COVERING_INDEX_SCAN,(int)boolxrm(v,1)); + if(sqlite3_initialize()) fatal("Failure to initialize SQLite.\n"); + v=getenv("HOME")?:"."; + s=sqlite3_mprintf("%s%s.heromeshsession",v,v[strlen(v)-1]=='/'?"":"/"); + if(!s) fatal("Allocation failed\n"); + if(z=sqlite3_open(s,&userdb)) fatal("Failed to open user database %s (%s)\n",s,userdb?sqlite3_errmsg(userdb):sqlite3_errstr(z)); + sqlite3_free(s); + optionquery[1]=Q_sqlExtensions; + v=xrm_get_resource(resourcedb,optionquery,optionquery,2)?:""; + sqlite3_db_config(userdb,SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION,*v?1:0,&z); + if(*v) { + p=s=strdup(v); + if(!s) fatal("Allocation failed\n"); + while(*v) { + if(*v==' ') { + *p=0; + if(*s) { + p=0; + if(sqlite3_load_extension(userdb,s,0,&p)) fatal("Failed to load extension '%s' (%s)\n",s,p?:"unknown error"); + p=s; + } + v++; + } else { + *p++=*v++; + } + } + *p=0; + p=0; + if(*s && sqlite3_load_extension(userdb,s,0,&p)) fatal("Failed to load extension '%s' (%s)\n",s,p?:"unknown error"); + free(s); + } + if(sqlite3_exec(userdb,schema,0,0,&s)) fatal("Failed to initialize database schema (%s)\n",s?:"unknown error"); + optionquery[1]=Q_sqlInit; + v=xrm_get_resource(resourcedb,optionquery,optionquery,2); + if(v && sqlite3_exec(userdb,v,0,0,&s)) fatal("Failed to execute user-defined SQL statements (%s)\n",s?:"unknown error"); +} + +static void draw_picture(int x,int y,Uint16 img) { + // To be called only when screen is unlocked! + SDL_Rect src={(img&15)*picture_size,(img>>4)*picture_size,picture_size,picture_size}; + SDL_Rect dst={x,y,picture_size,picture_size}; + SDL_BlitSurface(picture_surface,&src,screen,&dst); +} + +static void draw_text(int x,int y,const unsigned char*t,int bg,int fg) { + // To be called only when screen is locked! + int len=strlen(t); + Uint8*pix=screen->pixels; + Uint8*p; + Uint16 pitch=screen->pitch; + int xx,yy; + const unsigned char*f; + if(x+8*len>screen->w) len=(screen->w-x)>>3; + if(len<=0 || y+8>screen->h) return; + pix+=y*pitch+x; + while(*t) { + f=fontdata+(*t<<3); + for(yy=0;yy<8;yy++) { + for(xx=0;xx<8;xx++) p[xx]=(*f<>=1; + if(!cursor[id]) cursor[id]=SDL_CreateCursor((void*)cursorimg+(id<<6),(void*)cursorimg+(id<<6)+32,16,16,cursorhot[id]>>4,cursorhot[id]&15); + SDL_SetCursor(cursor[id]); +} + +static void load_options(void) { + const char*home=getenv("HOME")?:"."; + char*nam=malloc(strlen(home)+16); + FILE*fp; + sprintf(nam,"%s%s.heromeshrc",home,home[strlen(home)-1]=='/'?"":"/"); + fp=fopen(nam,"r"); + if(!fp) fatal("Failed to open %s (%m)\n",nam); + free(nam); + if(xrm_load(resourcedb,fp,1)) fatal("Error while loading .heromeshrc\n"); + fclose(fp); +} + +static void read_options(int argc,char**argv) { + xrm_db*db=xrm_sub(resourcedb,0,xrm_make_quark(globalclassname,0)?:xrm_anyq); + while(argc--) xrm_load_line(db,*argv++,1); +} + +int main(int argc,char**argv) { + if(argc<2) fatal("usage: %s basename [options...]\n",argc?argv[0]:"heromesh"); + if(xrm_init(realloc)) fatal("Failed to initialize resource manager\n"); + if(xrm_init_quarks(global_quarks)) fatal("Failed to initialize resource manager\n"); + resourcedb=xrm_create(); + if(!resourcedb) fatal("Allocation of resource database failed\n"); + basefilename=argv[1]; + globalclassname=basefilename; //TODO: Fix this + load_options(); + if(argc>2) read_options(argc-2,argv+2); + *optionquery=xrm_make_quark(globalclassname,0)?:xrm_anyq; + init_sql(); + + set_cursor(XC_arrow); + + atexit(SDL_Quit); + + return 0; +} ADDED pcfont.h Index: pcfont.h ================================================================== --- /dev/null +++ pcfont.h @@ -0,0 +1,160 @@ +static const unsigned char fontdata[2048]={ +0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7e, 0x81, 0xa5, 0x81, 0xbd, 0x99, +0x81, 0x7e, 0x7e, 0xff, 0xdb, 0xff, 0xc3, 0xe7, 0xff, 0x7e, 0x6c, 0xfe, +0xfe, 0xfe, 0x7c, 0x38, 0x10, 0x0, 0x10, 0x38, 0x7c, 0xfe, 0x7c, 0x38, +0x10, 0x0, 0x38, 0x7c, 0x38, 0xfe, 0xfe, 0x7c, 0x38, 0x7c, 0x10, 0x10, +0x38, 0x7c, 0xfe, 0x7c, 0x38, 0x7c, 0x0, 0x0, 0x18, 0x3c, 0x3c, 0x18, 0x0, +0x0, 0xff, 0xff, 0xe7, 0xc3, 0xc3, 0xe7, 0xff, 0xff, 0x0, 0x3c, 0x66, 0x42, +0x42, 0x66, 0x3c, 0x0, 0xff, 0xc3, 0x99, 0xbd, 0xbd, 0x99, 0xc3, 0xff, 0xf, +0x7, 0xf, 0x7d, 0xcc, 0xcc, 0xcc, 0x78, 0x3c, 0x66, 0x66, 0x66, 0x3c, 0x18, +0x7e, 0x18, 0x3f, 0x33, 0x3f, 0x30, 0x30, 0x70, 0xf0, 0xe0, 0x7f, 0x63, +0x7f, 0x63, 0x63, 0x67, 0xe6,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f8, 0x18, 0x18, +0x18, 0x36, 0x36, 0x36, 0x36, 0xf6, 0x36, 0x36, 0x36, 0x0, 0x0, 0x0, 0x0, +0xfe, 0x36, 0x36, 0x36, 0x0, 0x0, 0xf8, 0x18, 0xf8, 0x18, 0x18, 0x18, 0x36, +0x36, 0xf6, 0x6, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, +0x36, 0x36, 0x36, 0x0, 0x0, 0xfe, 0x6, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, +0xf6, 0x6, 0xfe, 0x0, 0x0, 0x0, 0x36, 0x36, 0x36, 0x36, 0xfe, 0x0, 0x0, +0x0, 0x18, 0x18, 0xf8, 0x18, 0xf8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf8, +0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x0, 0x0, 0x0, 0x18, 0x18, +0x18, 0x18, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0x18, 0x18, +0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x0, 0x0, 0x0, 0x0, +0xff, 0x0, 0x0, 0x0, 0x18, 0x18, 0x18, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, +0x18, 0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36, 0x37, +0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x3f, 0x0, 0x0, 0x0, 0x0, 0x0, +0x3f, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf7, 0x0, 0xff, 0x0, 0x0, +0x0, 0x0, 0x0, 0xff, 0x0, 0xf7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, +0x37, 0x36, 0x36, 0x36, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0x0, 0x0, 0x36, +0x36, 0xf7, 0x0, 0x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, 0x0, 0x0, +0x0, 0x0, 0x0, 0x0, 0x0, 0x0, }; ADDED quarks Index: quarks ================================================================== --- /dev/null +++ quarks @@ -0,0 +1,208 @@ +! Resource names for Free Hero Mesh. +! This file is public domain. +! Each line contains one name, is blank, or starts with ! for a comment. + +! Graphics/screen +screenWidth +screenHeight +palette +popupColors +imageSize +altImage +editTitle +gameTitle +gamma +screenFlags +! SDL flags: +! '-' = no flags +! 'd' = DOUBLEBUF +! 'f' = FULLSCREEN +! 'h' = HWSURFACE +! 'n' = NOFRAME +! 'p' = HWPALETTE +! 'r' = RESIZABLE +! 'y' = ASYNCBLIT +! 'z' = NOPARACHUTE + +! Audio +sfxVolume +audioBuffer +audioRate +audioFormat +musicVolume +musicFile + +! Keyboard +keyRepeat +editKey +gameKey + +! Key codes +backspace +tab +clear +return +pause +escape +space +exclaim +quotedbl +hash +dollar +ampersand +quote +leftparen +rightparen +asterisk +plus +comma +minus +period +slash +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +colon +semicolon +less +equals +greater +question +at +leftbracket +rightbracket +caret +underscore +backquote +A +B +C +D +E +F +G +H +I +J +K +L +M +N +O +P +Q +R +S +T +U +V +W +X +Y +Z +delete +kp0 +kp1 +kp2 +kp3 +kp4 +kp5 +kp6 +kp7 +kp8 +kp9 +kp_period +kp_divide +kp_multiply +kp_minus +kp_plus +kp_enter +kp_equals +up +down +right +left +insert +home +end +pageup +pagedown +f1 +f2 +f3 +f4 +f5 +f6 +f7 +f8 +f9 +f10 +f11 +f12 +f13 +f14 +f15 +numlock +capslock +scrollock +rshift +lshift +rctrl +lctrl +ralt +lalt +rmeta +lmeta +lsuper +rsuper +mode +help +print +sysreq +break +menu +power +euro + +! Key modifiers +shift +ctrl +alt +meta +numLock + +! Mouse +editClick +gameClick +allowMouseWarp +middle +! (left and right are listed with keys) +! (the key modifiers are also valid here) + +! Class +class +quiz + +! Solutions +saveSolutions +solutionComment +solutionTimestamp + +! SQL settings +sqlInit +sqlExtensions +sqlMemStatus +sqlSmallAllocations +sqlCoveringIndexScan +sqlPowerSafe + +! Miscellaneous +followSymlinkNames + ADDED quarks.h Index: quarks.h ================================================================== --- /dev/null +++ quarks.h @@ -0,0 +1,344 @@ +#define Q_screenWidth 2 +#define Q_screenHeight 3 +#define Q_palette 4 +#define Q_popupColors 5 +#define Q_imageSize 6 +#define Q_altImage 7 +#define Q_editTitle 8 +#define Q_gameTitle 9 +#define Q_gamma 10 +#define Q_screenFlags 11 +#define Q_sfxVolume 12 +#define Q_audioBuffer 13 +#define Q_audioRate 14 +#define Q_audioFormat 15 +#define Q_musicVolume 16 +#define Q_musicFile 17 +#define Q_keyRepeat 18 +#define Q_editKey 19 +#define Q_gameKey 20 +#define Q_backspace 21 +#define Q_tab 22 +#define Q_clear 23 +#define Q_return 24 +#define Q_pause 25 +#define Q_escape 26 +#define Q_space 27 +#define Q_exclaim 28 +#define Q_quotedbl 29 +#define Q_hash 30 +#define Q_dollar 31 +#define Q_ampersand 32 +#define Q_quote 33 +#define Q_leftparen 34 +#define Q_rightparen 35 +#define Q_asterisk 36 +#define Q_plus 37 +#define Q_comma 38 +#define Q_minus 39 +#define Q_period 40 +#define Q_slash 41 +#define Q_0 42 +#define Q_1 43 +#define Q_2 44 +#define Q_3 45 +#define Q_4 46 +#define Q_5 47 +#define Q_6 48 +#define Q_7 49 +#define Q_8 50 +#define Q_9 51 +#define Q_colon 52 +#define Q_semicolon 53 +#define Q_less 54 +#define Q_equals 55 +#define Q_greater 56 +#define Q_question 57 +#define Q_at 58 +#define Q_leftbracket 59 +#define Q_rightbracket 60 +#define Q_caret 61 +#define Q_underscore 62 +#define Q_backquote 63 +#define Q_A 64 +#define Q_B 65 +#define Q_C 66 +#define Q_D 67 +#define Q_E 68 +#define Q_F 69 +#define Q_G 70 +#define Q_H 71 +#define Q_I 72 +#define Q_J 73 +#define Q_K 74 +#define Q_L 75 +#define Q_M 76 +#define Q_N 77 +#define Q_O 78 +#define Q_P 79 +#define Q_Q 80 +#define Q_R 81 +#define Q_S 82 +#define Q_T 83 +#define Q_U 84 +#define Q_V 85 +#define Q_W 86 +#define Q_X 87 +#define Q_Y 88 +#define Q_Z 89 +#define Q_delete 90 +#define Q_kp0 91 +#define Q_kp1 92 +#define Q_kp2 93 +#define Q_kp3 94 +#define Q_kp4 95 +#define Q_kp5 96 +#define Q_kp6 97 +#define Q_kp7 98 +#define Q_kp8 99 +#define Q_kp9 100 +#define Q_kp_period 101 +#define Q_kp_divide 102 +#define Q_kp_multiply 103 +#define Q_kp_minus 104 +#define Q_kp_plus 105 +#define Q_kp_enter 106 +#define Q_kp_equals 107 +#define Q_up 108 +#define Q_down 109 +#define Q_right 110 +#define Q_left 111 +#define Q_insert 112 +#define Q_home 113 +#define Q_end 114 +#define Q_pageup 115 +#define Q_pagedown 116 +#define Q_f1 117 +#define Q_f2 118 +#define Q_f3 119 +#define Q_f4 120 +#define Q_f5 121 +#define Q_f6 122 +#define Q_f7 123 +#define Q_f8 124 +#define Q_f9 125 +#define Q_f10 126 +#define Q_f11 127 +#define Q_f12 128 +#define Q_f13 129 +#define Q_f14 130 +#define Q_f15 131 +#define Q_numlock 132 +#define Q_capslock 133 +#define Q_scrollock 134 +#define Q_rshift 135 +#define Q_lshift 136 +#define Q_rctrl 137 +#define Q_lctrl 138 +#define Q_ralt 139 +#define Q_lalt 140 +#define Q_rmeta 141 +#define Q_lmeta 142 +#define Q_lsuper 143 +#define Q_rsuper 144 +#define Q_mode 145 +#define Q_help 146 +#define Q_print 147 +#define Q_sysreq 148 +#define Q_break 149 +#define Q_menu 150 +#define Q_power 151 +#define Q_euro 152 +#define Q_shift 153 +#define Q_ctrl 154 +#define Q_alt 155 +#define Q_meta 156 +#define Q_numLock 157 +#define Q_editClick 158 +#define Q_gameClick 159 +#define Q_allowMouseWarp 160 +#define Q_middle 161 +#define Q_class 162 +#define Q_quiz 163 +#define Q_saveSolutions 164 +#define Q_solutionComment 165 +#define Q_solutionTimestamp 166 +#define Q_sqlInit 167 +#define Q_sqlExtensions 168 +#define Q_sqlMemStatus 169 +#define Q_sqlSmallAllocations 170 +#define Q_sqlCoveringIndexScan 171 +#define Q_followSymlinkNames 172 +static const char*const global_quarks[]={ + "screenWidth", + "screenHeight", + "palette", + "popupColors", + "imageSize", + "altImage", + "editTitle", + "gameTitle", + "gamma", + "screenFlags", + "sfxVolume", + "audioBuffer", + "audioRate", + "audioFormat", + "musicVolume", + "musicFile", + "keyRepeat", + "editKey", + "gameKey", + "backspace", + "tab", + "clear", + "return", + "pause", + "escape", + "space", + "exclaim", + "quotedbl", + "hash", + "dollar", + "ampersand", + "quote", + "leftparen", + "rightparen", + "asterisk", + "plus", + "comma", + "minus", + "period", + "slash", + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "colon", + "semicolon", + "less", + "equals", + "greater", + "question", + "at", + "leftbracket", + "rightbracket", + "caret", + "underscore", + "backquote", + "A", + "B", + "C", + "D", + "E", + "F", + "G", + "H", + "I", + "J", + "K", + "L", + "M", + "N", + "O", + "P", + "Q", + "R", + "S", + "T", + "U", + "V", + "W", + "X", + "Y", + "Z", + "delete", + "kp0", + "kp1", + "kp2", + "kp3", + "kp4", + "kp5", + "kp6", + "kp7", + "kp8", + "kp9", + "kp_period", + "kp_divide", + "kp_multiply", + "kp_minus", + "kp_plus", + "kp_enter", + "kp_equals", + "up", + "down", + "right", + "left", + "insert", + "home", + "end", + "pageup", + "pagedown", + "f1", + "f2", + "f3", + "f4", + "f5", + "f6", + "f7", + "f8", + "f9", + "f10", + "f11", + "f12", + "f13", + "f14", + "f15", + "numlock", + "capslock", + "scrollock", + "rshift", + "lshift", + "rctrl", + "lctrl", + "ralt", + "lalt", + "rmeta", + "lmeta", + "lsuper", + "rsuper", + "mode", + "help", + "print", + "sysreq", + "break", + "menu", + "power", + "euro", + "shift", + "ctrl", + "alt", + "meta", + "numLock", + "editClick", + "gameClick", + "allowMouseWarp", + "middle", + "class", + "quiz", + "saveSolutions", + "solutionComment", + "solutionTimestamp", + "sqlInit", + "sqlExtensions", + "sqlMemStatus", + "sqlSmallAllocations", + "sqlCoveringIndexScan", + "followSymlinkNames", +0}; ADDED quarks.js Index: quarks.js ================================================================== --- /dev/null +++ quarks.js @@ -0,0 +1,7 @@ +"use strict"; +const fs=require("fs"); +const quarks=fs.readFileSync("quarks","ascii").split("\n").map(x=>x.trim()).filter(x=>x&&x[0]!="!"); +quarks.forEach((x,y)=>console.log("#define Q_"+x+" "+(y+2))); +console.log("static const char*const global_quarks[]={"); +quarks.forEach(x=>console.log(" \""+x+"\",")); +console.log("0};");