diff --git a/src/ui.c b/src/ui.c index 63e2b10..4f619aa 100644 --- a/src/ui.c +++ b/src/ui.c @@ -467,6 +467,1596 @@ color_t colors_gx[ NB_COLORS ] = { }, }; +button_t buttons_sx[ NB_KEYS ] = { + {.name = "A", + .x = 0, + .y = 0, + .w = 36, + .h = 23, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = menu_label_width, + .lh = menu_label_height, + .lb = menu_label_bitmap, + .letter = "A", + .left = 0, + .is_menu = 0, + .right = 0, + .sub = 0 }, + {.name = "B", + .x = 50, + .y = 0, + .w = 36, + .h = 23, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = menu_label_width, + .lh = menu_label_height, + .lb = menu_label_bitmap, + .letter = "B", + .left = 0, + .is_menu = 0, + .right = 0, + .sub = 0 }, + {.name = "C", + .x = 100, + .y = 0, + .w = 36, + .h = 23, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = menu_label_width, + .lh = menu_label_height, + .lb = menu_label_bitmap, + .letter = "C", + .left = 0, + .is_menu = 0, + .right = 0, + .sub = 0 }, + {.name = "D", + .x = 150, + .y = 0, + .w = 36, + .h = 23, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = menu_label_width, + .lh = menu_label_height, + .lb = menu_label_bitmap, + .letter = "D", + .left = 0, + .is_menu = 0, + .right = 0, + .sub = 0 }, + {.name = "E", + .x = 200, + .y = 0, + .w = 36, + .h = 23, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = menu_label_width, + .lh = menu_label_height, + .lb = menu_label_bitmap, + .letter = "E", + .left = 0, + .is_menu = 0, + .right = 0, + .sub = 0 }, + {.name = "F", + .x = 250, + .y = 0, + .w = 36, + .h = 23, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = menu_label_width, + .lh = menu_label_height, + .lb = menu_label_bitmap, + .letter = "F", + .left = 0, + .is_menu = 0, + .right = 0, + .sub = 0 }, + + {.name = "MTH", + .x = 0, + .y = 50, + .w = 36, + .h = 26, + .lc = WHITE, + .label = "MTH", + .font_size = 0, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = "G", + .left = "PRINT", + .is_menu = 1, + .right = 0, + .sub = 0 }, + {.name = "PRG", + .x = 50, + .y = 50, + .w = 36, + .h = 26, + .lc = WHITE, + .label = "PRG", + .font_size = 0, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = "H", + .left = "I/O", + .is_menu = 1, + .right = 0, + .sub = 0 }, + {.name = "CST", + .x = 100, + .y = 50, + .w = 36, + .h = 26, + .lc = WHITE, + .label = "CST", + .font_size = 0, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = "I", + .left = "MODES", + .is_menu = 1, + .right = 0, + .sub = 0 }, + {.name = "VAR", + .x = 150, + .y = 50, + .w = 36, + .h = 26, + .lc = WHITE, + .label = "VAR", + .font_size = 0, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = "J", + .left = "MEMORY", + .is_menu = 1, + .right = 0, + .sub = 0 }, + {.name = "UP", + .x = 200, + .y = 50, + .w = 36, + .h = 26, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = up_width, + .lh = up_height, + .lb = up_bitmap, + .letter = "K", + .left = "LIBRARY", + .is_menu = 1, + .right = 0, + .sub = 0 }, + {.name = "NXT", + .x = 250, + .y = 50, + .w = 36, + .h = 26, + .lc = WHITE, + .label = "NXT", + .font_size = 0, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = "L", + .left = "PREV", + .is_menu = 0, + .right = 0, + .sub = 0 }, + + {.name = "COLON", + .x = 0, + .y = 100, + .w = 36, + .h = 26, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = colon_width, + .lh = colon_height, + .lb = colon_bitmap, + .letter = "M", + .left = "UP", + .is_menu = 0, + .right = "HOME", + .sub = 0 }, + {.name = "STO", + .x = 50, + .y = 100, + .w = 36, + .h = 26, + .lc = WHITE, + .label = "STO", + .font_size = 0, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = "N", + .left = "DEF", + .is_menu = 0, + .right = "RCL", + .sub = 0 }, + {.name = "EVAL", + .x = 100, + .y = 100, + .w = 36, + .h = 26, + .lc = WHITE, + .label = "EVAL", + .font_size = 0, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = "O", + .left = "aQ", + .is_menu = 0, + .right = "aNUM", + .sub = 0 }, + {.name = "LEFT", + .x = 150, + .y = 100, + .w = 36, + .h = 26, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = left_width, + .lh = left_height, + .lb = left_bitmap, + .letter = "P", + .left = "GRAPH", + .is_menu = 0, + .right = 0, + .sub = 0 }, + {.name = "DOWN", + .x = 200, + .y = 100, + .w = 36, + .h = 26, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = down_width, + .lh = down_height, + .lb = down_bitmap, + .letter = "Q", + .left = "REVIEW", + .is_menu = 0, + .right = 0, + .sub = 0 }, + {.name = "RIGHT", + .x = 250, + .y = 100, + .w = 36, + .h = 26, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = right_width, + .lh = right_height, + .lb = right_bitmap, + .letter = "R", + .left = "SWAP", + .is_menu = 0, + .right = 0, + .sub = 0 }, + + {.name = "SIN", + .x = 0, + .y = 150, + .w = 36, + .h = 26, + .lc = WHITE, + .label = "SIN", + .font_size = 0, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = "S", + .left = "ASIN", + .is_menu = 0, + .right = "b", + .sub = 0 }, + {.name = "COS", + .x = 50, + .y = 150, + .w = 36, + .h = 26, + .lc = WHITE, + .label = "COS", + .font_size = 0, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = "T", + .left = "ACOS", + .is_menu = 0, + .right = "c", + .sub = 0 }, + {.name = "TAN", + .x = 100, + .y = 150, + .w = 36, + .h = 26, + .lc = WHITE, + .label = "TAN", + .font_size = 0, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = "U", + .left = "ATAN", + .is_menu = 0, + .right = "d", + .sub = 0 }, + {.name = "SQRT", + .x = 150, + .y = 150, + .w = 36, + .h = 26, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = sqrt_width, + .lh = sqrt_height, + .lb = sqrt_bitmap, + .letter = "V", + .left = "e", + .is_menu = 0, + .right = "f", + .sub = 0 }, + {.name = "POWER", + .x = 200, + .y = 150, + .w = 36, + .h = 26, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = power_width, + .lh = power_height, + .lb = power_bitmap, + .letter = "W", + .left = "g", + .is_menu = 0, + .right = "LOG", + .sub = 0 }, + {.name = "INV", + .x = 250, + .y = 150, + .w = 36, + .h = 26, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = inv_width, + .lh = inv_height, + .lb = inv_bitmap, + .letter = "X", + .left = "h", + .is_menu = 0, + .right = "LN", + .sub = 0 }, + + {.name = "ENTER", + .x = 0, + .y = 200, + .w = 86, + .h = 26, + .lc = WHITE, + .label = "ENTER", + .font_size = 2, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = 0, + .left = "EQUATION", + .is_menu = 0, + .right = "MATRIX", + .sub = 0 }, + {.name = "NEG", + .x = 100, + .y = 200, + .w = 36, + .h = 26, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = neg_width, + .lh = neg_height, + .lb = neg_bitmap, + .letter = "Y", + .left = "EDIT", + .is_menu = 0, + .right = "VISIT", + .sub = 0 }, + {.name = "EEX", + .x = 150, + .y = 200, + .w = 36, + .h = 26, + .lc = WHITE, + .label = "EEX", + .font_size = 0, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = "Z", + .left = "2D", + .is_menu = 0, + .right = "3D", + .sub = 0 }, + {.name = "DEL", + .x = 200, + .y = 200, + .w = 36, + .h = 26, + .lc = WHITE, + .label = "DEL", + .font_size = 0, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = 0, + .left = "PURGE", + .is_menu = 0, + .right = 0, + .sub = 0 }, + {.name = "BS", + .x = 250, + .y = 200, + .w = 36, + .h = 26, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = bs_width, + .lh = bs_height, + .lb = bs_bitmap, + .letter = 0, + .left = "DROP", + .is_menu = 0, + .right = "CLR", + .sub = 0 }, + + {.name = "ALPHA", + .x = 0, + .y = 250, + .w = 36, + .h = 26, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = alpha_width, + .lh = alpha_height, + .lb = alpha_bitmap, + .letter = 0, + .left = "USR", + .is_menu = 0, + .right = "ENTRY", + .sub = 0 }, + {.name = "7", + .x = 60, + .y = 250, + .w = 46, + .h = 26, + .lc = WHITE, + .label = "7", + .font_size = 1, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = 0, + .left = "SOLVE", + .is_menu = 1, + .right = 0, + .sub = 0 }, + {.name = "8", + .x = 120, + .y = 250, + .w = 46, + .h = 26, + .lc = WHITE, + .label = "8", + .font_size = 1, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = 0, + .left = "PLOT", + .is_menu = 1, + .right = 0, + .sub = 0 }, + {.name = "9", + .x = 180, + .y = 250, + .w = 46, + .h = 26, + .lc = WHITE, + .label = "9", + .font_size = 1, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = 0, + .left = "ALGEBRA", + .is_menu = 1, + .right = 0, + .sub = 0 }, + {.name = "DIV", + .x = 240, + .y = 250, + .w = 46, + .h = 26, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = div_width, + .lh = div_height, + .lb = div_bitmap, + .letter = 0, + .left = "( )", + .is_menu = 0, + .right = "#", + .sub = 0 }, + + {.name = "SHL", + .x = 0, + .y = 300, + .w = 36, + .h = 26, + .lc = LEFT, + .label = 0, + .font_size = 0, + .lw = shl_width, + .lh = shl_height, + .lb = shl_bitmap, + .letter = 0, + .left = 0, + .is_menu = 0, + .right = 0, + .sub = 0 }, + {.name = "4", + .x = 60, + .y = 300, + .w = 46, + .h = 26, + .lc = WHITE, + .label = "4", + .font_size = 1, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = 0, + .left = "TIME", + .is_menu = 1, + .right = 0, + .sub = 0 }, + {.name = "5", + .x = 120, + .y = 300, + .w = 46, + .h = 26, + .lc = WHITE, + .label = "5", + .font_size = 1, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = 0, + .left = "STAT", + .is_menu = 1, + .right = 0, + .sub = 0 }, + {.name = "6", + .x = 180, + .y = 300, + .w = 46, + .h = 26, + .lc = WHITE, + .label = "6", + .font_size = 1, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = 0, + .left = "UNITS", + .is_menu = 1, + .right = 0, + .sub = 0 }, + {.name = "MUL", + .x = 240, + .y = 300, + .w = 46, + .h = 26, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = mul_width, + .lh = mul_height, + .lb = mul_bitmap, + .letter = 0, + .left = "[ ]", + .is_menu = 0, + .right = "_", + .sub = 0 }, + + {.name = "SHR", + .x = 0, + .y = 350, + .w = 36, + .h = 26, + .lc = RIGHT, + .label = 0, + .font_size = 0, + .lw = shr_width, + .lh = shr_height, + .lb = shr_bitmap, + .letter = 0, + .left = 0, + .is_menu = 0, + .right = 0, + .sub = 0 }, + {.name = "1", + .x = 60, + .y = 350, + .w = 46, + .h = 26, + .lc = WHITE, + .label = "1", + .font_size = 1, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = 0, + .left = "RAD", + .is_menu = 0, + .right = "POLAR", + .sub = 0 }, + {.name = "2", + .x = 120, + .y = 350, + .w = 46, + .h = 26, + .lc = WHITE, + .label = "2", + .font_size = 1, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = 0, + .left = "STACK", + .is_menu = 0, + .right = "ARG", + .sub = 0 }, + {.name = "3", + .x = 180, + .y = 350, + .w = 46, + .h = 26, + .lc = WHITE, + .label = "3", + .font_size = 1, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = 0, + .left = "CMD", + .is_menu = 0, + .right = "MENU", + .sub = 0 }, + {.name = "MINUS", + .x = 240, + .y = 350, + .w = 46, + .h = 26, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = minus_width, + .lh = minus_height, + .lb = minus_bitmap, + .letter = 0, + .left = "i", + .is_menu = 0, + .right = "j", + .sub = 0 }, + + {.name = "ON", + .x = 0, + .y = 400, + .w = 36, + .h = 26, + .lc = WHITE, + .label = "ON", + .font_size = 0, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = 0, + .left = "CONT", + .is_menu = 0, + .right = "OFF", + .sub = "ATTN"}, + {.name = "0", + .x = 60, + .y = 400, + .w = 46, + .h = 26, + .lc = WHITE, + .label = "0", + .font_size = 1, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = 0, + .left = "= ", + .is_menu = 0, + .right = " a", + .sub = 0 }, + {.name = "PERIOD", + .x = 120, + .y = 400, + .w = 46, + .h = 26, + .lc = WHITE, + .label = ".", + .font_size = 1, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = 0, + .left = ",", + .is_menu = 0, + .right = " k", + .sub = 0 }, + {.name = "SPC", + .x = 180, + .y = 400, + .w = 46, + .h = 26, + .lc = WHITE, + .label = "SPC", + .font_size = 0, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = 0, + .left = "l ", + .is_menu = 0, + .right = " m", + .sub = 0 }, + {.name = "PLUS", + .x = 240, + .y = 400, + .w = 46, + .h = 26, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = plus_width, + .lh = plus_height, + .lb = plus_bitmap, + .letter = 0, + .left = "{ }", + .is_menu = 0, + .right = ": :", + .sub = 0 }, +}; + +button_t buttons_gx[ NB_KEYS ] = { + {.name = "A", + .x = 0, + .y = 0, + .w = 36, + .h = 23, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = menu_label_width, + .lh = menu_label_height, + .lb = menu_label_bitmap, + .letter = "A", + .left = 0, + .is_menu = 0, + .right = 0, + .sub = 0 }, + {.name = "B", + .x = 50, + .y = 0, + .w = 36, + .h = 23, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = menu_label_width, + .lh = menu_label_height, + .lb = menu_label_bitmap, + .letter = "B", + .left = 0, + .is_menu = 0, + .right = 0, + .sub = 0 }, + {.name = "C", + .x = 100, + .y = 0, + .w = 36, + .h = 23, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = menu_label_width, + .lh = menu_label_height, + .lb = menu_label_bitmap, + .letter = "C", + .left = 0, + .is_menu = 0, + .right = 0, + .sub = 0 }, + {.name = "D", + .x = 150, + .y = 0, + .w = 36, + .h = 23, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = menu_label_width, + .lh = menu_label_height, + .lb = menu_label_bitmap, + .letter = "D", + .left = 0, + .is_menu = 0, + .right = 0, + .sub = 0 }, + {.name = "E", + .x = 200, + .y = 0, + .w = 36, + .h = 23, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = menu_label_width, + .lh = menu_label_height, + .lb = menu_label_bitmap, + .letter = "E", + .left = 0, + .is_menu = 0, + .right = 0, + .sub = 0 }, + {.name = "F", + .x = 250, + .y = 0, + .w = 36, + .h = 23, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = menu_label_width, + .lh = menu_label_height, + .lb = menu_label_bitmap, + .letter = "F", + .left = 0, + .is_menu = 0, + .right = 0, + .sub = 0 }, + + {.name = "MTH", + .x = 0, + .y = 50, + .w = 36, + .h = 26, + .lc = WHITE, + .label = "MTH", + .font_size = 0, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = "G", + .left = "RAD", + .is_menu = 0, + .right = "POLAR", + .sub = 0 }, + {.name = "PRG", + .x = 50, + .y = 50, + .w = 36, + .h = 26, + .lc = WHITE, + .label = "PRG", + .font_size = 0, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = "H", + .left = 0, + .is_menu = 0, + .right = "CHARS", + .sub = 0 }, + {.name = "CST", + .x = 100, + .y = 50, + .w = 36, + .h = 26, + .lc = WHITE, + .label = "CST", + .font_size = 0, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = "I", + .left = 0, + .is_menu = 0, + .right = "MODES", + .sub = 0 }, + {.name = "VAR", + .x = 150, + .y = 50, + .w = 36, + .h = 26, + .lc = WHITE, + .label = "VAR", + .font_size = 0, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = "J", + .left = 0, + .is_menu = 0, + .right = "MEMORY", + .sub = 0 }, + {.name = "UP", + .x = 200, + .y = 50, + .w = 36, + .h = 26, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = up_width, + .lh = up_height, + .lb = up_bitmap, + .letter = "K", + .left = 0, + .is_menu = 0, + .right = "STACK", + .sub = 0 }, + {.name = "NXT", + .x = 250, + .y = 50, + .w = 36, + .h = 26, + .lc = WHITE, + .label = "NXT", + .font_size = 0, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = "L", + .left = "PREV", + .is_menu = 0, + .right = "MENU", + .sub = 0 }, + + {.name = "COLON", + .x = 0, + .y = 100, + .w = 36, + .h = 26, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = colon_width, + .lh = colon_height, + .lb = colon_bitmap, + .letter = "M", + .left = "UP", + .is_menu = 0, + .right = "HOME", + .sub = 0 }, + {.name = "STO", + .x = 50, + .y = 100, + .w = 36, + .h = 26, + .lc = WHITE, + .label = "STO", + .font_size = 0, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = "N", + .left = "DEF", + .is_menu = 0, + .right = "RCL", + .sub = 0 }, + {.name = "EVAL", + .x = 100, + .y = 100, + .w = 36, + .h = 26, + .lc = WHITE, + .label = "EVAL", + .font_size = 0, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = "O", + .left = "aNUM", + .is_menu = 0, + .right = "UNDO", + .sub = 0 }, + {.name = "LEFT", + .x = 150, + .y = 100, + .w = 36, + .h = 26, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = left_width, + .lh = left_height, + .lb = left_bitmap, + .letter = "P", + .left = "PICTURE", + .is_menu = 0, + .right = 0, + .sub = 0 }, + {.name = "DOWN", + .x = 200, + .y = 100, + .w = 36, + .h = 26, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = down_width, + .lh = down_height, + .lb = down_bitmap, + .letter = "Q", + .left = "VIEW", + .is_menu = 0, + .right = 0, + .sub = 0 }, + {.name = "RIGHT", + .x = 250, + .y = 100, + .w = 36, + .h = 26, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = right_width, + .lh = right_height, + .lb = right_bitmap, + .letter = "R", + .left = "SWAP", + .is_menu = 0, + .right = 0, + .sub = 0 }, + + {.name = "SIN", + .x = 0, + .y = 150, + .w = 36, + .h = 26, + .lc = WHITE, + .label = "SIN", + .font_size = 0, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = "S", + .left = "ASIN", + .is_menu = 0, + .right = "b", + .sub = 0 }, + {.name = "COS", + .x = 50, + .y = 150, + .w = 36, + .h = 26, + .lc = WHITE, + .label = "COS", + .font_size = 0, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = "T", + .left = "ACOS", + .is_menu = 0, + .right = "c", + .sub = 0 }, + {.name = "TAN", + .x = 100, + .y = 150, + .w = 36, + .h = 26, + .lc = WHITE, + .label = "TAN", + .font_size = 0, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = "U", + .left = "ATAN", + .is_menu = 0, + .right = "d", + .sub = 0 }, + {.name = "SQRT", + .x = 150, + .y = 150, + .w = 36, + .h = 26, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = sqrt_width, + .lh = sqrt_height, + .lb = sqrt_bitmap, + .letter = "V", + .left = "n", + .is_menu = 0, + .right = "o", + .sub = 0 }, + {.name = "POWER", + .x = 200, + .y = 150, + .w = 36, + .h = 26, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = power_width, + .lh = power_height, + .lb = power_bitmap, + .letter = "W", + .left = "p", + .is_menu = 0, + .right = "LOG", + .sub = 0 }, + {.name = "INV", + .x = 250, + .y = 150, + .w = 36, + .h = 26, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = inv_width, + .lh = inv_height, + .lb = inv_bitmap, + .letter = "X", + .left = "q", + .is_menu = 0, + .right = "LN", + .sub = 0 }, + + {.name = "ENTER", + .x = 0, + .y = 200, + .w = 86, + .h = 26, + .lc = WHITE, + .label = "ENTER", + .font_size = 2, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = 0, + .left = "EQUATION", + .is_menu = 0, + .right = "MATRIX", + .sub = 0 }, + {.name = "NEG", + .x = 100, + .y = 200, + .w = 36, + .h = 26, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = neg_width, + .lh = neg_height, + .lb = neg_bitmap, + .letter = "Y", + .left = "EDIT", + .is_menu = 0, + .right = "CMD", + .sub = 0 }, + {.name = "EEX", + .x = 150, + .y = 200, + .w = 36, + .h = 26, + .lc = WHITE, + .label = "EEX", + .font_size = 0, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = "Z", + .left = "PURG", + .is_menu = 0, + .right = "ARG", + .sub = 0 }, + {.name = "DEL", + .x = 200, + .y = 200, + .w = 36, + .h = 26, + .lc = WHITE, + .label = "DEL", + .font_size = 0, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = 0, + .left = "CLEAR", + .is_menu = 0, + .right = 0, + .sub = 0 }, + {.name = "BS", + .x = 250, + .y = 200, + .w = 36, + .h = 26, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = bs_width, + .lh = bs_height, + .lb = bs_bitmap, + .letter = 0, + .left = "DROP", + .is_menu = 0, + .right = 0, + .sub = 0 }, + + {.name = "ALPHA", + .x = 0, + .y = 250, + .w = 36, + .h = 26, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = alpha_width, + .lh = alpha_height, + .lb = alpha_bitmap, + .letter = 0, + .left = "USER", + .is_menu = 0, + .right = "ENTRY", + .sub = 0 }, + {.name = "7", + .x = 60, + .y = 250, + .w = 46, + .h = 26, + .lc = WHITE, + .label = "7", + .font_size = 1, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = 0, + .left = 0, + .is_menu = 1, + .right = "SOLVE", + .sub = 0 }, + {.name = "8", + .x = 120, + .y = 250, + .w = 46, + .h = 26, + .lc = WHITE, + .label = "8", + .font_size = 1, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = 0, + .left = 0, + .is_menu = 1, + .right = "PLOT", + .sub = 0 }, + {.name = "9", + .x = 180, + .y = 250, + .w = 46, + .h = 26, + .lc = WHITE, + .label = "9", + .font_size = 1, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = 0, + .left = 0, + .is_menu = 1, + .right = "SYMBOLIC", + .sub = 0 }, + {.name = "DIV", + .x = 240, + .y = 250, + .w = 46, + .h = 26, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = div_width, + .lh = div_height, + .lb = div_bitmap, + .letter = 0, + .left = "r ", + .is_menu = 0, + .right = "s", + .sub = 0 }, + + {.name = "SHL", + .x = 0, + .y = 300, + .w = 36, + .h = 26, + .lc = LEFT, + .label = 0, + .font_size = 0, + .lw = shl_width, + .lh = shl_height, + .lb = shl_bitmap, + .letter = 0, + .left = 0, + .is_menu = 0, + .right = 0, + .sub = 0 }, + {.name = "4", + .x = 60, + .y = 300, + .w = 46, + .h = 26, + .lc = WHITE, + .label = "4", + .font_size = 1, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = 0, + .left = 0, + .is_menu = 1, + .right = "TIME", + .sub = 0 }, + {.name = "5", + .x = 120, + .y = 300, + .w = 46, + .h = 26, + .lc = WHITE, + .label = "5", + .font_size = 1, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = 0, + .left = 0, + .is_menu = 1, + .right = "STAT", + .sub = 0 }, + {.name = "6", + .x = 180, + .y = 300, + .w = 46, + .h = 26, + .lc = WHITE, + .label = "6", + .font_size = 1, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = 0, + .left = 0, + .is_menu = 1, + .right = "UNITS", + .sub = 0 }, + {.name = "MUL", + .x = 240, + .y = 300, + .w = 46, + .h = 26, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = mul_width, + .lh = mul_height, + .lb = mul_bitmap, + .letter = 0, + .left = "t ", + .is_menu = 0, + .right = "u", + .sub = 0 }, + + {.name = "SHR", + .x = 0, + .y = 350, + .w = 36, + .h = 26, + .lc = RIGHT, + .label = 0, + .font_size = 0, + .lw = shr_width, + .lh = shr_height, + .lb = shr_bitmap, + .letter = 0, + .left = 0, + .is_menu = 1, + .right = " ", + .sub = 0 }, + {.name = "1", + .x = 60, + .y = 350, + .w = 46, + .h = 26, + .lc = WHITE, + .label = "1", + .font_size = 1, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = 0, + .left = 0, + .is_menu = 1, + .right = "I/O", + .sub = 0 }, + {.name = "2", + .x = 120, + .y = 350, + .w = 46, + .h = 26, + .lc = WHITE, + .label = "2", + .font_size = 1, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = 0, + .left = 0, + .is_menu = 1, + .right = "LIBRARY", + .sub = 0 }, + {.name = "3", + .x = 180, + .y = 350, + .w = 46, + .h = 26, + .lc = WHITE, + .label = "3", + .font_size = 1, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = 0, + .left = 0, + .is_menu = 1, + .right = "EQ LIB", + .sub = 0 }, + {.name = "MINUS", + .x = 240, + .y = 350, + .w = 46, + .h = 26, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = minus_width, + .lh = minus_height, + .lb = minus_bitmap, + .letter = 0, + .left = "v ", + .is_menu = 0, + .right = "w", + .sub = 0 }, + + {.name = "ON", + .x = 0, + .y = 400, + .w = 36, + .h = 26, + .lc = WHITE, + .label = "ON", + .font_size = 0, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = 0, + .left = "CONT", + .is_menu = 0, + .right = "OFF", + .sub = "CANCEL"}, + {.name = "0", + .x = 60, + .y = 400, + .w = 46, + .h = 26, + .lc = WHITE, + .label = "0", + .font_size = 1, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = 0, + .left = "\004 ", + .is_menu = 0, + .right = "\003", + .sub = 0 }, + {.name = "PERIOD", + .x = 120, + .y = 400, + .w = 46, + .h = 26, + .lc = WHITE, + .label = ".", + .font_size = 1, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = 0, + .left = "\002 ", + .is_menu = 0, + .right = "\001", + .sub = 0 }, + {.name = "SPC", + .x = 180, + .y = 400, + .w = 46, + .h = 26, + .lc = WHITE, + .label = "SPC", + .font_size = 0, + .lw = 0, + .lh = 0, + .lb = 0, + .letter = 0, + .left = "\005 ", + .is_menu = 0, + .right = "z", + .sub = 0 }, + {.name = "PLUS", + .x = 240, + .y = 400, + .w = 46, + .h = 26, + .lc = WHITE, + .label = 0, + .font_size = 0, + .lw = plus_width, + .lh = plus_height, + .lb = plus_bitmap, + .letter = 0, + .left = "x ", + .is_menu = 0, + .right = "y", + .sub = 0 }, +}; + void ( *ui_disp_draw_nibble )( word_20 addr, word_4 val ); void ( *ui_menu_draw_nibble )( word_20 addr, word_4 val ); void ( *ui_get_event )( void ); diff --git a/src/ui_inner.h b/src/ui_inner.h index 3240aa7..3d3317f 100644 --- a/src/ui_inner.h +++ b/src/ui_inner.h @@ -44,13 +44,37 @@ typedef struct color_t { int gray_rgb; } color_t; +typedef struct button_t { + const char* name; + + int x, y; + unsigned int w, h; + + int lc; + const char* label; + short font_size; + unsigned int lw, lh; + unsigned char* lb; + + const char* letter; + + const char* left; + short is_menu; + const char* right; + const char* sub; +} button_t; + /*************/ /* variables */ /*************/ extern letter_t small_font[ 128 ]; + extern color_t colors_sx[ NB_COLORS ]; extern color_t colors_gx[ NB_COLORS ]; +extern button_t buttons_sx[ NB_KEYS ]; +extern button_t buttons_gx[ NB_KEYS ]; + /***********/ /* bitmaps */ /***********/ diff --git a/src/ui_sdl.c b/src/ui_sdl.c index 545da0b..59f1092 100644 --- a/src/ui_sdl.c +++ b/src/ui_sdl.c @@ -40,24 +40,6 @@ /* typedef */ /***********/ typedef struct sdl_button_t { - const char* name; - - int x, y; - unsigned int w, h; - - int lc; - const char* label; - short font_size; - unsigned int lw, lh; - unsigned char* lb; - - const char* letter; - - const char* left; - short is_menu; - const char* right; - const char* sub; - SDL_Surface* surfaceup; SDL_Surface* surfacedown; } sdl_button_t; @@ -84,1792 +66,127 @@ static unsigned KEYBOARD_HEIGHT, KEYBOARD_WIDTH, TOP_SKIP, SIDE_SKIP, BOTTOM_SKI static unsigned int ARGBColors[ BLACK + 1 ]; -static sdl_button_t* buttons = 0; +static button_t* buttons = 0; +static sdl_button_t* sdl_buttons = 0; -static sdl_button_t buttons_sx[] = { - {.name = "A", - .x = 0, - .y = 0, - .w = 36, - .h = 23, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = menu_label_width, - .lh = menu_label_height, - .lb = menu_label_bitmap, - .letter = "A", - .left = 0, - .is_menu = 0, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "B", - .x = 50, - .y = 0, - .w = 36, - .h = 23, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = menu_label_width, - .lh = menu_label_height, - .lb = menu_label_bitmap, - .letter = "B", - .left = 0, - .is_menu = 0, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "C", - .x = 100, - .y = 0, - .w = 36, - .h = 23, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = menu_label_width, - .lh = menu_label_height, - .lb = menu_label_bitmap, - .letter = "C", - .left = 0, - .is_menu = 0, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "D", - .x = 150, - .y = 0, - .w = 36, - .h = 23, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = menu_label_width, - .lh = menu_label_height, - .lb = menu_label_bitmap, - .letter = "D", - .left = 0, - .is_menu = 0, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "E", - .x = 200, - .y = 0, - .w = 36, - .h = 23, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = menu_label_width, - .lh = menu_label_height, - .lb = menu_label_bitmap, - .letter = "E", - .left = 0, - .is_menu = 0, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "F", - .x = 250, - .y = 0, - .w = 36, - .h = 23, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = menu_label_width, - .lh = menu_label_height, - .lb = menu_label_bitmap, - .letter = "F", - .left = 0, - .is_menu = 0, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, +static sdl_button_t sdl_buttons_sx[] = { + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, - {.name = "MTH", - .x = 0, - .y = 50, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "MTH", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "G", - .left = "PRINT", - .is_menu = 1, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "PRG", - .x = 50, - .y = 50, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "PRG", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "H", - .left = "I/O", - .is_menu = 1, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "CST", - .x = 100, - .y = 50, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "CST", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "I", - .left = "MODES", - .is_menu = 1, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "VAR", - .x = 150, - .y = 50, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "VAR", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "J", - .left = "MEMORY", - .is_menu = 1, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "UP", - .x = 200, - .y = 50, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = up_width, - .lh = up_height, - .lb = up_bitmap, - .letter = "K", - .left = "LIBRARY", - .is_menu = 1, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "NXT", - .x = 250, - .y = 50, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "NXT", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "L", - .left = "PREV", - .is_menu = 0, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, - {.name = "COLON", - .x = 0, - .y = 100, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = colon_width, - .lh = colon_height, - .lb = colon_bitmap, - .letter = "M", - .left = "UP", - .is_menu = 0, - .right = "HOME", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "STO", - .x = 50, - .y = 100, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "STO", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "N", - .left = "DEF", - .is_menu = 0, - .right = "RCL", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "EVAL", - .x = 100, - .y = 100, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "EVAL", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "O", - .left = "aQ", - .is_menu = 0, - .right = "aNUM", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "LEFT", - .x = 150, - .y = 100, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = left_width, - .lh = left_height, - .lb = left_bitmap, - .letter = "P", - .left = "GRAPH", - .is_menu = 0, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "DOWN", - .x = 200, - .y = 100, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = down_width, - .lh = down_height, - .lb = down_bitmap, - .letter = "Q", - .left = "REVIEW", - .is_menu = 0, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "RIGHT", - .x = 250, - .y = 100, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = right_width, - .lh = right_height, - .lb = right_bitmap, - .letter = "R", - .left = "SWAP", - .is_menu = 0, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, - {.name = "SIN", - .x = 0, - .y = 150, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "SIN", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "S", - .left = "ASIN", - .is_menu = 0, - .right = "b", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "COS", - .x = 50, - .y = 150, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "COS", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "T", - .left = "ACOS", - .is_menu = 0, - .right = "c", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "TAN", - .x = 100, - .y = 150, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "TAN", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "U", - .left = "ATAN", - .is_menu = 0, - .right = "d", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "SQRT", - .x = 150, - .y = 150, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = sqrt_width, - .lh = sqrt_height, - .lb = sqrt_bitmap, - .letter = "V", - .left = "e", - .is_menu = 0, - .right = "f", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "POWER", - .x = 200, - .y = 150, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = power_width, - .lh = power_height, - .lb = power_bitmap, - .letter = "W", - .left = "g", - .is_menu = 0, - .right = "LOG", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "INV", - .x = 250, - .y = 150, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = inv_width, - .lh = inv_height, - .lb = inv_bitmap, - .letter = "X", - .left = "h", - .is_menu = 0, - .right = "LN", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, - {.name = "ENTER", - .x = 0, - .y = 200, - .w = 86, - .h = 26, - .lc = WHITE, - .label = "ENTER", - .font_size = 2, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "EQUATION", - .is_menu = 0, - .right = "MATRIX", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "NEG", - .x = 100, - .y = 200, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = neg_width, - .lh = neg_height, - .lb = neg_bitmap, - .letter = "Y", - .left = "EDIT", - .is_menu = 0, - .right = "VISIT", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "EEX", - .x = 150, - .y = 200, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "EEX", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "Z", - .left = "2D", - .is_menu = 0, - .right = "3D", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "DEL", - .x = 200, - .y = 200, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "DEL", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "PURGE", - .is_menu = 0, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "BS", - .x = 250, - .y = 200, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = bs_width, - .lh = bs_height, - .lb = bs_bitmap, - .letter = 0, - .left = "DROP", - .is_menu = 0, - .right = "CLR", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, - {.name = "ALPHA", - .x = 0, - .y = 250, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = alpha_width, - .lh = alpha_height, - .lb = alpha_bitmap, - .letter = 0, - .left = "USR", - .is_menu = 0, - .right = "ENTRY", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "7", - .x = 60, - .y = 250, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "7", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "SOLVE", - .is_menu = 1, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "8", - .x = 120, - .y = 250, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "8", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "PLOT", - .is_menu = 1, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "9", - .x = 180, - .y = 250, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "9", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "ALGEBRA", - .is_menu = 1, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "DIV", - .x = 240, - .y = 250, - .w = 46, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = div_width, - .lh = div_height, - .lb = div_bitmap, - .letter = 0, - .left = "( )", - .is_menu = 0, - .right = "#", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, - {.name = "SHL", - .x = 0, - .y = 300, - .w = 36, - .h = 26, - .lc = LEFT, - .label = 0, - .font_size = 0, - .lw = shl_width, - .lh = shl_height, - .lb = shl_bitmap, - .letter = 0, - .left = 0, - .is_menu = 0, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "4", - .x = 60, - .y = 300, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "4", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "TIME", - .is_menu = 1, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "5", - .x = 120, - .y = 300, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "5", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "STAT", - .is_menu = 1, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "6", - .x = 180, - .y = 300, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "6", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "UNITS", - .is_menu = 1, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "MUL", - .x = 240, - .y = 300, - .w = 46, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = mul_width, - .lh = mul_height, - .lb = mul_bitmap, - .letter = 0, - .left = "[ ]", - .is_menu = 0, - .right = "_", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, - {.name = "SHR", - .x = 0, - .y = 350, - .w = 36, - .h = 26, - .lc = RIGHT, - .label = 0, - .font_size = 0, - .lw = shr_width, - .lh = shr_height, - .lb = shr_bitmap, - .letter = 0, - .left = 0, - .is_menu = 0, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "1", - .x = 60, - .y = 350, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "1", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "RAD", - .is_menu = 0, - .right = "POLAR", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "2", - .x = 120, - .y = 350, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "2", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "STACK", - .is_menu = 0, - .right = "ARG", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "3", - .x = 180, - .y = 350, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "3", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "CMD", - .is_menu = 0, - .right = "MENU", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "MINUS", - .x = 240, - .y = 350, - .w = 46, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = minus_width, - .lh = minus_height, - .lb = minus_bitmap, - .letter = 0, - .left = "i", - .is_menu = 0, - .right = "j", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, - {.name = "ON", - .x = 0, - .y = 400, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "ON", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "CONT", - .is_menu = 0, - .right = "OFF", - .sub = "ATTN", - .surfaceup = 0, - .surfacedown = 0}, - {.name = "0", - .x = 60, - .y = 400, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "0", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "= ", - .is_menu = 0, - .right = " a", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "PERIOD", - .x = 120, - .y = 400, - .w = 46, - .h = 26, - .lc = WHITE, - .label = ".", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = ",", - .is_menu = 0, - .right = " k", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "SPC", - .x = 180, - .y = 400, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "SPC", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "l ", - .is_menu = 0, - .right = " m", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "PLUS", - .x = 240, - .y = 400, - .w = 46, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = plus_width, - .lh = plus_height, - .lb = plus_bitmap, - .letter = 0, - .left = "{ }", - .is_menu = 0, - .right = ": :", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, }; -static sdl_button_t buttons_gx[] = { - {.name = "A", - .x = 0, - .y = 0, - .w = 36, - .h = 23, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = menu_label_width, - .lh = menu_label_height, - .lb = menu_label_bitmap, - .letter = "A", - .left = 0, - .is_menu = 0, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "B", - .x = 50, - .y = 0, - .w = 36, - .h = 23, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = menu_label_width, - .lh = menu_label_height, - .lb = menu_label_bitmap, - .letter = "B", - .left = 0, - .is_menu = 0, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "C", - .x = 100, - .y = 0, - .w = 36, - .h = 23, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = menu_label_width, - .lh = menu_label_height, - .lb = menu_label_bitmap, - .letter = "C", - .left = 0, - .is_menu = 0, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "D", - .x = 150, - .y = 0, - .w = 36, - .h = 23, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = menu_label_width, - .lh = menu_label_height, - .lb = menu_label_bitmap, - .letter = "D", - .left = 0, - .is_menu = 0, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "E", - .x = 200, - .y = 0, - .w = 36, - .h = 23, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = menu_label_width, - .lh = menu_label_height, - .lb = menu_label_bitmap, - .letter = "E", - .left = 0, - .is_menu = 0, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "F", - .x = 250, - .y = 0, - .w = 36, - .h = 23, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = menu_label_width, - .lh = menu_label_height, - .lb = menu_label_bitmap, - .letter = "F", - .left = 0, - .is_menu = 0, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, +static sdl_button_t sdl_buttons_gx[] = { + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, - {.name = "MTH", - .x = 0, - .y = 50, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "MTH", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "G", - .left = "RAD", - .is_menu = 0, - .right = "POLAR", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "PRG", - .x = 50, - .y = 50, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "PRG", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "H", - .left = 0, - .is_menu = 0, - .right = "CHARS", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "CST", - .x = 100, - .y = 50, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "CST", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "I", - .left = 0, - .is_menu = 0, - .right = "MODES", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "VAR", - .x = 150, - .y = 50, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "VAR", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "J", - .left = 0, - .is_menu = 0, - .right = "MEMORY", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "UP", - .x = 200, - .y = 50, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = up_width, - .lh = up_height, - .lb = up_bitmap, - .letter = "K", - .left = 0, - .is_menu = 0, - .right = "STACK", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "NXT", - .x = 250, - .y = 50, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "NXT", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "L", - .left = "PREV", - .is_menu = 0, - .right = "MENU", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, - {.name = "COLON", - .x = 0, - .y = 100, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = colon_width, - .lh = colon_height, - .lb = colon_bitmap, - .letter = "M", - .left = "UP", - .is_menu = 0, - .right = "HOME", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "STO", - .x = 50, - .y = 100, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "STO", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "N", - .left = "DEF", - .is_menu = 0, - .right = "RCL", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "EVAL", - .x = 100, - .y = 100, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "EVAL", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "O", - .left = "aNUM", - .is_menu = 0, - .right = "UNDO", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "LEFT", - .x = 150, - .y = 100, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = left_width, - .lh = left_height, - .lb = left_bitmap, - .letter = "P", - .left = "PICTURE", - .is_menu = 0, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "DOWN", - .x = 200, - .y = 100, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = down_width, - .lh = down_height, - .lb = down_bitmap, - .letter = "Q", - .left = "VIEW", - .is_menu = 0, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "RIGHT", - .x = 250, - .y = 100, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = right_width, - .lh = right_height, - .lb = right_bitmap, - .letter = "R", - .left = "SWAP", - .is_menu = 0, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, - {.name = "SIN", - .x = 0, - .y = 150, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "SIN", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "S", - .left = "ASIN", - .is_menu = 0, - .right = "b", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "COS", - .x = 50, - .y = 150, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "COS", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "T", - .left = "ACOS", - .is_menu = 0, - .right = "c", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "TAN", - .x = 100, - .y = 150, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "TAN", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "U", - .left = "ATAN", - .is_menu = 0, - .right = "d", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "SQRT", - .x = 150, - .y = 150, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = sqrt_width, - .lh = sqrt_height, - .lb = sqrt_bitmap, - .letter = "V", - .left = "n", - .is_menu = 0, - .right = "o", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "POWER", - .x = 200, - .y = 150, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = power_width, - .lh = power_height, - .lb = power_bitmap, - .letter = "W", - .left = "p", - .is_menu = 0, - .right = "LOG", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "INV", - .x = 250, - .y = 150, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = inv_width, - .lh = inv_height, - .lb = inv_bitmap, - .letter = "X", - .left = "q", - .is_menu = 0, - .right = "LN", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, - {.name = "ENTER", - .x = 0, - .y = 200, - .w = 86, - .h = 26, - .lc = WHITE, - .label = "ENTER", - .font_size = 2, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "EQUATION", - .is_menu = 0, - .right = "MATRIX", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "NEG", - .x = 100, - .y = 200, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = neg_width, - .lh = neg_height, - .lb = neg_bitmap, - .letter = "Y", - .left = "EDIT", - .is_menu = 0, - .right = "CMD", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "EEX", - .x = 150, - .y = 200, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "EEX", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "Z", - .left = "PURG", - .is_menu = 0, - .right = "ARG", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "DEL", - .x = 200, - .y = 200, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "DEL", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "CLEAR", - .is_menu = 0, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "BS", - .x = 250, - .y = 200, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = bs_width, - .lh = bs_height, - .lb = bs_bitmap, - .letter = 0, - .left = "DROP", - .is_menu = 0, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, - {.name = "ALPHA", - .x = 0, - .y = 250, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = alpha_width, - .lh = alpha_height, - .lb = alpha_bitmap, - .letter = 0, - .left = "USER", - .is_menu = 0, - .right = "ENTRY", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "7", - .x = 60, - .y = 250, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "7", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = 0, - .is_menu = 1, - .right = "SOLVE", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "8", - .x = 120, - .y = 250, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "8", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = 0, - .is_menu = 1, - .right = "PLOT", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "9", - .x = 180, - .y = 250, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "9", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = 0, - .is_menu = 1, - .right = "SYMBOLIC", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "DIV", - .x = 240, - .y = 250, - .w = 46, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = div_width, - .lh = div_height, - .lb = div_bitmap, - .letter = 0, - .left = "r ", - .is_menu = 0, - .right = "s", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, - {.name = "SHL", - .x = 0, - .y = 300, - .w = 36, - .h = 26, - .lc = LEFT, - .label = 0, - .font_size = 0, - .lw = shl_width, - .lh = shl_height, - .lb = shl_bitmap, - .letter = 0, - .left = 0, - .is_menu = 0, - .right = 0, - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "4", - .x = 60, - .y = 300, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "4", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = 0, - .is_menu = 1, - .right = "TIME", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "5", - .x = 120, - .y = 300, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "5", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = 0, - .is_menu = 1, - .right = "STAT", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "6", - .x = 180, - .y = 300, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "6", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = 0, - .is_menu = 1, - .right = "UNITS", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "MUL", - .x = 240, - .y = 300, - .w = 46, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = mul_width, - .lh = mul_height, - .lb = mul_bitmap, - .letter = 0, - .left = "t ", - .is_menu = 0, - .right = "u", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, - {.name = "SHR", - .x = 0, - .y = 350, - .w = 36, - .h = 26, - .lc = RIGHT, - .label = 0, - .font_size = 0, - .lw = shr_width, - .lh = shr_height, - .lb = shr_bitmap, - .letter = 0, - .left = 0, - .is_menu = 1, - .right = " ", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "1", - .x = 60, - .y = 350, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "1", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = 0, - .is_menu = 1, - .right = "I/O", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "2", - .x = 120, - .y = 350, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "2", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = 0, - .is_menu = 1, - .right = "LIBRARY", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "3", - .x = 180, - .y = 350, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "3", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = 0, - .is_menu = 1, - .right = "EQ LIB", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "MINUS", - .x = 240, - .y = 350, - .w = 46, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = minus_width, - .lh = minus_height, - .lb = minus_bitmap, - .letter = 0, - .left = "v ", - .is_menu = 0, - .right = "w", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, - {.name = "ON", - .x = 0, - .y = 400, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "ON", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "CONT", - .is_menu = 0, - .right = "OFF", - .sub = "CANCEL", - .surfaceup = 0, - .surfacedown = 0}, - {.name = "0", - .x = 60, - .y = 400, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "0", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "\004 ", - .is_menu = 0, - .right = "\003", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "PERIOD", - .x = 120, - .y = 400, - .w = 46, - .h = 26, - .lc = WHITE, - .label = ".", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "\002 ", - .is_menu = 0, - .right = "\001", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "SPC", - .x = 180, - .y = 400, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "SPC", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "\005 ", - .is_menu = 0, - .right = "z", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, - {.name = "PLUS", - .x = 240, - .y = 400, - .w = 46, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = plus_width, - .lh = plus_height, - .lb = plus_bitmap, - .letter = 0, - .left = "x ", - .is_menu = 0, - .right = "y", - .sub = 0, - .surfaceup = 0, - .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, + {.surfaceup = 0, .surfacedown = 0}, }; static sdl_ann_struct_t ann_tbl[] = { @@ -2524,12 +841,12 @@ static void _create_buttons( void ) for ( i = FIRST_HPKEY; i <= LAST_HPKEY; i++ ) { // Create surfaces for each button - if ( !buttons[ i ].surfaceup ) - buttons[ i ].surfaceup = + if ( !sdl_buttons[ i ].surfaceup ) + sdl_buttons[ i ].surfaceup = SDL_CreateRGBSurface( SDL_SWSURFACE, buttons[ i ].w, buttons[ i ].h, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 ); - if ( !buttons[ i ].surfacedown ) - buttons[ i ].surfacedown = + if ( !sdl_buttons[ i ].surfacedown ) + sdl_buttons[ i ].surfacedown = SDL_CreateRGBSurface( SDL_SWSURFACE, buttons[ i ].w, buttons[ i ].h, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 ); // Use alpha channel @@ -2537,112 +854,112 @@ static void _create_buttons( void ) // pixel = 0xffff0000; // Fill the button and outline - SDL_FillRect( buttons[ i ].surfaceup, 0, pixel ); - SDL_FillRect( buttons[ i ].surfacedown, 0, pixel ); + SDL_FillRect( sdl_buttons[ i ].surfaceup, 0, pixel ); + SDL_FillRect( sdl_buttons[ i ].surfacedown, 0, pixel ); SDL_Rect rect; rect.x = 1; rect.y = 1; rect.w = buttons[ i ].w - 2; rect.h = buttons[ i ].h - 2; - SDL_FillRect( buttons[ i ].surfaceup, &rect, ARGBColors[ BUTTON ] ); - SDL_FillRect( buttons[ i ].surfacedown, &rect, ARGBColors[ BUTTON ] ); + SDL_FillRect( sdl_buttons[ i ].surfaceup, &rect, ARGBColors[ BUTTON ] ); + SDL_FillRect( sdl_buttons[ i ].surfacedown, &rect, ARGBColors[ BUTTON ] ); // draw the released button // draw edge of button - lineColor( buttons[ i ].surfaceup, 1, buttons[ i ].h - 2, 1, 1, bgra2argb( ARGBColors[ BUT_TOP ] ) ); - lineColor( buttons[ i ].surfaceup, 2, buttons[ i ].h - 3, 2, 2, bgra2argb( ARGBColors[ BUT_TOP ] ) ); - lineColor( buttons[ i ].surfaceup, 3, buttons[ i ].h - 4, 3, 3, bgra2argb( ARGBColors[ BUT_TOP ] ) ); + lineColor( sdl_buttons[ i ].surfaceup, 1, buttons[ i ].h - 2, 1, 1, bgra2argb( ARGBColors[ BUT_TOP ] ) ); + lineColor( sdl_buttons[ i ].surfaceup, 2, buttons[ i ].h - 3, 2, 2, bgra2argb( ARGBColors[ BUT_TOP ] ) ); + lineColor( sdl_buttons[ i ].surfaceup, 3, buttons[ i ].h - 4, 3, 3, bgra2argb( ARGBColors[ BUT_TOP ] ) ); - lineColor( buttons[ i ].surfaceup, 1, 1, buttons[ i ].w - 2, 1, bgra2argb( ARGBColors[ BUT_TOP ] ) ); - lineColor( buttons[ i ].surfaceup, 2, 2, buttons[ i ].w - 3, 2, bgra2argb( ARGBColors[ BUT_TOP ] ) ); - lineColor( buttons[ i ].surfaceup, 3, 3, buttons[ i ].w - 4, 3, bgra2argb( ARGBColors[ BUT_TOP ] ) ); - lineColor( buttons[ i ].surfaceup, 4, 4, buttons[ i ].w - 5, 4, bgra2argb( ARGBColors[ BUT_TOP ] ) ); + lineColor( sdl_buttons[ i ].surfaceup, 1, 1, buttons[ i ].w - 2, 1, bgra2argb( ARGBColors[ BUT_TOP ] ) ); + lineColor( sdl_buttons[ i ].surfaceup, 2, 2, buttons[ i ].w - 3, 2, bgra2argb( ARGBColors[ BUT_TOP ] ) ); + lineColor( sdl_buttons[ i ].surfaceup, 3, 3, buttons[ i ].w - 4, 3, bgra2argb( ARGBColors[ BUT_TOP ] ) ); + lineColor( sdl_buttons[ i ].surfaceup, 4, 4, buttons[ i ].w - 5, 4, bgra2argb( ARGBColors[ BUT_TOP ] ) ); - pixelColor( buttons[ i ].surfaceup, 4, 5, bgra2argb( ARGBColors[ BUT_TOP ] ) ); + pixelColor( sdl_buttons[ i ].surfaceup, 4, 5, bgra2argb( ARGBColors[ BUT_TOP ] ) ); - lineColor( buttons[ i ].surfaceup, 3, buttons[ i ].h - 2, buttons[ i ].w - 2, buttons[ i ].h - 2, + lineColor( sdl_buttons[ i ].surfaceup, 3, buttons[ i ].h - 2, buttons[ i ].w - 2, buttons[ i ].h - 2, bgra2argb( ARGBColors[ BUT_BOT ] ) ); - lineColor( buttons[ i ].surfaceup, 4, buttons[ i ].h - 3, buttons[ i ].w - 3, buttons[ i ].h - 3, + lineColor( sdl_buttons[ i ].surfaceup, 4, buttons[ i ].h - 3, buttons[ i ].w - 3, buttons[ i ].h - 3, bgra2argb( ARGBColors[ BUT_BOT ] ) ); - lineColor( buttons[ i ].surfaceup, buttons[ i ].w - 2, buttons[ i ].h - 2, buttons[ i ].w - 2, 3, + lineColor( sdl_buttons[ i ].surfaceup, buttons[ i ].w - 2, buttons[ i ].h - 2, buttons[ i ].w - 2, 3, bgra2argb( ARGBColors[ BUT_BOT ] ) ); - lineColor( buttons[ i ].surfaceup, buttons[ i ].w - 3, buttons[ i ].h - 3, buttons[ i ].w - 3, 4, + lineColor( sdl_buttons[ i ].surfaceup, buttons[ i ].w - 3, buttons[ i ].h - 3, buttons[ i ].w - 3, 4, bgra2argb( ARGBColors[ BUT_BOT ] ) ); - lineColor( buttons[ i ].surfaceup, buttons[ i ].w - 4, buttons[ i ].h - 4, buttons[ i ].w - 4, 5, + lineColor( sdl_buttons[ i ].surfaceup, buttons[ i ].w - 4, buttons[ i ].h - 4, buttons[ i ].w - 4, 5, bgra2argb( ARGBColors[ BUT_BOT ] ) ); - pixelColor( buttons[ i ].surfaceup, buttons[ i ].w - 5, buttons[ i ].h - 4, bgra2argb( ARGBColors[ BUT_BOT ] ) ); + pixelColor( sdl_buttons[ i ].surfaceup, buttons[ i ].w - 5, buttons[ i ].h - 4, bgra2argb( ARGBColors[ BUT_BOT ] ) ); // draw frame around button - lineColor( buttons[ i ].surfaceup, 0, buttons[ i ].h - 3, 0, 2, bgra2argb( ARGBColors[ FRAME ] ) ); - lineColor( buttons[ i ].surfaceup, 2, 0, buttons[ i ].w - 3, 0, bgra2argb( ARGBColors[ FRAME ] ) ); - lineColor( buttons[ i ].surfaceup, 2, buttons[ i ].h - 1, buttons[ i ].w - 3, buttons[ i ].h - 1, + lineColor( sdl_buttons[ i ].surfaceup, 0, buttons[ i ].h - 3, 0, 2, bgra2argb( ARGBColors[ FRAME ] ) ); + lineColor( sdl_buttons[ i ].surfaceup, 2, 0, buttons[ i ].w - 3, 0, bgra2argb( ARGBColors[ FRAME ] ) ); + lineColor( sdl_buttons[ i ].surfaceup, 2, buttons[ i ].h - 1, buttons[ i ].w - 3, buttons[ i ].h - 1, bgra2argb( ARGBColors[ FRAME ] ) ); - lineColor( buttons[ i ].surfaceup, buttons[ i ].w - 1, buttons[ i ].h - 3, buttons[ i ].w - 1, 2, + lineColor( sdl_buttons[ i ].surfaceup, buttons[ i ].w - 1, buttons[ i ].h - 3, buttons[ i ].w - 1, 2, bgra2argb( ARGBColors[ FRAME ] ) ); if ( i == HPKEY_ON ) { - lineColor( buttons[ i ].surfaceup, 1, 1, buttons[ 1 ].w - 2, 1, bgra2argb( ARGBColors[ FRAME ] ) ); - pixelColor( buttons[ i ].surfaceup, 1, 2, bgra2argb( ARGBColors[ FRAME ] ) ); - pixelColor( buttons[ i ].surfaceup, buttons[ i ].w - 2, 2, bgra2argb( ARGBColors[ FRAME ] ) ); + lineColor( sdl_buttons[ i ].surfaceup, 1, 1, buttons[ 1 ].w - 2, 1, bgra2argb( ARGBColors[ FRAME ] ) ); + pixelColor( sdl_buttons[ i ].surfaceup, 1, 2, bgra2argb( ARGBColors[ FRAME ] ) ); + pixelColor( sdl_buttons[ i ].surfaceup, buttons[ i ].w - 2, 2, bgra2argb( ARGBColors[ FRAME ] ) ); } else { - pixelColor( buttons[ i ].surfaceup, 1, 1, bgra2argb( ARGBColors[ FRAME ] ) ); - pixelColor( buttons[ i ].surfaceup, buttons[ i ].w - 2, 1, bgra2argb( ARGBColors[ FRAME ] ) ); + pixelColor( sdl_buttons[ i ].surfaceup, 1, 1, bgra2argb( ARGBColors[ FRAME ] ) ); + pixelColor( sdl_buttons[ i ].surfaceup, buttons[ i ].w - 2, 1, bgra2argb( ARGBColors[ FRAME ] ) ); } - pixelColor( buttons[ i ].surfaceup, 1, buttons[ i ].h - 2, bgra2argb( ARGBColors[ FRAME ] ) ); - pixelColor( buttons[ i ].surfaceup, buttons[ i ].w - 2, buttons[ i ].h - 2, bgra2argb( ARGBColors[ FRAME ] ) ); + pixelColor( sdl_buttons[ i ].surfaceup, 1, buttons[ i ].h - 2, bgra2argb( ARGBColors[ FRAME ] ) ); + pixelColor( sdl_buttons[ i ].surfaceup, buttons[ i ].w - 2, buttons[ i ].h - 2, bgra2argb( ARGBColors[ FRAME ] ) ); // draw the depressed button // draw edge of button - lineColor( buttons[ i ].surfacedown, 2, buttons[ i ].h - 4, 2, 2, bgra2argb( ARGBColors[ BUT_TOP ] ) ); - lineColor( buttons[ i ].surfacedown, 3, buttons[ i ].h - 5, 3, 3, bgra2argb( ARGBColors[ BUT_TOP ] ) ); - lineColor( buttons[ i ].surfacedown, 2, 2, buttons[ i ].w - 4, 2, bgra2argb( ARGBColors[ BUT_TOP ] ) ); - lineColor( buttons[ i ].surfacedown, 3, 3, buttons[ i ].w - 5, 3, bgra2argb( ARGBColors[ BUT_TOP ] ) ); - pixelColor( buttons[ i ].surfacedown, 4, 4, bgra2argb( ARGBColors[ BUT_TOP ] ) ); + lineColor( sdl_buttons[ i ].surfacedown, 2, buttons[ i ].h - 4, 2, 2, bgra2argb( ARGBColors[ BUT_TOP ] ) ); + lineColor( sdl_buttons[ i ].surfacedown, 3, buttons[ i ].h - 5, 3, 3, bgra2argb( ARGBColors[ BUT_TOP ] ) ); + lineColor( sdl_buttons[ i ].surfacedown, 2, 2, buttons[ i ].w - 4, 2, bgra2argb( ARGBColors[ BUT_TOP ] ) ); + lineColor( sdl_buttons[ i ].surfacedown, 3, 3, buttons[ i ].w - 5, 3, bgra2argb( ARGBColors[ BUT_TOP ] ) ); + pixelColor( sdl_buttons[ i ].surfacedown, 4, 4, bgra2argb( ARGBColors[ BUT_TOP ] ) ); - lineColor( buttons[ i ].surfacedown, 3, buttons[ i ].h - 3, buttons[ i ].w - 3, buttons[ i ].h - 3, + lineColor( sdl_buttons[ i ].surfacedown, 3, buttons[ i ].h - 3, buttons[ i ].w - 3, buttons[ i ].h - 3, bgra2argb( ARGBColors[ BUT_BOT ] ) ); - lineColor( buttons[ i ].surfacedown, 4, buttons[ i ].h - 4, buttons[ i ].w - 4, buttons[ i ].h - 4, + lineColor( sdl_buttons[ i ].surfacedown, 4, buttons[ i ].h - 4, buttons[ i ].w - 4, buttons[ i ].h - 4, bgra2argb( ARGBColors[ BUT_BOT ] ) ); - lineColor( buttons[ i ].surfacedown, buttons[ i ].w - 3, buttons[ i ].h - 3, buttons[ i ].w - 3, 3, + lineColor( sdl_buttons[ i ].surfacedown, buttons[ i ].w - 3, buttons[ i ].h - 3, buttons[ i ].w - 3, 3, bgra2argb( ARGBColors[ BUT_BOT ] ) ); - lineColor( buttons[ i ].surfacedown, buttons[ i ].w - 4, buttons[ i ].h - 4, buttons[ i ].w - 4, 4, + lineColor( sdl_buttons[ i ].surfacedown, buttons[ i ].w - 4, buttons[ i ].h - 4, buttons[ i ].w - 4, 4, bgra2argb( ARGBColors[ BUT_BOT ] ) ); - pixelColor( buttons[ i ].surfacedown, buttons[ i ].w - 5, buttons[ i ].h - 5, bgra2argb( ARGBColors[ BUT_BOT ] ) ); + pixelColor( sdl_buttons[ i ].surfacedown, buttons[ i ].w - 5, buttons[ i ].h - 5, bgra2argb( ARGBColors[ BUT_BOT ] ) ); // draw frame around button - lineColor( buttons[ i ].surfacedown, 0, buttons[ i ].h - 3, 0, 2, bgra2argb( ARGBColors[ FRAME ] ) ); - lineColor( buttons[ i ].surfacedown, 2, 0, buttons[ i ].w - 3, 0, bgra2argb( ARGBColors[ FRAME ] ) ); - lineColor( buttons[ i ].surfacedown, 2, buttons[ i ].h - 1, buttons[ i ].w - 3, buttons[ i ].h - 1, + lineColor( sdl_buttons[ i ].surfacedown, 0, buttons[ i ].h - 3, 0, 2, bgra2argb( ARGBColors[ FRAME ] ) ); + lineColor( sdl_buttons[ i ].surfacedown, 2, 0, buttons[ i ].w - 3, 0, bgra2argb( ARGBColors[ FRAME ] ) ); + lineColor( sdl_buttons[ i ].surfacedown, 2, buttons[ i ].h - 1, buttons[ i ].w - 3, buttons[ i ].h - 1, bgra2argb( ARGBColors[ FRAME ] ) ); - lineColor( buttons[ i ].surfacedown, buttons[ i ].w - 1, buttons[ i ].h - 3, buttons[ i ].w - 1, 2, + lineColor( sdl_buttons[ i ].surfacedown, buttons[ i ].w - 1, buttons[ i ].h - 3, buttons[ i ].w - 1, 2, bgra2argb( ARGBColors[ FRAME ] ) ); if ( i == HPKEY_ON ) { - lineColor( buttons[ i ].surfacedown, 1, 1, buttons[ i ].w - 2, 1, bgra2argb( ARGBColors[ FRAME ] ) ); - pixelColor( buttons[ i ].surfacedown, 1, 2, bgra2argb( ARGBColors[ FRAME ] ) ); - pixelColor( buttons[ i ].surfacedown, buttons[ i ].w - 2, 2, bgra2argb( ARGBColors[ FRAME ] ) ); + lineColor( sdl_buttons[ i ].surfacedown, 1, 1, buttons[ i ].w - 2, 1, bgra2argb( ARGBColors[ FRAME ] ) ); + pixelColor( sdl_buttons[ i ].surfacedown, 1, 2, bgra2argb( ARGBColors[ FRAME ] ) ); + pixelColor( sdl_buttons[ i ].surfacedown, buttons[ i ].w - 2, 2, bgra2argb( ARGBColors[ FRAME ] ) ); } else { - pixelColor( buttons[ i ].surfacedown, 1, 1, bgra2argb( ARGBColors[ FRAME ] ) ); - pixelColor( buttons[ i ].surfacedown, buttons[ i ].w - 2, 1, bgra2argb( ARGBColors[ FRAME ] ) ); + pixelColor( sdl_buttons[ i ].surfacedown, 1, 1, bgra2argb( ARGBColors[ FRAME ] ) ); + pixelColor( sdl_buttons[ i ].surfacedown, buttons[ i ].w - 2, 1, bgra2argb( ARGBColors[ FRAME ] ) ); } - pixelColor( buttons[ i ].surfacedown, 1, buttons[ i ].h - 2, bgra2argb( ARGBColors[ FRAME ] ) ); - pixelColor( buttons[ i ].surfacedown, buttons[ i ].w - 2, buttons[ i ].h - 2, bgra2argb( ARGBColors[ FRAME ] ) ); + pixelColor( sdl_buttons[ i ].surfacedown, 1, buttons[ i ].h - 2, bgra2argb( ARGBColors[ FRAME ] ) ); + pixelColor( sdl_buttons[ i ].surfacedown, buttons[ i ].w - 2, buttons[ i ].h - 2, bgra2argb( ARGBColors[ FRAME ] ) ); if ( i == HPKEY_ON ) { - rectangleColor( buttons[ i ].surfacedown, 1, 2, 1 + buttons[ i ].w - 3, 2 + buttons[ i ].h - 4, + rectangleColor( sdl_buttons[ i ].surfacedown, 1, 2, 1 + buttons[ i ].w - 3, 2 + buttons[ i ].h - 4, bgra2argb( ARGBColors[ FRAME ] ) ); - pixelColor( buttons[ i ].surfacedown, 2, 3, bgra2argb( ARGBColors[ FRAME ] ) ); - pixelColor( buttons[ i ].surfacedown, buttons[ i ].w - 3, 3, bgra2argb( ARGBColors[ FRAME ] ) ); + pixelColor( sdl_buttons[ i ].surfacedown, 2, 3, bgra2argb( ARGBColors[ FRAME ] ) ); + pixelColor( sdl_buttons[ i ].surfacedown, buttons[ i ].w - 3, 3, bgra2argb( ARGBColors[ FRAME ] ) ); } else { - rectangleColor( buttons[ i ].surfacedown, 1, 1, 1 + buttons[ i ].w - 3, 1 + buttons[ i ].h - 3, + rectangleColor( sdl_buttons[ i ].surfacedown, 1, 1, 1 + buttons[ i ].w - 3, 1 + buttons[ i ].h - 3, bgra2argb( ARGBColors[ FRAME ] ) ); - pixelColor( buttons[ i ].surfacedown, 2, 2, bgra2argb( ARGBColors[ FRAME ] ) ); - pixelColor( buttons[ i ].surfacedown, buttons[ i ].w - 3, 2, bgra2argb( ARGBColors[ FRAME ] ) ); + pixelColor( sdl_buttons[ i ].surfacedown, 2, 2, bgra2argb( ARGBColors[ FRAME ] ) ); + pixelColor( sdl_buttons[ i ].surfacedown, buttons[ i ].w - 3, 2, bgra2argb( ARGBColors[ FRAME ] ) ); } - pixelColor( buttons[ i ].surfacedown, 2, buttons[ i ].h - 3, bgra2argb( ARGBColors[ FRAME ] ) ); - pixelColor( buttons[ i ].surfacedown, buttons[ i ].w - 3, buttons[ i ].h - 3, bgra2argb( ARGBColors[ FRAME ] ) ); + pixelColor( sdl_buttons[ i ].surfacedown, 2, buttons[ i ].h - 3, bgra2argb( ARGBColors[ FRAME ] ) ); + pixelColor( sdl_buttons[ i ].surfacedown, buttons[ i ].w - 3, buttons[ i ].h - 3, bgra2argb( ARGBColors[ FRAME ] ) ); if ( buttons[ i ].label != ( char* )0 ) { // Todo: use SDL_ttf to print "nice" fonts @@ -2650,8 +967,8 @@ static void _create_buttons( void ) // for the time being use SDL_gfxPrimitives' font x = ( buttons[ i ].w - strlen( buttons[ i ].label ) * 8 ) / 2; y = ( buttons[ i ].h + 1 ) / 2 - 4; - stringColor( buttons[ i ].surfaceup, x, y, buttons[ i ].label, 0xffffffff ); - stringColor( buttons[ i ].surfacedown, x, y, buttons[ i ].label, 0xffffffff ); + stringColor( sdl_buttons[ i ].surfaceup, x, y, buttons[ i ].label, 0xffffffff ); + stringColor( sdl_buttons[ i ].surfacedown, x, y, buttons[ i ].label, 0xffffffff ); } // Pixmap centered in button if ( buttons[ i ].lw != 0 ) { @@ -2675,8 +992,8 @@ static void _create_buttons( void ) drect.y = y; drect.w = buttons[ i ].lw; drect.h = buttons[ i ].lh; - SDL_BlitSurface( surf, &srect, buttons[ i ].surfacedown, &drect ); - SDL_BlitSurface( surf, &srect, buttons[ i ].surfaceup, &drect ); + SDL_BlitSurface( surf, &srect, sdl_buttons[ i ].surfacedown, &drect ); + SDL_BlitSurface( surf, &srect, sdl_buttons[ i ].surfaceup, &drect ); SDL_FreeSurface( surf ); } } @@ -2697,9 +1014,9 @@ static void draw_buttons( void ) drect.w = buttons[ i ].w; drect.h = buttons[ i ].h; if ( keyboard[ i ].pressed ) - SDL_BlitSurface( buttons[ i ].surfacedown, &srect, sdlwindow, &drect ); + SDL_BlitSurface( sdl_buttons[ i ].surfacedown, &srect, sdlwindow, &drect ); else - SDL_BlitSurface( buttons[ i ].surfaceup, &srect, sdlwindow, &drect ); + SDL_BlitSurface( sdl_buttons[ i ].surfaceup, &srect, sdlwindow, &drect ); } // Always update immediately buttons @@ -3032,7 +1349,7 @@ static void show_key( int hpkey ) return; // Which surface to show - ssurf = ( keyboard[ hpkey ].pressed ) ? buttons[ hpkey ].surfacedown : buttons[ hpkey ].surfaceup; + ssurf = ( keyboard[ hpkey ].pressed ) ? sdl_buttons[ hpkey ].surfacedown : sdl_buttons[ hpkey ].surfaceup; // Background backup showkeylastsurf = SDL_CreateRGBSurface( SDL_SWSURFACE, ssurf->w, ssurf->h, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 ); @@ -3454,13 +1771,20 @@ void init_sdl_ui( int argc, char** argv ) // we allocate memory for the buttons because we need to modify // their coordinates, and we don't want to change the original buttons_gx or // buttons_sx - buttons = ( sdl_button_t* )malloc( sizeof( buttons_gx ) ); + buttons = ( button_t* )malloc( sizeof( buttons_gx ) ); if ( opt_gx ) memcpy( buttons, buttons_gx, sizeof( buttons_gx ) ); else memcpy( buttons, buttons_sx, sizeof( buttons_sx ) ); + sdl_buttons = ( sdl_button_t* )malloc( sizeof( sdl_buttons_gx ) ); + + if ( opt_gx ) + memcpy( sdl_buttons, sdl_buttons_gx, sizeof( sdl_buttons_gx ) ); + else + memcpy( sdl_buttons, sdl_buttons_sx, sizeof( sdl_buttons_sx ) ); + colors_setup( opt_gx ? colors_gx : colors_sx ); if ( !config.hide_chrome ) { diff --git a/src/ui_x11.c b/src/ui_x11.c index e524dae..6009aa4 100644 --- a/src/ui_x11.c +++ b/src/ui_x11.c @@ -193,23 +193,6 @@ typedef struct x11_keypad_t { } x11_keypad_t; typedef struct x11_button_t { - const char* name; - int x, y; - unsigned int w, h; - - int lc; - const char* label; - short font_size; - unsigned int lw, lh; - unsigned char* lb; - - const char* letter; - - const char* left; - short is_menu; - const char* right; - const char* sub; - Pixmap map; Pixmap down; Window xwin; @@ -303,1854 +286,65 @@ static int icon_color_mode; static char* res_name; static char* res_class; -static x11_button_t* buttons = 0; +static button_t* buttons = 0; +static x11_button_t x11_buttons[ NB_KEYS ] = { + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, -static x11_button_t buttons_sx[] = { - {.name = "A", - .x = 0, - .y = 0, - .w = 36, - .h = 23, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = menu_label_width, - .lh = menu_label_height, - .lb = menu_label_bitmap, - .letter = "A", - .left = 0, - .is_menu = 0, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "B", - .x = 50, - .y = 0, - .w = 36, - .h = 23, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = menu_label_width, - .lh = menu_label_height, - .lb = menu_label_bitmap, - .letter = "B", - .left = 0, - .is_menu = 0, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "C", - .x = 100, - .y = 0, - .w = 36, - .h = 23, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = menu_label_width, - .lh = menu_label_height, - .lb = menu_label_bitmap, - .letter = "C", - .left = 0, - .is_menu = 0, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "D", - .x = 150, - .y = 0, - .w = 36, - .h = 23, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = menu_label_width, - .lh = menu_label_height, - .lb = menu_label_bitmap, - .letter = "D", - .left = 0, - .is_menu = 0, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "E", - .x = 200, - .y = 0, - .w = 36, - .h = 23, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = menu_label_width, - .lh = menu_label_height, - .lb = menu_label_bitmap, - .letter = "E", - .left = 0, - .is_menu = 0, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "F", - .x = 250, - .y = 0, - .w = 36, - .h = 23, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = menu_label_width, - .lh = menu_label_height, - .lb = menu_label_bitmap, - .letter = "F", - .left = 0, - .is_menu = 0, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, - {.name = "MTH", - .x = 0, - .y = 50, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "MTH", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "G", - .left = "PRINT", - .is_menu = 1, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "PRG", - .x = 50, - .y = 50, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "PRG", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "H", - .left = "I/O", - .is_menu = 1, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "CST", - .x = 100, - .y = 50, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "CST", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "I", - .left = "MODES", - .is_menu = 1, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "VAR", - .x = 150, - .y = 50, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "VAR", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "J", - .left = "MEMORY", - .is_menu = 1, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "UP", - .x = 200, - .y = 50, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = up_width, - .lh = up_height, - .lb = up_bitmap, - .letter = "K", - .left = "LIBRARY", - .is_menu = 1, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "NXT", - .x = 250, - .y = 50, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "NXT", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "L", - .left = "PREV", - .is_menu = 0, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, - {.name = "COLON", - .x = 0, - .y = 100, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = colon_width, - .lh = colon_height, - .lb = colon_bitmap, - .letter = "M", - .left = "UP", - .is_menu = 0, - .right = "HOME", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "STO", - .x = 50, - .y = 100, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "STO", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "N", - .left = "DEF", - .is_menu = 0, - .right = "RCL", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "EVAL", - .x = 100, - .y = 100, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "EVAL", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "O", - .left = "aQ", - .is_menu = 0, - .right = "aNUM", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "LEFT", - .x = 150, - .y = 100, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = left_width, - .lh = left_height, - .lb = left_bitmap, - .letter = "P", - .left = "GRAPH", - .is_menu = 0, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "DOWN", - .x = 200, - .y = 100, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = down_width, - .lh = down_height, - .lb = down_bitmap, - .letter = "Q", - .left = "REVIEW", - .is_menu = 0, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "RIGHT", - .x = 250, - .y = 100, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = right_width, - .lh = right_height, - .lb = right_bitmap, - .letter = "R", - .left = "SWAP", - .is_menu = 0, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, - {.name = "SIN", - .x = 0, - .y = 150, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "SIN", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "S", - .left = "ASIN", - .is_menu = 0, - .right = "b", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "COS", - .x = 50, - .y = 150, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "COS", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "T", - .left = "ACOS", - .is_menu = 0, - .right = "c", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "TAN", - .x = 100, - .y = 150, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "TAN", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "U", - .left = "ATAN", - .is_menu = 0, - .right = "d", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "SQRT", - .x = 150, - .y = 150, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = sqrt_width, - .lh = sqrt_height, - .lb = sqrt_bitmap, - .letter = "V", - .left = "e", - .is_menu = 0, - .right = "f", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "POWER", - .x = 200, - .y = 150, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = power_width, - .lh = power_height, - .lb = power_bitmap, - .letter = "W", - .left = "g", - .is_menu = 0, - .right = "LOG", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "INV", - .x = 250, - .y = 150, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = inv_width, - .lh = inv_height, - .lb = inv_bitmap, - .letter = "X", - .left = "h", - .is_menu = 0, - .right = "LN", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, - {.name = "ENTER", - .x = 0, - .y = 200, - .w = 86, - .h = 26, - .lc = WHITE, - .label = "ENTER", - .font_size = 2, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "EQUATION", - .is_menu = 0, - .right = "MATRIX", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "NEG", - .x = 100, - .y = 200, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = neg_width, - .lh = neg_height, - .lb = neg_bitmap, - .letter = "Y", - .left = "EDIT", - .is_menu = 0, - .right = "VISIT", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "EEX", - .x = 150, - .y = 200, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "EEX", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "Z", - .left = "2D", - .is_menu = 0, - .right = "3D", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "DEL", - .x = 200, - .y = 200, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "DEL", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "PURGE", - .is_menu = 0, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "BS", - .x = 250, - .y = 200, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = bs_width, - .lh = bs_height, - .lb = bs_bitmap, - .letter = 0, - .left = "DROP", - .is_menu = 0, - .right = "CLR", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, - {.name = "ALPHA", - .x = 0, - .y = 250, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = alpha_width, - .lh = alpha_height, - .lb = alpha_bitmap, - .letter = 0, - .left = "USR", - .is_menu = 0, - .right = "ENTRY", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {"7", 60, 250, 46, 26, WHITE, "7", 1, 0, 0, 0, 0, "SOLVE", 1, 0, 0, 0, 0, 0}, - {.name = "8", - .x = 120, - .y = 250, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "8", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "PLOT", - .is_menu = 1, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "9", - .x = 180, - .y = 250, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "9", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "ALGEBRA", - .is_menu = 1, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "DIV", - .x = 240, - .y = 250, - .w = 46, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = div_width, - .lh = div_height, - .lb = div_bitmap, - .letter = 0, - .left = "( )", - .is_menu = 0, - .right = "#", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, - {.name = "SHL", - .x = 0, - .y = 300, - .w = 36, - .h = 26, - .lc = LEFT, - .label = 0, - .font_size = 0, - .lw = shl_width, - .lh = shl_height, - .lb = shl_bitmap, - .letter = 0, - .left = 0, - .is_menu = 0, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "4", - .x = 60, - .y = 300, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "4", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "TIME", - .is_menu = 1, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "5", - .x = 120, - .y = 300, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "5", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "STAT", - .is_menu = 1, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "6", - .x = 180, - .y = 300, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "6", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "UNITS", - .is_menu = 1, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "MUL", - .x = 240, - .y = 300, - .w = 46, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = mul_width, - .lh = mul_height, - .lb = mul_bitmap, - .letter = 0, - .left = "[ ]", - .is_menu = 0, - .right = "_", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, - {.name = "SHR", - .x = 0, - .y = 350, - .w = 36, - .h = 26, - .lc = RIGHT, - .label = 0, - .font_size = 0, - .lw = shr_width, - .lh = shr_height, - .lb = shr_bitmap, - .letter = 0, - .left = 0, - .is_menu = 0, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "1", - .x = 60, - .y = 350, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "1", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "RAD", - .is_menu = 0, - .right = "POLAR", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "2", - .x = 120, - .y = 350, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "2", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "STACK", - .is_menu = 0, - .right = "ARG", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "3", - .x = 180, - .y = 350, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "3", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "CMD", - .is_menu = 0, - .right = "MENU", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "MINUS", - .x = 240, - .y = 350, - .w = 46, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = minus_width, - .lh = minus_height, - .lb = minus_bitmap, - .letter = 0, - .left = "i", - .is_menu = 0, - .right = "j", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - - {.name = "ON", - .x = 0, - .y = 400, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "ON", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "CONT", - .is_menu = 0, - .right = "OFF", - .sub = "ATTN", - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "0", - .x = 60, - .y = 400, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "0", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "= ", - .is_menu = 0, - .right = " a", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "PERIOD", - .x = 120, - .y = 400, - .w = 46, - .h = 26, - .lc = WHITE, - .label = ".", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = ".", - .is_menu = 0, - .right = " k", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "SPC", - .x = 180, - .y = 400, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "SPC", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "l ", - .is_menu = 0, - .right = " m", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "PLUS", - .x = 240, - .y = 400, - .w = 46, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = plus_width, - .lh = plus_height, - .lb = plus_bitmap, - .letter = 0, - .left = "{ }", - .is_menu = 0, - .right = ": :", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, -}; - -static x11_button_t buttons_gx[] = { - {.name = "A", - .x = 0, - .y = 0, - .w = 36, - .h = 23, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = menu_label_width, - .lh = menu_label_height, - .lb = menu_label_bitmap, - .letter = "A", - .left = 0, - .is_menu = 0, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "B", - .x = 50, - .y = 0, - .w = 36, - .h = 23, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = menu_label_width, - .lh = menu_label_height, - .lb = menu_label_bitmap, - .letter = "B", - .left = 0, - .is_menu = 0, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "C", - .x = 100, - .y = 0, - .w = 36, - .h = 23, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = menu_label_width, - .lh = menu_label_height, - .lb = menu_label_bitmap, - .letter = "C", - .left = 0, - .is_menu = 0, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "D", - .x = 150, - .y = 0, - .w = 36, - .h = 23, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = menu_label_width, - .lh = menu_label_height, - .lb = menu_label_bitmap, - .letter = "D", - .left = 0, - .is_menu = 0, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "E", - .x = 200, - .y = 0, - .w = 36, - .h = 23, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = menu_label_width, - .lh = menu_label_height, - .lb = menu_label_bitmap, - .letter = "E", - .left = 0, - .is_menu = 0, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "F", - .x = 250, - .y = 0, - .w = 36, - .h = 23, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = menu_label_width, - .lh = menu_label_height, - .lb = menu_label_bitmap, - .letter = "F", - .left = 0, - .is_menu = 0, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - - {.name = "MTH", - .x = 0, - .y = 50, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "MTH", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "G", - .left = "RAD", - .is_menu = 0, - .right = "POLAR", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "PRG", - .x = 50, - .y = 50, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "PRG", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "H", - .left = 0, - .is_menu = 0, - .right = "CHARS", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "CST", - .x = 100, - .y = 50, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "CST", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "I", - .left = 0, - .is_menu = 0, - .right = "MODES", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "VAR", - .x = 150, - .y = 50, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "VAR", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "J", - .left = 0, - .is_menu = 0, - .right = "MEMORY", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "UP", - .x = 200, - .y = 50, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = up_width, - .lh = up_height, - .lb = up_bitmap, - .letter = "K", - .left = 0, - .is_menu = 0, - .right = "STACK", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "NXT", - .x = 250, - .y = 50, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "NXT", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "L", - .left = "PREV", - .is_menu = 0, - .right = "MENU", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - - {.name = "COLON", - .x = 0, - .y = 100, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = colon_width, - .lh = colon_height, - .lb = colon_bitmap, - .letter = "M", - .left = "UP", - .is_menu = 0, - .right = "HOME", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "STO", - .x = 50, - .y = 100, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "STO", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "N", - .left = "DEF", - .is_menu = 0, - .right = "RCL", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "EVAL", - .x = 100, - .y = 100, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "EVAL", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "O", - .left = "aNUM", - .is_menu = 0, - .right = "UNDO", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "LEFT", - .x = 150, - .y = 100, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = left_width, - .lh = left_height, - .lb = left_bitmap, - .letter = "P", - .left = "PICTURE", - .is_menu = 0, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "DOWN", - .x = 200, - .y = 100, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = down_width, - .lh = down_height, - .lb = down_bitmap, - .letter = "Q", - .left = "VIEW", - .is_menu = 0, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "RIGHT", - .x = 250, - .y = 100, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = right_width, - .lh = right_height, - .lb = right_bitmap, - .letter = "R", - .left = "SWAP", - .is_menu = 0, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - - {.name = "SIN", - .x = 0, - .y = 150, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "SIN", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "S", - .left = "ASIN", - .is_menu = 0, - .right = "b", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "COS", - .x = 50, - .y = 150, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "COS", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "T", - .left = "ACOS", - .is_menu = 0, - .right = "c", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "TAN", - .x = 100, - .y = 150, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "TAN", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "U", - .left = "ATAN", - .is_menu = 0, - .right = "d", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "SQRT", - .x = 150, - .y = 150, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = sqrt_width, - .lh = sqrt_height, - .lb = sqrt_bitmap, - .letter = "V", - .left = "n", - .is_menu = 0, - .right = "o", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "POWER", - .x = 200, - .y = 150, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = power_width, - .lh = power_height, - .lb = power_bitmap, - .letter = "W", - .left = "p", - .is_menu = 0, - .right = "LOG", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "INV", - .x = 250, - .y = 150, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = inv_width, - .lh = inv_height, - .lb = inv_bitmap, - .letter = "X", - .left = "q", - .is_menu = 0, - .right = "LN", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - - {.name = "ENTER", - .x = 0, - .y = 200, - .w = 86, - .h = 26, - .lc = WHITE, - .label = "ENTER", - .font_size = 2, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "EQUATION", - .is_menu = 0, - .right = "MATRIX", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "NEG", - .x = 100, - .y = 200, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = neg_width, - .lh = neg_height, - .lb = neg_bitmap, - .letter = "Y", - .left = "EDIT", - .is_menu = 0, - .right = "CMD", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "EEX", - .x = 150, - .y = 200, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "EEX", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = "Z", - .left = "PURG", - .is_menu = 0, - .right = "ARG", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "DEL", - .x = 200, - .y = 200, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "DEL", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "CLEAR", - .is_menu = 0, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "BS", - .x = 250, - .y = 200, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = bs_width, - .lh = bs_height, - .lb = bs_bitmap, - .letter = 0, - .left = "DROP", - .is_menu = 0, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - - {.name = "ALPHA", - .x = 0, - .y = 250, - .w = 36, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = alpha_width, - .lh = alpha_height, - .lb = alpha_bitmap, - .letter = 0, - .left = "USER", - .is_menu = 0, - .right = "ENTRY", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "7", - .x = 60, - .y = 250, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "7", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = 0, - .is_menu = 1, - .right = "SOLVE", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "8", - .x = 120, - .y = 250, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "8", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = 0, - .is_menu = 1, - .right = "PLOT", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "9", - .x = 180, - .y = 250, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "9", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = 0, - .is_menu = 1, - .right = "SYMBOLIC", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "DIV", - .x = 240, - .y = 250, - .w = 46, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = div_width, - .lh = div_height, - .lb = div_bitmap, - .letter = 0, - .left = "r ", - .is_menu = 0, - .right = "s", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - - {.name = "SHL", - .x = 0, - .y = 300, - .w = 36, - .h = 26, - .lc = LEFT, - .label = 0, - .font_size = 0, - .lw = shl_width, - .lh = shl_height, - .lb = shl_bitmap, - .letter = 0, - .left = 0, - .is_menu = 0, - .right = 0, - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "4", - .x = 60, - .y = 300, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "4", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = 0, - .is_menu = 1, - .right = "TIME", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "5", - .x = 120, - .y = 300, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "5", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = 0, - .is_menu = 1, - .right = "STAT", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "6", - .x = 180, - .y = 300, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "6", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = 0, - .is_menu = 1, - .right = "UNITS", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "MUL", - .x = 240, - .y = 300, - .w = 46, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = mul_width, - .lh = mul_height, - .lb = mul_bitmap, - .letter = 0, - .left = "t ", - .is_menu = 0, - .right = "u", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - - {.name = "SHR", - .x = 0, - .y = 350, - .w = 36, - .h = 26, - .lc = RIGHT, - .label = 0, - .font_size = 0, - .lw = shr_width, - .lh = shr_height, - .lb = shr_bitmap, - .letter = 0, - .left = 0, - .is_menu = 1, - .right = " ", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "1", - .x = 60, - .y = 350, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "1", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = 0, - .is_menu = 1, - .right = "I/O", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "2", - .x = 120, - .y = 350, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "2", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = 0, - .is_menu = 1, - .right = "LIBRARY", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "3", - .x = 180, - .y = 350, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "3", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = 0, - .is_menu = 1, - .right = "EQ LIB", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "MINUS", - .x = 240, - .y = 350, - .w = 46, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = minus_width, - .lh = minus_height, - .lb = minus_bitmap, - .letter = 0, - .left = "v ", - .is_menu = 0, - .right = "w", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - - {.name = "ON", - .x = 0, - .y = 400, - .w = 36, - .h = 26, - .lc = WHITE, - .label = "ON", - .font_size = 0, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "CONT", - .is_menu = 0, - .right = "OFF", - .sub = "CANCEL", - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "0", - .x = 60, - .y = 400, - .w = 46, - .h = 26, - .lc = WHITE, - .label = "0", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = "\004 ", - .is_menu = 0, - .right = "\003", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {.name = "PERIOD", - .x = 120, - .y = 400, - .w = 46, - .h = 26, - .lc = WHITE, - .label = ".", - .font_size = 1, - .lw = 0, - .lh = 0, - .lb = 0, - .letter = 0, - .left = ".", - .is_menu = 0, - .right = " k", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, - {"SPC", 180, 400, 46, 26, WHITE, "SPC", 0, 0, 0, 0, 0, "\005 ", 0, "z", 0, 0, 0, 0}, - {.name = "PLUS", - .x = 240, - .y = 400, - .w = 46, - .h = 26, - .lc = WHITE, - .label = 0, - .font_size = 0, - .lw = plus_width, - .lh = plus_height, - .lb = plus_bitmap, - .letter = 0, - .left = "x ", - .is_menu = 0, - .right = "y", - .sub = 0, - .map = 0, - .down = 0, - .xwin = 0 }, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, + {.map = 0, .down = 0, .xwin = 0}, }; #define MAX_PASTE 128 @@ -2553,26 +747,26 @@ static inline void __create_button( int i, int off_x, int off_y, XFontStruct* f_ /* * create the buttons subwindows */ - buttons[ i ].xwin = XCreateSimpleWindow( dpy, mainW, off_x + buttons[ i ].x, off_y + buttons[ i ].y, buttons[ i ].w, buttons[ i ].h, 0, - COLOR( BLACK ), pixel ); + x11_buttons[ i ].xwin = XCreateSimpleWindow( dpy, mainW, off_x + buttons[ i ].x, off_y + buttons[ i ].y, buttons[ i ].w, buttons[ i ].h, + 0, COLOR( BLACK ), pixel ); - XDefineCursor( dpy, buttons[ i ].xwin, XCreateFontCursor( dpy, XC_hand1 ) ); + XDefineCursor( dpy, x11_buttons[ i ].xwin, XCreateFontCursor( dpy, XC_hand1 ) ); xswa.event_mask = LeaveWindowMask | ExposureMask | StructureNotifyMask; xswa.backing_store = Always; - XChangeWindowAttributes( dpy, buttons[ i ].xwin, CWEventMask | CWBackingStore, &xswa ); + XChangeWindowAttributes( dpy, x11_buttons[ i ].xwin, CWEventMask | CWBackingStore, &xswa ); /* * draw the released button */ - buttons[ i ].map = XCreatePixmap( dpy, buttons[ i ].xwin, buttons[ i ].w, buttons[ i ].h, depth ); + x11_buttons[ i ].map = XCreatePixmap( dpy, x11_buttons[ i ].xwin, buttons[ i ].w, buttons[ i ].h, depth ); XSetForeground( dpy, gc, pixel ); - XFillRectangle( dpy, buttons[ i ].map, gc, 0, 0, buttons[ i ].w, buttons[ i ].h ); + XFillRectangle( dpy, x11_buttons[ i ].map, gc, 0, 0, buttons[ i ].w, buttons[ i ].h ); XSetForeground( dpy, gc, COLOR( BUTTON ) ); - XFillRectangle( dpy, buttons[ i ].map, gc, 1, 1, buttons[ i ].w - 2, buttons[ i ].h - 2 ); + XFillRectangle( dpy, x11_buttons[ i ].map, gc, 1, 1, buttons[ i ].w - 2, buttons[ i ].h - 2 ); if ( buttons[ i ].label != ( char* )0 ) { /* @@ -2605,7 +799,7 @@ static inline void __create_button( int i, int off_x, int off_y, XFontStruct* f_ XTextExtents( finfo, buttons[ i ].label, ( int )strlen( buttons[ i ].label ), &dir, &fa, &fd, &xchar ); x = ( buttons[ i ].w - xchar.width ) / 2; y = ( 1 + buttons[ i ].h - ( xchar.ascent + xchar.descent ) ) / 2 + xchar.ascent + 1; - XDrawImageString( dpy, buttons[ i ].map, gc, x, y, buttons[ i ].label, ( int )strlen( buttons[ i ].label ) ); + XDrawImageString( dpy, x11_buttons[ i ].map, gc, x, y, buttons[ i ].label, ( int )strlen( buttons[ i ].label ) ); XSetBackground( dpy, gc, COLOR( BLACK ) ); @@ -2616,12 +810,12 @@ static inline void __create_button( int i, int off_x, int off_y, XFontStruct* f_ XSetBackground( dpy, gc, COLOR( BUTTON ) ); XSetForeground( dpy, gc, COLOR( buttons[ i ].lc ) ); - pix = XCreateBitmapFromData( dpy, buttons[ i ].xwin, ( char* )buttons[ i ].lb, buttons[ i ].lw, buttons[ i ].lh ); + pix = XCreateBitmapFromData( dpy, x11_buttons[ i ].xwin, ( char* )buttons[ i ].lb, buttons[ i ].lw, buttons[ i ].lh ); x = ( 1 + buttons[ i ].w - buttons[ i ].lw ) / 2; y = ( 1 + buttons[ i ].h - buttons[ i ].lh ) / 2 + 1; - XCopyPlane( dpy, pix, buttons[ i ].map, gc, 0, 0, buttons[ i ].lw, buttons[ i ].lh, x, y, 1 ); + XCopyPlane( dpy, pix, x11_buttons[ i ].map, gc, 0, 0, buttons[ i ].lw, buttons[ i ].lh, x, y, 1 ); XFreePixmap( dpy, pix ); @@ -2633,59 +827,66 @@ static inline void __create_button( int i, int off_x, int off_y, XFontStruct* f_ */ XSetForeground( dpy, gc, COLOR( BUT_TOP ) ); - XDrawLine( dpy, buttons[ i ].map, gc, 1, ( int )( buttons[ i ].h - 2 ), 1, 1 ); - XDrawLine( dpy, buttons[ i ].map, gc, 2, ( int )( buttons[ i ].h - 3 ), 2, 2 ); - XDrawLine( dpy, buttons[ i ].map, gc, 3, ( int )( buttons[ i ].h - 4 ), 3, 3 ); + XDrawLine( dpy, x11_buttons[ i ].map, gc, 1, ( int )( buttons[ i ].h - 2 ), 1, 1 ); + XDrawLine( dpy, x11_buttons[ i ].map, gc, 2, ( int )( buttons[ i ].h - 3 ), 2, 2 ); + XDrawLine( dpy, x11_buttons[ i ].map, gc, 3, ( int )( buttons[ i ].h - 4 ), 3, 3 ); - XDrawLine( dpy, buttons[ i ].map, gc, 1, 1, ( int )( buttons[ i ].w - 2 ), 1 ); - XDrawLine( dpy, buttons[ i ].map, gc, 2, 2, ( int )( buttons[ i ].w - 3 ), 2 ); - XDrawLine( dpy, buttons[ i ].map, gc, 3, 3, ( int )( buttons[ i ].w - 4 ), 3 ); - XDrawLine( dpy, buttons[ i ].map, gc, 4, 4, ( int )( buttons[ i ].w - 5 ), 4 ); + XDrawLine( dpy, x11_buttons[ i ].map, gc, 1, 1, ( int )( buttons[ i ].w - 2 ), 1 ); + XDrawLine( dpy, x11_buttons[ i ].map, gc, 2, 2, ( int )( buttons[ i ].w - 3 ), 2 ); + XDrawLine( dpy, x11_buttons[ i ].map, gc, 3, 3, ( int )( buttons[ i ].w - 4 ), 3 ); + XDrawLine( dpy, x11_buttons[ i ].map, gc, 4, 4, ( int )( buttons[ i ].w - 5 ), 4 ); - XDrawPoint( dpy, buttons[ i ].map, gc, 4, 5 ); + XDrawPoint( dpy, x11_buttons[ i ].map, gc, 4, 5 ); XSetForeground( dpy, gc, COLOR( BUT_BOT ) ); - XDrawLine( dpy, buttons[ i ].map, gc, 3, ( int )( buttons[ i ].h - 2 ), ( int )( buttons[ i ].w - 2 ), ( int )( buttons[ i ].h - 2 ) ); - XDrawLine( dpy, buttons[ i ].map, gc, 4, ( int )( buttons[ i ].h - 3 ), ( int )( buttons[ i ].w - 3 ), ( int )( buttons[ i ].h - 3 ) ); + XDrawLine( dpy, x11_buttons[ i ].map, gc, 3, ( int )( buttons[ i ].h - 2 ), ( int )( buttons[ i ].w - 2 ), + ( int )( buttons[ i ].h - 2 ) ); + XDrawLine( dpy, x11_buttons[ i ].map, gc, 4, ( int )( buttons[ i ].h - 3 ), ( int )( buttons[ i ].w - 3 ), + ( int )( buttons[ i ].h - 3 ) ); - XDrawLine( dpy, buttons[ i ].map, gc, ( int )( buttons[ i ].w - 2 ), ( int )( buttons[ i ].h - 2 ), ( int )( buttons[ i ].w - 2 ), 3 ); - XDrawLine( dpy, buttons[ i ].map, gc, ( int )( buttons[ i ].w - 3 ), ( int )( buttons[ i ].h - 3 ), ( int )( buttons[ i ].w - 3 ), 4 ); - XDrawLine( dpy, buttons[ i ].map, gc, ( int )( buttons[ i ].w - 4 ), ( int )( buttons[ i ].h - 4 ), ( int )( buttons[ i ].w - 4 ), 5 ); + XDrawLine( dpy, x11_buttons[ i ].map, gc, ( int )( buttons[ i ].w - 2 ), ( int )( buttons[ i ].h - 2 ), ( int )( buttons[ i ].w - 2 ), + 3 ); + XDrawLine( dpy, x11_buttons[ i ].map, gc, ( int )( buttons[ i ].w - 3 ), ( int )( buttons[ i ].h - 3 ), ( int )( buttons[ i ].w - 3 ), + 4 ); + XDrawLine( dpy, x11_buttons[ i ].map, gc, ( int )( buttons[ i ].w - 4 ), ( int )( buttons[ i ].h - 4 ), ( int )( buttons[ i ].w - 4 ), + 5 ); - XDrawPoint( dpy, buttons[ i ].map, gc, ( int )( buttons[ i ].w - 5 ), ( int )( buttons[ i ].h - 4 ) ); + XDrawPoint( dpy, x11_buttons[ i ].map, gc, ( int )( buttons[ i ].w - 5 ), ( int )( buttons[ i ].h - 4 ) ); /* * draw frame around button */ XSetForeground( dpy, gc, COLOR( FRAME ) ); - XDrawLine( dpy, buttons[ i ].map, gc, 0, ( int )( buttons[ i ].h - 3 ), 0, 2 ); - XDrawLine( dpy, buttons[ i ].map, gc, 2, 0, ( int )( buttons[ i ].w - 3 ), 0 ); - XDrawLine( dpy, buttons[ i ].map, gc, 2, ( int )( buttons[ i ].h - 1 ), ( int )( buttons[ i ].w - 3 ), ( int )( buttons[ i ].h - 1 ) ); - XDrawLine( dpy, buttons[ i ].map, gc, ( int )( buttons[ i ].w - 1 ), ( int )( buttons[ i ].h - 3 ), ( int )( buttons[ i ].w - 1 ), 2 ); + XDrawLine( dpy, x11_buttons[ i ].map, gc, 0, ( int )( buttons[ i ].h - 3 ), 0, 2 ); + XDrawLine( dpy, x11_buttons[ i ].map, gc, 2, 0, ( int )( buttons[ i ].w - 3 ), 0 ); + XDrawLine( dpy, x11_buttons[ i ].map, gc, 2, ( int )( buttons[ i ].h - 1 ), ( int )( buttons[ i ].w - 3 ), + ( int )( buttons[ i ].h - 1 ) ); + XDrawLine( dpy, x11_buttons[ i ].map, gc, ( int )( buttons[ i ].w - 1 ), ( int )( buttons[ i ].h - 3 ), ( int )( buttons[ i ].w - 1 ), + 2 ); if ( i == HPKEY_ON ) { - XDrawLine( dpy, buttons[ i ].map, gc, 1, 1, ( int )( buttons[ i ].w - 2 ), 1 ); - XDrawPoint( dpy, buttons[ i ].map, gc, 1, 2 ); - XDrawPoint( dpy, buttons[ i ].map, gc, ( int )( buttons[ i ].w - 2 ), 2 ); + XDrawLine( dpy, x11_buttons[ i ].map, gc, 1, 1, ( int )( buttons[ i ].w - 2 ), 1 ); + XDrawPoint( dpy, x11_buttons[ i ].map, gc, 1, 2 ); + XDrawPoint( dpy, x11_buttons[ i ].map, gc, ( int )( buttons[ i ].w - 2 ), 2 ); } else { - XDrawPoint( dpy, buttons[ i ].map, gc, 1, 1 ); - XDrawPoint( dpy, buttons[ i ].map, gc, ( int )( buttons[ i ].w - 2 ), 1 ); + XDrawPoint( dpy, x11_buttons[ i ].map, gc, 1, 1 ); + XDrawPoint( dpy, x11_buttons[ i ].map, gc, ( int )( buttons[ i ].w - 2 ), 1 ); } - XDrawPoint( dpy, buttons[ i ].map, gc, 1, ( int )( buttons[ i ].h - 2 ) ); - XDrawPoint( dpy, buttons[ i ].map, gc, ( int )( buttons[ i ].w - 2 ), ( int )( buttons[ i ].h - 2 ) ); + XDrawPoint( dpy, x11_buttons[ i ].map, gc, 1, ( int )( buttons[ i ].h - 2 ) ); + XDrawPoint( dpy, x11_buttons[ i ].map, gc, ( int )( buttons[ i ].w - 2 ), ( int )( buttons[ i ].h - 2 ) ); /* * draw the depressed button */ - buttons[ i ].down = XCreatePixmap( dpy, buttons[ i ].xwin, buttons[ i ].w, buttons[ i ].h, depth ); + x11_buttons[ i ].down = XCreatePixmap( dpy, x11_buttons[ i ].xwin, buttons[ i ].w, buttons[ i ].h, depth ); XSetForeground( dpy, gc, pixel ); - XFillRectangle( dpy, buttons[ i ].down, gc, 0, 0, buttons[ i ].w, buttons[ i ].h ); + XFillRectangle( dpy, x11_buttons[ i ].down, gc, 0, 0, buttons[ i ].w, buttons[ i ].h ); XSetForeground( dpy, gc, COLOR( BUTTON ) ); - XFillRectangle( dpy, buttons[ i ].down, gc, 1, 1, buttons[ i ].w - 2, buttons[ i ].h - 2 ); + XFillRectangle( dpy, x11_buttons[ i ].down, gc, 1, 1, buttons[ i ].w - 2, buttons[ i ].h - 2 ); if ( buttons[ i ].label != ( char* )0 ) { /* @@ -2718,7 +919,7 @@ static inline void __create_button( int i, int off_x, int off_y, XFontStruct* f_ XTextExtents( finfo, buttons[ i ].label, ( int )strlen( buttons[ i ].label ), &dir, &fa, &fd, &xchar ); x = ( buttons[ i ].w - xchar.width ) / 2; y = ( 1 + buttons[ i ].h - ( xchar.ascent + xchar.descent ) ) / 2 + xchar.ascent; - XDrawImageString( dpy, buttons[ i ].down, gc, x, y, buttons[ i ].label, ( int )strlen( buttons[ i ].label ) ); + XDrawImageString( dpy, x11_buttons[ i ].down, gc, x, y, buttons[ i ].label, ( int )strlen( buttons[ i ].label ) ); XSetBackground( dpy, gc, COLOR( BLACK ) ); } else { @@ -2728,12 +929,12 @@ static inline void __create_button( int i, int off_x, int off_y, XFontStruct* f_ XSetBackground( dpy, gc, COLOR( BUTTON ) ); XSetForeground( dpy, gc, COLOR( buttons[ i ].lc ) ); - pix = XCreateBitmapFromData( dpy, buttons[ i ].xwin, ( char* )buttons[ i ].lb, buttons[ i ].lw, buttons[ i ].lh ); + pix = XCreateBitmapFromData( dpy, x11_buttons[ i ].xwin, ( char* )buttons[ i ].lb, buttons[ i ].lw, buttons[ i ].lh ); x = ( 1 + buttons[ i ].w - buttons[ i ].lw ) / 2; y = ( 1 + buttons[ i ].h - buttons[ i ].lh ) / 2; - XCopyPlane( dpy, pix, buttons[ i ].down, gc, 0, 0, buttons[ i ].lw, buttons[ i ].lh, x, y, 1 ); + XCopyPlane( dpy, pix, x11_buttons[ i ].down, gc, 0, 0, buttons[ i ].lw, buttons[ i ].lh, x, y, 1 ); XFreePixmap( dpy, pix ); @@ -2745,56 +946,62 @@ static inline void __create_button( int i, int off_x, int off_y, XFontStruct* f_ */ XSetForeground( dpy, gc, COLOR( BUT_TOP ) ); - XDrawLine( dpy, buttons[ i ].down, gc, 2, ( int )( buttons[ i ].h - 4 ), 2, 2 ); - XDrawLine( dpy, buttons[ i ].down, gc, 3, ( int )( buttons[ i ].h - 5 ), 3, 3 ); + XDrawLine( dpy, x11_buttons[ i ].down, gc, 2, ( int )( buttons[ i ].h - 4 ), 2, 2 ); + XDrawLine( dpy, x11_buttons[ i ].down, gc, 3, ( int )( buttons[ i ].h - 5 ), 3, 3 ); - XDrawLine( dpy, buttons[ i ].down, gc, 2, 2, ( int )( buttons[ i ].w - 4 ), 2 ); - XDrawLine( dpy, buttons[ i ].down, gc, 3, 3, ( int )( buttons[ i ].w - 5 ), 3 ); + XDrawLine( dpy, x11_buttons[ i ].down, gc, 2, 2, ( int )( buttons[ i ].w - 4 ), 2 ); + XDrawLine( dpy, x11_buttons[ i ].down, gc, 3, 3, ( int )( buttons[ i ].w - 5 ), 3 ); - XDrawPoint( dpy, buttons[ i ].down, gc, 4, 4 ); + XDrawPoint( dpy, x11_buttons[ i ].down, gc, 4, 4 ); XSetForeground( dpy, gc, COLOR( BUT_BOT ) ); - XDrawLine( dpy, buttons[ i ].down, gc, 3, ( int )( buttons[ i ].h - 3 ), ( int )( buttons[ i ].w - 3 ), ( int )( buttons[ i ].h - 3 ) ); - XDrawLine( dpy, buttons[ i ].down, gc, 4, ( int )( buttons[ i ].h - 4 ), ( int )( buttons[ i ].w - 4 ), ( int )( buttons[ i ].h - 4 ) ); + XDrawLine( dpy, x11_buttons[ i ].down, gc, 3, ( int )( buttons[ i ].h - 3 ), ( int )( buttons[ i ].w - 3 ), + ( int )( buttons[ i ].h - 3 ) ); + XDrawLine( dpy, x11_buttons[ i ].down, gc, 4, ( int )( buttons[ i ].h - 4 ), ( int )( buttons[ i ].w - 4 ), + ( int )( buttons[ i ].h - 4 ) ); - XDrawLine( dpy, buttons[ i ].down, gc, ( int )( buttons[ i ].w - 3 ), ( int )( buttons[ i ].h - 3 ), ( int )( buttons[ i ].w - 3 ), 3 ); - XDrawLine( dpy, buttons[ i ].down, gc, ( int )( buttons[ i ].w - 4 ), ( int )( buttons[ i ].h - 4 ), ( int )( buttons[ i ].w - 4 ), 4 ); + XDrawLine( dpy, x11_buttons[ i ].down, gc, ( int )( buttons[ i ].w - 3 ), ( int )( buttons[ i ].h - 3 ), ( int )( buttons[ i ].w - 3 ), + 3 ); + XDrawLine( dpy, x11_buttons[ i ].down, gc, ( int )( buttons[ i ].w - 4 ), ( int )( buttons[ i ].h - 4 ), ( int )( buttons[ i ].w - 4 ), + 4 ); - XDrawPoint( dpy, buttons[ i ].down, gc, ( int )( buttons[ i ].w - 5 ), ( int )( buttons[ i ].h - 5 ) ); + XDrawPoint( dpy, x11_buttons[ i ].down, gc, ( int )( buttons[ i ].w - 5 ), ( int )( buttons[ i ].h - 5 ) ); /* * draw frame around button */ XSetForeground( dpy, gc, COLOR( FRAME ) ); - XDrawLine( dpy, buttons[ i ].down, gc, 0, ( int )( buttons[ i ].h - 3 ), 0, 2 ); - XDrawLine( dpy, buttons[ i ].down, gc, 2, 0, ( int )( buttons[ i ].w - 3 ), 0 ); - XDrawLine( dpy, buttons[ i ].down, gc, 2, ( int )( buttons[ i ].h - 1 ), ( int )( buttons[ i ].w - 3 ), ( int )( buttons[ i ].h - 1 ) ); - XDrawLine( dpy, buttons[ i ].down, gc, ( int )( buttons[ i ].w - 1 ), ( int )( buttons[ i ].h - 3 ), ( int )( buttons[ i ].w - 1 ), 2 ); + XDrawLine( dpy, x11_buttons[ i ].down, gc, 0, ( int )( buttons[ i ].h - 3 ), 0, 2 ); + XDrawLine( dpy, x11_buttons[ i ].down, gc, 2, 0, ( int )( buttons[ i ].w - 3 ), 0 ); + XDrawLine( dpy, x11_buttons[ i ].down, gc, 2, ( int )( buttons[ i ].h - 1 ), ( int )( buttons[ i ].w - 3 ), + ( int )( buttons[ i ].h - 1 ) ); + XDrawLine( dpy, x11_buttons[ i ].down, gc, ( int )( buttons[ i ].w - 1 ), ( int )( buttons[ i ].h - 3 ), ( int )( buttons[ i ].w - 1 ), + 2 ); if ( i == HPKEY_ON ) { - XDrawLine( dpy, buttons[ i ].down, gc, 1, 1, ( int )( buttons[ i ].w - 2 ), 1 ); - XDrawPoint( dpy, buttons[ i ].down, gc, 1, 2 ); - XDrawPoint( dpy, buttons[ i ].down, gc, ( int )( buttons[ i ].w - 2 ), 2 ); + XDrawLine( dpy, x11_buttons[ i ].down, gc, 1, 1, ( int )( buttons[ i ].w - 2 ), 1 ); + XDrawPoint( dpy, x11_buttons[ i ].down, gc, 1, 2 ); + XDrawPoint( dpy, x11_buttons[ i ].down, gc, ( int )( buttons[ i ].w - 2 ), 2 ); } else { - XDrawPoint( dpy, buttons[ i ].down, gc, 1, 1 ); - XDrawPoint( dpy, buttons[ i ].down, gc, ( int )( buttons[ i ].w - 2 ), 1 ); + XDrawPoint( dpy, x11_buttons[ i ].down, gc, 1, 1 ); + XDrawPoint( dpy, x11_buttons[ i ].down, gc, ( int )( buttons[ i ].w - 2 ), 1 ); } - XDrawPoint( dpy, buttons[ i ].down, gc, 1, ( int )( buttons[ i ].h - 2 ) ); - XDrawPoint( dpy, buttons[ i ].down, gc, ( int )( buttons[ i ].w - 2 ), ( int )( buttons[ i ].h - 2 ) ); + XDrawPoint( dpy, x11_buttons[ i ].down, gc, 1, ( int )( buttons[ i ].h - 2 ) ); + XDrawPoint( dpy, x11_buttons[ i ].down, gc, ( int )( buttons[ i ].w - 2 ), ( int )( buttons[ i ].h - 2 ) ); if ( i == HPKEY_ON ) { - XDrawRectangle( dpy, buttons[ i ].down, gc, 1, 2, buttons[ i ].w - 3, buttons[ i ].h - 4 ); - XDrawPoint( dpy, buttons[ i ].down, gc, 2, 3 ); - XDrawPoint( dpy, buttons[ i ].down, gc, ( int )( buttons[ i ].w - 3 ), 3 ); + XDrawRectangle( dpy, x11_buttons[ i ].down, gc, 1, 2, buttons[ i ].w - 3, buttons[ i ].h - 4 ); + XDrawPoint( dpy, x11_buttons[ i ].down, gc, 2, 3 ); + XDrawPoint( dpy, x11_buttons[ i ].down, gc, ( int )( buttons[ i ].w - 3 ), 3 ); } else { - XDrawRectangle( dpy, buttons[ i ].down, gc, 1, 1, buttons[ i ].w - 3, buttons[ i ].h - 3 ); - XDrawPoint( dpy, buttons[ i ].down, gc, 2, 2 ); - XDrawPoint( dpy, buttons[ i ].down, gc, ( int )( buttons[ i ].w - 3 ), 2 ); + XDrawRectangle( dpy, x11_buttons[ i ].down, gc, 1, 1, buttons[ i ].w - 3, buttons[ i ].h - 3 ); + XDrawPoint( dpy, x11_buttons[ i ].down, gc, 2, 2 ); + XDrawPoint( dpy, x11_buttons[ i ].down, gc, ( int )( buttons[ i ].w - 3 ), 2 ); } - XDrawPoint( dpy, buttons[ i ].down, gc, 2, ( int )( buttons[ i ].h - 3 ) ); - XDrawPoint( dpy, buttons[ i ].down, gc, ( int )( buttons[ i ].w - 3 ), ( int )( buttons[ i ].h - 3 ) ); + XDrawPoint( dpy, x11_buttons[ i ].down, gc, 2, ( int )( buttons[ i ].h - 3 ) ); + XDrawPoint( dpy, x11_buttons[ i ].down, gc, ( int )( buttons[ i ].w - 3 ), ( int )( buttons[ i ].h - 3 ) ); } static inline void __create_keypad( unsigned int offset_y, unsigned int offset_x, x11_keypad_t* local_keypad ) @@ -3321,8 +1528,8 @@ static void draw_keypad( void ) { XCopyArea( dpy, keypad.pixmap, mainW, gc, 0, 0 static inline void draw_button( int i ) { - XCopyArea( dpy, ( keyboard[ i ].pressed ) ? buttons[ i ].down : buttons[ i ].map, buttons[ i ].xwin, gc, 0, 0, buttons[ i ].w, - buttons[ i ].h, 0, 0 ); + XCopyArea( dpy, ( keyboard[ i ].pressed ) ? x11_buttons[ i ].down : x11_buttons[ i ].map, x11_buttons[ i ].xwin, gc, 0, 0, + buttons[ i ].w, buttons[ i ].h, 0, 0 ); } static inline void _create_icon( void ) @@ -4354,7 +2561,7 @@ void x11_get_event( void ) draw_keypad(); else for ( i = FIRST_HPKEY; i <= LAST_HPKEY; i++ ) { - if ( xev.xexpose.window == buttons[ i ].xwin ) { + if ( xev.xexpose.window == x11_buttons[ i ].xwin ) { draw_button( i ); break; } @@ -4732,7 +2939,7 @@ void x11_get_event( void ) } else { if ( xev.xbutton.button == Button1 || xev.xbutton.button == Button2 || xev.xbutton.button == Button3 ) { for ( i = FIRST_HPKEY; i <= LAST_HPKEY; i++ ) { - if ( xev.xbutton.subwindow == buttons[ i ].xwin ) { + if ( xev.xbutton.subwindow == x11_buttons[ i ].xwin ) { if ( keyboard[ i ].pressed ) { if ( xev.xbutton.button == Button3 ) { release_key( i );