diff --git a/src/x49gpng/ui.c b/src/x49gpng/ui.c index 6830a01..fcff605 100644 --- a/src/x49gpng/ui.c +++ b/src/x49gpng/ui.c @@ -29,2159 +29,11 @@ #include "gdbstub.h" -#define DEBUG_LAYOUT true +#define DEBUG_LAYOUT false -static const x49gp_ui_key_t x49gp_ui_keys[] = { - {.label = "F1", - .letter = "A", - .left = "Y=", - .right = NULL, - .below = NULL, - .color = UI_COLOR_BLACK, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_TINY, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 0, - .y = 0, - .width = 36, - .height = 22, - .column = 5, - .row = 1, - .columnbit = ( 1 << 5 ), - .rowbit = ( 1 << 1 ), - .eint = 1, - .bg_color = UI_COLOR_GRAYSCALE_5}, - {.label = "F2", - .letter = "B", - .left = "WIN", - .right = NULL, - .below = NULL, - .color = UI_COLOR_BLACK, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_TINY, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 50, - .y = 0, - .width = 36, - .height = 22, - .column = 5, - .row = 2, - .columnbit = ( 1 << 5 ), - .rowbit = ( 1 << 2 ), - .eint = 2, - .bg_color = UI_COLOR_GRAYSCALE_5}, - {.label = "F3", - .letter = "C", - .left = "GRAPH", - .right = NULL, - .below = NULL, - .color = UI_COLOR_BLACK, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_TINY, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 99, - .y = 0, - .width = 36, - .height = 22, - .column = 5, - .row = 3, - .columnbit = ( 1 << 5 ), - .rowbit = ( 1 << 3 ), - .eint = 3, - .bg_color = UI_COLOR_GRAYSCALE_5}, - {.label = "F4", - .letter = "D", - .left = "2D/3D", - .right = NULL, - .below = NULL, - .color = UI_COLOR_BLACK, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_TINY, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 149, - .y = 0, - .width = 36, - .height = 22, - .column = 5, - .row = 4, - .columnbit = ( 1 << 5 ), - .rowbit = ( 1 << 4 ), - .eint = 4, - .bg_color = UI_COLOR_GRAYSCALE_5}, - {.label = "F5", - .letter = "E", - .left = "TBLSET", - .right = NULL, - .below = NULL, - .color = UI_COLOR_BLACK, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_TINY, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 198, - .y = 0, - .width = 36, - .height = 22, - .column = 5, - .row = 5, - .columnbit = ( 1 << 5 ), - .rowbit = ( 1 << 5 ), - .eint = 5, - .bg_color = UI_COLOR_GRAYSCALE_5}, - {.label = "F6", - .letter = "F", - .left = "TABLE", - .right = NULL, - .below = NULL, - .color = UI_COLOR_BLACK, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_TINY, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 247, - .y = 0, - .width = 36, - .height = 22, - .column = 5, - .row = 6, - .columnbit = ( 1 << 5 ), - .rowbit = ( 1 << 6 ), - .eint = 6, - .bg_color = UI_COLOR_GRAYSCALE_5}, - {.label = "APPS", - .letter = "G", - .left = "FILES", - .right = "BEGIN", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 10.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_SMALL, - .letter_size = 10.0, - .layout = UI_LAYOUT_BELOW, - .x = 0, - .y = 44, - .width = 36, - .height = 28, - .column = 5, - .row = 7, - .columnbit = ( 1 << 5 ), - .rowbit = ( 1 << 7 ), - .eint = 7, - .bg_color = UI_COLOR_BLACK }, - {.label = "MODE", - .letter = "H", - .left = "CUSTOM", - .right = "END", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 10.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_SMALL, - .letter_size = 10.0, - .layout = UI_LAYOUT_BELOW, - .x = 50, - .y = 44, - .width = 36, - .height = 28, - .column = 6, - .row = 5, - .columnbit = ( 1 << 6 ), - .rowbit = ( 1 << 5 ), - .eint = 5, - .bg_color = UI_COLOR_BLACK }, - {.label = "TOOL", - .letter = "I", - .left = "i", - .right = "I", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 10.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_SMALL, - .letter_size = 10.0, - .layout = UI_LAYOUT_BELOW, - .x = 99, - .y = 44, - .width = 36, - .height = 28, - .column = 6, - .row = 6, - .columnbit = ( 1 << 6 ), - .rowbit = ( 1 << 6 ), - .eint = 6, - .bg_color = UI_COLOR_BLACK }, - {.label = "V\\kern-1 AR", - .letter = "J", - .left = "UPDIR", - .right = "COPY", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 10.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_SMALL, - .letter_size = 10.0, - .layout = UI_LAYOUT_BELOW, - .x = 0, - .y = 92, - .width = 36, - .height = 28, - .column = 6, - .row = 7, - .columnbit = ( 1 << 6 ), - .rowbit = ( 1 << 7 ), - .eint = 7, - .bg_color = UI_COLOR_BLACK }, - {.label = "STO \\triangleright", - .letter = "K", - .left = "RCL", - .right = "CUT", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 10.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_SMALL, - .letter_size = 10.0, - .layout = UI_LAYOUT_BELOW, - .x = 50, - .y = 92, - .width = 36, - .height = 28, - .column = 7, - .row = 1, - .columnbit = ( 1 << 7 ), - .rowbit = ( 1 << 1 ), - .eint = 1, - .bg_color = UI_COLOR_BLACK }, - {.label = "NXT", - .letter = "L", - .left = "PREV", - .right = "PASTE", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 10.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_SMALL, - .letter_size = 10.0, - .layout = UI_LAYOUT_BELOW, - .x = 99, - .y = 92, - .width = 36, - .height = 28, - .column = 7, - .row = 2, - .columnbit = ( 1 << 7 ), - .rowbit = ( 1 << 2 ), - .eint = 2, - .bg_color = UI_COLOR_BLACK }, - {.label = NULL, - .letter = NULL, - .left = NULL, - .right = NULL, - .below = NULL, - .color = UI_COLOR_BLACK, - .font_size = 0.0, - .font_weight = 0, - .shape = UI_SHAPE_BUTTON_ROUND, - .letter_size = 0.0, - .layout = 0, - .x = 200, - .y = 38, - .width = 33, - .height = 33, - .column = 6, - .row = 1, - .columnbit = ( 1 << 6 ), - .rowbit = ( 1 << 1 ), - .eint = 1, - .bg_color = UI_COLOR_SILVER }, - {.label = NULL, - .letter = NULL, - .left = NULL, - .right = NULL, - .below = NULL, - .color = UI_COLOR_BLACK, - .font_size = 0.0, - .font_weight = 0, - .shape = UI_SHAPE_BUTTON_ROUND, - .letter_size = 0.0, - .layout = 0, - .x = 164, - .y = 66, - .width = 33, - .height = 33, - .column = 6, - .row = 2, - .columnbit = ( 1 << 6 ), - .rowbit = ( 1 << 2 ), - .eint = 2, - .bg_color = UI_COLOR_SILVER }, - {.label = NULL, - .letter = NULL, - .left = NULL, - .right = NULL, - .below = NULL, - .color = UI_COLOR_BLACK, - .font_size = 0.0, - .font_weight = 0, - .shape = UI_SHAPE_BUTTON_ROUND, - .letter_size = 0.0, - .layout = 0, - .x = 200, - .y = 94, - .width = 33, - .height = 33, - .column = 6, - .row = 3, - .columnbit = ( 1 << 6 ), - .rowbit = ( 1 << 3 ), - .eint = 3, - .bg_color = UI_COLOR_SILVER }, - {.label = NULL, - .letter = NULL, - .left = NULL, - .right = NULL, - .below = NULL, - .color = UI_COLOR_BLACK, - .font_size = 0.0, - .font_weight = 0, - .shape = UI_SHAPE_BUTTON_ROUND, - .letter_size = 0.0, - .layout = 0, - .x = 236, - .y = 66, - .width = 33, - .height = 33, - .column = 6, - .row = 4, - .columnbit = ( 1 << 6 ), - .rowbit = ( 1 << 4 ), - .eint = 4, - .bg_color = UI_COLOR_SILVER }, - {.label = "HIST", - .letter = "M", - .left = "CMD", - .right = "UNDO", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_NORMAL, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 0, - .y = 141, - .width = 46, - .height = 28, - .column = 4, - .row = 1, - .columnbit = ( 1 << 4 ), - .rowbit = ( 1 << 1 ), - .eint = 1, - .bg_color = UI_COLOR_BLACK }, - {.label = "EV\\kern-1 AL", - .letter = "N", - .left = "PRG", - .right = "CHARS", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_NORMAL, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 59, - .y = 141, - .width = 46, - .height = 28, - .column = 3, - .row = 1, - .columnbit = ( 1 << 3 ), - .rowbit = ( 1 << 1 ), - .eint = 1, - .bg_color = UI_COLOR_BLACK }, - {.label = "\\tick", - .letter = "O", - .left = "MTRW", - .right = "EQW", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_NORMAL, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 119, - .y = 141, - .width = 46, - .height = 28, - .column = 2, - .row = 1, - .columnbit = ( 1 << 2 ), - .rowbit = ( 1 << 1 ), - .eint = 1, - .bg_color = UI_COLOR_BLACK }, - {.label = "S\\kern-1 Y\\kern-1 M\\kern-1 B", - .letter = "P", - .left = "MTH", - .right = "CAT", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_NORMAL, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 179, - .y = 141, - .width = 46, - .height = 28, - .column = 1, - .row = 1, - .columnbit = ( 1 << 1 ), - .rowbit = ( 1 << 1 ), - .eint = 1, - .bg_color = UI_COLOR_BLACK }, - {.label = "\\arrowleftdblfull", - .letter = NULL, - .left = "DEL", - .right = "CLEAR", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_NORMAL, - .letter_size = 0.0, - .layout = 0, - .x = 238, - .y = 141, - .width = 46, - .height = 28, - .column = 0, - .row = 1, - .columnbit = ( 1 << 0 ), - .rowbit = ( 1 << 1 ), - .eint = 1, - .bg_color = UI_COLOR_BLACK }, - {.label = "Y\\super x\\/super", - .letter = "Q", - .left = "\\math_e\\xsuperior", - .right = "LN", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_NORMAL, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 0, - .y = 183, - .width = 46, - .height = 28, - .column = 4, - .row = 2, - .columnbit = ( 1 << 4 ), - .rowbit = ( 1 << 2 ), - .eint = 2, - .bg_color = UI_COLOR_BLACK }, - {.label = "\\radical\\overscore\\kern-7 X", - .letter = "R", - .left = "\\math_x\\twosuperior", - .right = "\\xsuperior\\kern-4\\math_radical\\overscore\\kern-5\\math_y", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_NORMAL, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 59, - .y = 183, - .width = 46, - .height = 28, - .column = 3, - .row = 2, - .columnbit = ( 1 << 3 ), - .rowbit = ( 1 << 2 ), - .eint = 2, - .bg_color = UI_COLOR_BLACK }, - {.label = "SIN", - .letter = "S", - .left = "ASIN", - .right = "\\math_summation", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_NORMAL, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 119, - .y = 183, - .width = 46, - .height = 28, - .column = 2, - .row = 2, - .columnbit = ( 1 << 2 ), - .rowbit = ( 1 << 2 ), - .eint = 2, - .bg_color = UI_COLOR_BLACK }, - {.label = "COS", - .letter = "T", - .left = "ACOS", - .right = "\\math_partialdiff", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_NORMAL, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 179, - .y = 183, - .width = 46, - .height = 28, - .column = 1, - .row = 2, - .columnbit = ( 1 << 1 ), - .rowbit = ( 1 << 2 ), - .eint = 2, - .bg_color = UI_COLOR_BLACK }, - {.label = "TAN", - .letter = "U", - .left = "ATAN", - .right = "\\math_integral", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_NORMAL, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 238, - .y = 183, - .width = 46, - .height = 28, - .column = 0, - .row = 2, - .columnbit = ( 1 << 0 ), - .rowbit = ( 1 << 2 ), - .eint = 2, - .bg_color = UI_COLOR_BLACK }, - {.label = "EEX", - .letter = "V", - .left = "10\\xsuperior", - .right = "LOG", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_NORMAL, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 0, - .y = 225, - .width = 46, - .height = 28, - .column = 4, - .row = 3, - .columnbit = ( 1 << 4 ), - .rowbit = ( 1 << 3 ), - .eint = 3, - .bg_color = UI_COLOR_BLACK }, - {.label = "+\\divisionslash\\minus", - .letter = "W", - .left = "\\math_notequal", - .right = "\\math_equal", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_NORMAL, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 59, - .y = 225, - .width = 46, - .height = 28, - .column = 3, - .row = 3, - .columnbit = ( 1 << 3 ), - .rowbit = ( 1 << 3 ), - .eint = 3, - .bg_color = UI_COLOR_BLACK }, - {.label = "X", - .letter = "X", - .left = "\\math_lessequal", - .right = "\\math_less", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_NORMAL, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 119, - .y = 225, - .width = 46, - .height = 28, - .column = 2, - .row = 3, - .columnbit = ( 1 << 2 ), - .rowbit = ( 1 << 3 ), - .eint = 3, - .bg_color = UI_COLOR_BLACK }, - {.label = "1/X", - .letter = "Y", - .left = "\\math_greaterequal", - .right = "\\math_greater", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_NORMAL, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 179, - .y = 225, - .width = 46, - .height = 28, - .column = 1, - .row = 3, - .columnbit = ( 1 << 1 ), - .rowbit = ( 1 << 3 ), - .eint = 3, - .bg_color = UI_COLOR_BLACK }, - {.label = "\\divide", - .letter = "Z", - .left = "ABS", - .right = "ARG", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_NORMAL, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT_NO_SPACE, - .x = 238, - .y = 225, - .width = 46, - .height = 28, - .column = 0, - .row = 3, - .columnbit = ( 1 << 0 ), - .rowbit = ( 1 << 3 ), - .eint = 3, - .bg_color = UI_COLOR_BLACK }, - {.label = "ALPHA", - .letter = NULL, - .left = "USER", - .right = "ENTRY", - .below = NULL, - .color = UI_COLOR_BLACK, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 0, - .y = 267, - .width = 46, - .height = 32, - .column = 0, - .row = 0, - .columnbit = 0, - .rowbit = 0, - .eint = 4, - .bg_color = UI_COLOR_YELLOW }, - {.label = "7", - .letter = NULL, - .left = "S.SLV", - .right = "NUM.SLV", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 59, - .y = 267, - .width = 46, - .height = 32, - .column = 3, - .row = 4, - .columnbit = ( 1 << 3 ), - .rowbit = ( 1 << 4 ), - .eint = 4, - .bg_color = UI_COLOR_BLACK }, - {.label = "8", - .letter = NULL, - .left = "EXP&LN", - .right = "TRIG", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 119, - .y = 267, - .width = 46, - .height = 32, - .column = 2, - .row = 4, - .columnbit = ( 1 << 2 ), - .rowbit = ( 1 << 4 ), - .eint = 4, - .bg_color = UI_COLOR_BLACK }, - {.label = "9", - .letter = NULL, - .left = "FINANCE", - .right = "TIME", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 179, - .y = 267, - .width = 46, - .height = 32, - .column = 1, - .row = 4, - .columnbit = ( 1 << 1 ), - .rowbit = ( 1 << 4 ), - .eint = 4, - .bg_color = UI_COLOR_BLACK }, - {.label = "\\multiply", - .letter = NULL, - .left = "[ ]", - .right = "\" \"", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 238, - .y = 267, - .width = 46, - .height = 32, - .column = 0, - .row = 4, - .columnbit = ( 1 << 0 ), - .rowbit = ( 1 << 4 ), - .eint = 4, - .bg_color = UI_COLOR_BLACK }, - {.label = "\\uparrowleft", - .letter = NULL, - .left = NULL, - .right = NULL, - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 0, - .y = 313, - .width = 46, - .height = 32, - .column = 0, - .row = 0, - .columnbit = 0, - .rowbit = 0, - .eint = 5, - .bg_color = UI_COLOR_WHITE }, - {.label = "4", - .letter = NULL, - .left = "CALC", - .right = "ALG", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 59, - .y = 313, - .width = 46, - .height = 32, - .column = 3, - .row = 5, - .columnbit = ( 1 << 3 ), - .rowbit = ( 1 << 5 ), - .eint = 5, - .bg_color = UI_COLOR_BLACK }, - {.label = "5", - .letter = NULL, - .left = "MATRICES", - .right = "STAT", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 119, - .y = 313, - .width = 46, - .height = 32, - .column = 2, - .row = 5, - .columnbit = ( 1 << 2 ), - .rowbit = ( 1 << 5 ), - .eint = 5, - .bg_color = UI_COLOR_BLACK }, - {.label = "6", - .letter = NULL, - .left = "CONVERT", - .right = "UNITS", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 179, - .y = 313, - .width = 46, - .height = 32, - .column = 1, - .row = 5, - .columnbit = ( 1 << 1 ), - .rowbit = ( 1 << 5 ), - .eint = 5, - .bg_color = UI_COLOR_BLACK }, - {.label = "\\minus", - .letter = NULL, - .left = "( )", - .right = "_", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 238, - .y = 313, - .width = 46, - .height = 32, - .column = 0, - .row = 5, - .columnbit = ( 1 << 0 ), - .rowbit = ( 1 << 5 ), - .eint = 5, - .bg_color = UI_COLOR_BLACK }, - {.label = "\\uparrowright", - .letter = NULL, - .left = NULL, - .right = NULL, - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 0, - .y = 359, - .width = 46, - .height = 32, - .column = 0, - .row = 0, - .columnbit = 0, - .rowbit = 0, - .eint = 6, - .bg_color = UI_COLOR_ORANGE }, - {.label = "1", - .letter = NULL, - .left = "ARITH", - .right = "CMPLX", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 59, - .y = 359, - .width = 46, - .height = 32, - .column = 3, - .row = 6, - .columnbit = ( 1 << 3 ), - .rowbit = ( 1 << 6 ), - .eint = 6, - .bg_color = UI_COLOR_BLACK }, - {.label = "2", - .letter = NULL, - .left = "DEF", - .right = "LIB", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 119, - .y = 359, - .width = 46, - .height = 32, - .column = 2, - .row = 6, - .columnbit = ( 1 << 2 ), - .rowbit = ( 1 << 6 ), - .eint = 6, - .bg_color = UI_COLOR_BLACK }, - {.label = "3", - .letter = NULL, - .left = "\\math_numbersign", - .right = "BASE", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 179, - .y = 359, - .width = 46, - .height = 32, - .column = 1, - .row = 6, - .columnbit = ( 1 << 1 ), - .rowbit = ( 1 << 6 ), - .eint = 6, - .bg_color = UI_COLOR_BLACK }, - {.label = "+", - .letter = NULL, - .left = "{ }", - .right = "\\guillemotleft\\ \\guillemotright", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 238, - .y = 359, - .width = 46, - .height = 32, - .column = 0, - .row = 6, - .columnbit = ( 1 << 0 ), - .rowbit = ( 1 << 6 ), - .eint = 6, - .bg_color = UI_COLOR_BLACK }, - {.label = "ON", - .letter = NULL, - .left = "CONT", - .right = "OFF", - .below = "CANCEL", - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 0, - .y = 405, - .width = 46, - .height = 32, - .column = 0, - .row = 0, - .columnbit = 0, - .rowbit = 0, - .eint = 0, - .bg_color = UI_COLOR_BLACK }, - {.label = "0", - .letter = NULL, - .left = "\\math_infinity", - .right = "\\math_arrowright", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 59, - .y = 405, - .width = 46, - .height = 32, - .column = 3, - .row = 7, - .columnbit = ( 1 << 3 ), - .rowbit = ( 1 << 7 ), - .eint = 7, - .bg_color = UI_COLOR_BLACK }, - {.label = "\\bullet", - .letter = NULL, - .left = ": :", - .right = "\\math_downarrowleft", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 119, - .y = 405, - .width = 46, - .height = 32, - .column = 2, - .row = 7, - .columnbit = ( 1 << 2 ), - .rowbit = ( 1 << 7 ), - .eint = 7, - .bg_color = UI_COLOR_BLACK }, - {.label = "SPC", - .letter = NULL, - .left = "\\math_pi", - .right = "\\large_comma", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 179, - .y = 405, - .width = 46, - .height = 32, - .column = 1, - .row = 7, - .columnbit = ( 1 << 1 ), - .rowbit = ( 1 << 7 ), - .eint = 7, - .bg_color = UI_COLOR_BLACK }, - {.label = "ENTER", - .letter = NULL, - .left = "ANS", - .right = "\\arrowright NUM", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 238, - .y = 405, - .width = 46, - .height = 32, - .column = 0, - .row = 7, - .columnbit = ( 1 << 0 ), - .rowbit = ( 1 << 7 ), - .eint = 7, - .bg_color = UI_COLOR_BLACK }, -}; -#define X49GP_UI_NR_KEYS ( sizeof( x49gp_ui_keys ) / sizeof( x49gp_ui_keys[ 0 ] ) ) +#define NB_KEYS 51 -static const x49gp_ui_key_t x49gp_newrpl_ui_keys[] = { - {.label = "F1", - .letter = "A", - .left = NULL, - .right = NULL, - .below = NULL, - .color = UI_COLOR_BLACK, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_TINY, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 0, - .y = 0, - .width = 36, - .height = 22, - .column = 5, - .row = 1, - .columnbit = ( 1 << 5 ), - .rowbit = ( 1 << 1 ), - .eint = 1, - .bg_color = UI_COLOR_GRAYSCALE_5}, - {.label = "F2", - .letter = "B", - .left = NULL, - .right = NULL, - .below = NULL, - .color = UI_COLOR_BLACK, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_TINY, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 50, - .y = 0, - .width = 36, - .height = 22, - .column = 5, - .row = 2, - .columnbit = ( 1 << 5 ), - .rowbit = ( 1 << 2 ), - .eint = 2, - .bg_color = UI_COLOR_GRAYSCALE_5}, - {.label = "F3", - .letter = "C", - .left = NULL, - .right = NULL, - .below = NULL, - .color = UI_COLOR_BLACK, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_TINY, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 99, - .y = 0, - .width = 36, - .height = 22, - .column = 5, - .row = 3, - .columnbit = ( 1 << 5 ), - .rowbit = ( 1 << 3 ), - .eint = 3, - .bg_color = UI_COLOR_GRAYSCALE_5}, - {.label = "F4", - .letter = "D", - .left = NULL, - .right = NULL, - .below = NULL, - .color = UI_COLOR_BLACK, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_TINY, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 149, - .y = 0, - .width = 36, - .height = 22, - .column = 5, - .row = 4, - .columnbit = ( 1 << 5 ), - .rowbit = ( 1 << 4 ), - .eint = 4, - .bg_color = UI_COLOR_GRAYSCALE_5}, - {.label = "F5", - .letter = "E", - .left = NULL, - .right = NULL, - .below = NULL, - .color = UI_COLOR_BLACK, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_TINY, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 198, - .y = 0, - .width = 36, - .height = 22, - .column = 5, - .row = 5, - .columnbit = ( 1 << 5 ), - .rowbit = ( 1 << 5 ), - .eint = 5, - .bg_color = UI_COLOR_GRAYSCALE_5}, - {.label = "F6", - .letter = "F", - .left = NULL, - .right = NULL, - .below = NULL, - .color = UI_COLOR_BLACK, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_TINY, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 247, - .y = 0, - .width = 36, - .height = 22, - .column = 5, - .row = 6, - .columnbit = ( 1 << 5 ), - .rowbit = ( 1 << 6 ), - .eint = 6, - .bg_color = UI_COLOR_GRAYSCALE_5}, - {.label = "", - .letter = "G", - .left = NULL, - .right = NULL, - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 10.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_SMALL, - .letter_size = 10.0, - .layout = UI_LAYOUT_BELOW, - .x = 0, - .y = 44, - .width = 36, - .height = 28, - .column = 5, - .row = 7, - .columnbit = ( 1 << 5 ), - .rowbit = ( 1 << 7 ), - .eint = 7, - .bg_color = UI_COLOR_BLACK }, - {.label = "", - .letter = "H", - .left = NULL, - .right = NULL, - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 10.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_SMALL, - .letter_size = 10.0, - .layout = UI_LAYOUT_BELOW, - .x = 50, - .y = 44, - .width = 36, - .height = 28, - .column = 6, - .row = 5, - .columnbit = ( 1 << 6 ), - .rowbit = ( 1 << 5 ), - .eint = 5, - .bg_color = UI_COLOR_BLACK }, - {.label = "", - .letter = "I", - .left = NULL, - .right = NULL, - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 10.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_SMALL, - .letter_size = 10.0, - .layout = UI_LAYOUT_BELOW, - .x = 99, - .y = 44, - .width = 36, - .height = 28, - .column = 6, - .row = 6, - .columnbit = ( 1 << 6 ), - .rowbit = ( 1 << 6 ), - .eint = 6, - .bg_color = UI_COLOR_BLACK }, - {.label = "", - .letter = "J", - .left = NULL, - .right = NULL, - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 10.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_SMALL, - .letter_size = 10.0, - .layout = UI_LAYOUT_BELOW, - .x = 0, - .y = 92, - .width = 36, - .height = 28, - .column = 6, - .row = 7, - .columnbit = ( 1 << 6 ), - .rowbit = ( 1 << 7 ), - .eint = 7, - .bg_color = UI_COLOR_BLACK }, - {.label = "", - .letter = "K", - .left = NULL, - .right = NULL, - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 10.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_SMALL, - .letter_size = 10.0, - .layout = UI_LAYOUT_BELOW, - .x = 50, - .y = 92, - .width = 36, - .height = 28, - .column = 7, - .row = 1, - .columnbit = ( 1 << 7 ), - .rowbit = ( 1 << 1 ), - .eint = 1, - .bg_color = UI_COLOR_BLACK }, - {.label = "", - .letter = "L", - .left = NULL, - .right = NULL, - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 10.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_SMALL, - .letter_size = 10.0, - .layout = UI_LAYOUT_BELOW, - .x = 99, - .y = 92, - .width = 36, - .height = 28, - .column = 7, - .row = 2, - .columnbit = ( 1 << 7 ), - .rowbit = ( 1 << 2 ), - .eint = 2, - .bg_color = UI_COLOR_BLACK }, - {.label = "", - .letter = "", - .left = "UPDIR", - .right = NULL, - .below = NULL, - .color = UI_COLOR_BLACK, - .font_size = 10.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_ROUND, - .letter_size = 0.0, - .layout = 0, - .x = 200, - .y = 38, - .width = 33, - .height = 33, - .column = 6, - .row = 1, - .columnbit = ( 1 << 6 ), - .rowbit = ( 1 << 1 ), - .eint = 1, - .bg_color = UI_COLOR_SILVER }, - {.label = "", - .letter = "", - .left = "BEG COPY", - .right = NULL, - .below = NULL, - .color = UI_COLOR_BLACK, - .font_size = 10.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_ROUND, - .letter_size = 0.0, - .layout = 0, - .x = 164, - .y = 66, - .width = 33, - .height = 33, - .column = 6, - .row = 2, - .columnbit = ( 1 << 6 ), - .rowbit = ( 1 << 2 ), - .eint = 2, - .bg_color = UI_COLOR_SILVER }, - {.label = "", - .letter = "", - .left = "CUT", - .right = NULL, - .below = NULL, - .color = UI_COLOR_BLACK, - .font_size = 10.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_ROUND, - .letter_size = 0.0, - .layout = 0, - .x = 200, - .y = 94, - .width = 33, - .height = 33, - .column = 6, - .row = 3, - .columnbit = ( 1 << 6 ), - .rowbit = ( 1 << 3 ), - .eint = 3, - .bg_color = UI_COLOR_SILVER }, - {.label = "", - .letter = "", - .left = "END PASTE", - .right = NULL, - .below = NULL, - .color = UI_COLOR_BLACK, - .font_size = 10.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_ROUND, - .letter_size = 0.0, - .layout = 0, - .x = 236, - .y = 66, - .width = 33, - .height = 33, - .column = 6, - .row = 4, - .columnbit = ( 1 << 6 ), - .rowbit = ( 1 << 4 ), - .eint = 4, - .bg_color = UI_COLOR_SILVER }, - {.label = "S\\kern-1 T\\kern-1 O\\kern-1\\triangleright", - .letter = "M", - .left = "RCL", - .right = "PREV.M", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_NORMAL, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 0, - .y = 141, - .width = 46, - .height = 28, - .column = 4, - .row = 1, - .columnbit = ( 1 << 4 ), - .rowbit = ( 1 << 1 ), - .eint = 1, - .bg_color = UI_COLOR_BLACK }, - {.label = "EV\\kern-1 AL", - .letter = "N", - .left = NULL, - .right = NULL, - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_NORMAL, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 59, - .y = 141, - .width = 46, - .height = 28, - .column = 3, - .row = 1, - .columnbit = ( 1 << 3 ), - .rowbit = ( 1 << 1 ), - .eint = 1, - .bg_color = UI_COLOR_BLACK }, - {.label = "\\tick", - .letter = "O", - .left = NULL, - .right = NULL, - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_NORMAL, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 119, - .y = 141, - .width = 46, - .height = 28, - .column = 2, - .row = 1, - .columnbit = ( 1 << 2 ), - .rowbit = ( 1 << 1 ), - .eint = 1, - .bg_color = UI_COLOR_BLACK }, - {.label = "M\\kern-1 E\\kern-1 N\\kern-1 U", - .letter = "P", - .left = NULL, - .right = NULL, - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_NORMAL, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 179, - .y = 141, - .width = 46, - .height = 28, - .column = 1, - .row = 1, - .columnbit = ( 1 << 1 ), - .rowbit = ( 1 << 1 ), - .eint = 1, - .bg_color = UI_COLOR_BLACK }, - {.label = "\\arrowleftdblfull", - .letter = NULL, - .left = NULL, - .right = "CLEAR", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_NORMAL, - .letter_size = 0.0, - .layout = 0, - .x = 238, - .y = 141, - .width = 46, - .height = 28, - .column = 0, - .row = 1, - .columnbit = ( 1 << 0 ), - .rowbit = ( 1 << 1 ), - .eint = 1, - .bg_color = UI_COLOR_BLACK }, - {.label = "Y\\super x\\/super", - .letter = "Q", - .left = "\\math_e\\xsuperior", - .right = "LN", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_NORMAL, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 0, - .y = 183, - .width = 46, - .height = 28, - .column = 4, - .row = 2, - .columnbit = ( 1 << 4 ), - .rowbit = ( 1 << 2 ), - .eint = 2, - .bg_color = UI_COLOR_BLACK }, - {.label = "\\radical\\overscore\\kern-7 X", - .letter = "R", - .left = "\\math_x\\twosuperior", - .right = "\\xsuperior\\kern-4\\math_radical\\overscore\\kern-5\\math_y", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_NORMAL, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 59, - .y = 183, - .width = 46, - .height = 28, - .column = 3, - .row = 2, - .columnbit = ( 1 << 3 ), - .rowbit = ( 1 << 2 ), - .eint = 2, - .bg_color = UI_COLOR_BLACK }, - {.label = "SIN", - .letter = "S", - .left = "ASIN", - .right = NULL, - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_NORMAL, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 119, - .y = 183, - .width = 46, - .height = 28, - .column = 2, - .row = 2, - .columnbit = ( 1 << 2 ), - .rowbit = ( 1 << 2 ), - .eint = 2, - .bg_color = UI_COLOR_BLACK }, - {.label = "COS", - .letter = "T", - .left = "ACOS", - .right = NULL, - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_NORMAL, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 179, - .y = 183, - .width = 46, - .height = 28, - .column = 1, - .row = 2, - .columnbit = ( 1 << 1 ), - .rowbit = ( 1 << 2 ), - .eint = 2, - .bg_color = UI_COLOR_BLACK }, - {.label = "TAN", - .letter = "U", - .left = "ATAN", - .right = NULL, - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_NORMAL, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 238, - .y = 183, - .width = 46, - .height = 28, - .column = 0, - .row = 2, - .columnbit = ( 1 << 0 ), - .rowbit = ( 1 << 2 ), - .eint = 2, - .bg_color = UI_COLOR_BLACK }, - {.label = "EEX", - .letter = "V", - .left = "10\\xsuperior", - .right = "LOG", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_NORMAL, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 0, - .y = 225, - .width = 46, - .height = 28, - .column = 4, - .row = 3, - .columnbit = ( 1 << 4 ), - .rowbit = ( 1 << 3 ), - .eint = 3, - .bg_color = UI_COLOR_BLACK }, - {.label = "+\\divisionslash\\minus", - .letter = "W", - .left = "\\math_notequal", - .right = "\\math_equal", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_NORMAL, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 59, - .y = 225, - .width = 46, - .height = 28, - .column = 3, - .row = 3, - .columnbit = ( 1 << 3 ), - .rowbit = ( 1 << 3 ), - .eint = 3, - .bg_color = UI_COLOR_BLACK }, - {.label = "X", - .letter = "X", - .left = "\\math_lessequal", - .right = "\\math_less", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_NORMAL, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 119, - .y = 225, - .width = 46, - .height = 28, - .column = 2, - .row = 3, - .columnbit = ( 1 << 2 ), - .rowbit = ( 1 << 3 ), - .eint = 3, - .bg_color = UI_COLOR_BLACK }, - {.label = "1/X", - .letter = "Y", - .left = "\\math_greaterequal", - .right = "\\math_greater", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_NORMAL, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT, - .x = 179, - .y = 225, - .width = 46, - .height = 28, - .column = 1, - .row = 3, - .columnbit = ( 1 << 1 ), - .rowbit = ( 1 << 3 ), - .eint = 3, - .bg_color = UI_COLOR_BLACK }, - {.label = "\\divide", - .letter = "Z", - .left = "ABS", - .right = "ARG", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_NORMAL, - .letter_size = 12.0, - .layout = UI_LAYOUT_LEFT_NO_SPACE, - .x = 238, - .y = 225, - .width = 46, - .height = 28, - .column = 0, - .row = 3, - .columnbit = ( 1 << 0 ), - .rowbit = ( 1 << 3 ), - .eint = 3, - .bg_color = UI_COLOR_BLACK }, - {.label = "ALPHA", - .letter = "", - .left = "", - .right = "ENTRY", - .below = NULL, - .color = UI_COLOR_BLACK, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 0, - .y = 267, - .width = 46, - .height = 32, - .column = 0, - .row = 0, - .columnbit = 0, - .rowbit = 0, - .eint = 4, - .bg_color = UI_COLOR_YELLOW }, - {.label = "7", - .letter = "", - .left = "", - .right = "NUM.SLV", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 59, - .y = 267, - .width = 46, - .height = 32, - .column = 3, - .row = 4, - .columnbit = ( 1 << 3 ), - .rowbit = ( 1 << 4 ), - .eint = 4, - .bg_color = UI_COLOR_BLACK }, - {.label = "8", - .letter = NULL, - .left = NULL, - .right = NULL, - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 119, - .y = 267, - .width = 46, - .height = 32, - .column = 2, - .row = 4, - .columnbit = ( 1 << 2 ), - .rowbit = ( 1 << 4 ), - .eint = 4, - .bg_color = UI_COLOR_BLACK }, - {.label = "9", - .letter = "", - .left = "", - .right = "TIME", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 179, - .y = 267, - .width = 46, - .height = 32, - .column = 1, - .row = 4, - .columnbit = ( 1 << 1 ), - .rowbit = ( 1 << 4 ), - .eint = 4, - .bg_color = UI_COLOR_BLACK }, - {.label = "\\multiply", - .letter = NULL, - .left = "[ ]", - .right = "\" \"", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 238, - .y = 267, - .width = 46, - .height = 32, - .column = 0, - .row = 4, - .columnbit = ( 1 << 0 ), - .rowbit = ( 1 << 4 ), - .eint = 4, - .bg_color = UI_COLOR_BLACK }, - {.label = "\\uparrowleft", - .letter = NULL, - .left = NULL, - .right = NULL, - .below = NULL, - .color = UI_COLOR_BLACK, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 0, - .y = 313, - .width = 46, - .height = 32, - .column = 0, - .row = 0, - .columnbit = 0, - .rowbit = 0, - .eint = 5, - .bg_color = UI_COLOR_WHITE }, - {.label = "4", - .letter = NULL, - .left = NULL, - .right = NULL, - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 59, - .y = 313, - .width = 46, - .height = 32, - .column = 3, - .row = 5, - .columnbit = ( 1 << 3 ), - .rowbit = ( 1 << 5 ), - .eint = 5, - .bg_color = UI_COLOR_BLACK }, - {.label = "5", - .letter = NULL, - .left = NULL, - .right = NULL, - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 119, - .y = 313, - .width = 46, - .height = 32, - .column = 2, - .row = 5, - .columnbit = ( 1 << 2 ), - .rowbit = ( 1 << 5 ), - .eint = 5, - .bg_color = UI_COLOR_BLACK }, - {.label = "6", - .letter = NULL, - .left = "CONVERT", - .right = "UNITS", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 179, - .y = 313, - .width = 46, - .height = 32, - .column = 1, - .row = 5, - .columnbit = ( 1 << 1 ), - .rowbit = ( 1 << 5 ), - .eint = 5, - .bg_color = UI_COLOR_BLACK }, - {.label = "\\minus", - .letter = NULL, - .left = "( )", - .right = "_", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 238, - .y = 313, - .width = 46, - .height = 32, - .column = 0, - .row = 5, - .columnbit = ( 1 << 0 ), - .rowbit = ( 1 << 5 ), - .eint = 5, - .bg_color = UI_COLOR_BLACK }, - {.label = "\\uparrowright", - .letter = NULL, - .left = NULL, - .right = NULL, - .below = NULL, - .color = UI_COLOR_BLACK, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 0, - .y = 359, - .width = 46, - .height = 32, - .column = 0, - .row = 0, - .columnbit = 0, - .rowbit = 0, - .eint = 6, - .bg_color = UI_COLOR_ORANGE }, - {.label = "1", - .letter = "", - .left = "ARITH", - .right = "CMPLX", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 59, - .y = 359, - .width = 46, - .height = 32, - .column = 3, - .row = 6, - .columnbit = ( 1 << 3 ), - .rowbit = ( 1 << 6 ), - .eint = 6, - .bg_color = UI_COLOR_BLACK }, - {.label = "2", - .letter = "", - .left = "", - .right = "LIB", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 119, - .y = 359, - .width = 46, - .height = 32, - .column = 2, - .row = 6, - .columnbit = ( 1 << 2 ), - .rowbit = ( 1 << 6 ), - .eint = 6, - .bg_color = UI_COLOR_BLACK }, - {.label = "3", - .letter = NULL, - .left = "\\math_numbersign", - .right = "BASE", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 179, - .y = 359, - .width = 46, - .height = 32, - .column = 1, - .row = 6, - .columnbit = ( 1 << 1 ), - .rowbit = ( 1 << 6 ), - .eint = 6, - .bg_color = UI_COLOR_BLACK }, - {.label = "+", - .letter = NULL, - .left = "{ }", - .right = "\\guillemotleft\\ \\guillemotright", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 238, - .y = 359, - .width = 46, - .height = 32, - .column = 0, - .row = 6, - .columnbit = ( 1 << 0 ), - .rowbit = ( 1 << 6 ), - .eint = 6, - .bg_color = UI_COLOR_BLACK }, - {.label = "ON", - .letter = NULL, - .left = NULL, - .right = "OFF", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 0, - .y = 405, - .width = 46, - .height = 32, - .column = 0, - .row = 0, - .columnbit = 0, - .rowbit = 0, - .eint = 0, - .bg_color = UI_COLOR_BLACK }, - {.label = "0", - .letter = NULL, - .left = "\\math_infinity", - .right = "\\math_arrowright", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 59, - .y = 405, - .width = 46, - .height = 32, - .column = 3, - .row = 7, - .columnbit = ( 1 << 3 ), - .rowbit = ( 1 << 7 ), - .eint = 7, - .bg_color = UI_COLOR_BLACK }, - {.label = "\\bullet", - .letter = NULL, - .left = ": :", - .right = "\\math_downarrowleft", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 19.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 119, - .y = 405, - .width = 46, - .height = 32, - .column = 2, - .row = 7, - .columnbit = ( 1 << 2 ), - .rowbit = ( 1 << 7 ), - .eint = 7, - .bg_color = UI_COLOR_BLACK }, - {.label = "SPC", - .letter = NULL, - .left = "\\math_pi", - .right = "\\large_comma", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 179, - .y = 405, - .width = 46, - .height = 32, - .column = 1, - .row = 7, - .columnbit = ( 1 << 1 ), - .rowbit = ( 1 << 7 ), - .eint = 7, - .bg_color = UI_COLOR_BLACK }, - {.label = "ENTER", - .letter = NULL, - .left = NULL, - .right = "\\arrowright NUM", - .below = NULL, - .color = UI_COLOR_WHITE, - .font_size = 12.0, - .font_weight = CAIRO_FONT_WEIGHT_BOLD, - .shape = UI_SHAPE_BUTTON_LARGE, - .letter_size = 0.0, - .layout = 0, - .x = 238, - .y = 405, - .width = 46, - .height = 32, - .column = 0, - .row = 7, - .columnbit = ( 1 << 0 ), - .rowbit = ( 1 << 7 ), - .eint = 7, - .bg_color = UI_COLOR_BLACK }, -}; -#define X49GP_NEWRPL_UI_NR_KEYS ( sizeof( x49gp_newrpl_ui_keys ) / sizeof( x49gp_newrpl_ui_keys[ 0 ] ) ) - -static const x49gp_ui_key_t x50g_ui_keys[] = { +static const x49gp_ui_key_t ui_keys[ NB_KEYS ] = { {.label = "F1", .letter = "A", .left = "Y=", @@ -3254,9 +1106,8 @@ static const x49gp_ui_key_t x50g_ui_keys[] = { .eint = 7, .bg_color = UI_COLOR_BLACK }, }; -#define X50G_UI_NR_KEYS ( sizeof( x50g_ui_keys ) / sizeof( x50g_ui_keys[ 0 ] ) ) -static const x49gp_ui_key_t x50g_newrpl_ui_keys[] = { +static const x49gp_ui_key_t ui_newrpl_keys[ NB_KEYS ] = { {.label = "F1", .letter = "A", .left = NULL, @@ -4329,7 +2180,6 @@ static const x49gp_ui_key_t x50g_newrpl_ui_keys[] = { .eint = 7, .bg_color = UI_COLOR_BLACK }, }; -#define X50G_NEWRPL_UI_NR_KEYS ( sizeof( x50g_newrpl_ui_keys ) / sizeof( x50g_newrpl_ui_keys[ 0 ] ) ) typedef struct { uint32_t magic; @@ -5675,7 +3525,7 @@ static void x49gp_button_realize( GtkWidget* widget, gpointer user_data ) cairo_set_line_cap( cr, CAIRO_LINE_CAP_BUTT ); cairo_set_line_join( cr, CAIRO_LINE_JOIN_MITER ); -#if DEBUG_LAYOUT /* Layout Debug */ +//#if DEBUG_LAYOUT /* Layout Debug */ cairo_set_source_rgb( cr, 1.0, 1.0, 1.0 ); cairo_set_line_width( cr, 1.0 ); cairo_move_to( cr, xoffset, yoffset ); @@ -5684,7 +3534,7 @@ static void x49gp_button_realize( GtkWidget* widget, gpointer user_data ) cairo_line_to( cr, xoffset, yoffset + h - 1 ); cairo_close_path( cr ); cairo_stroke( cr ); -#endif +//#endif cairo_set_source_rgb( cr, ui->colors[ key->bg_color ].red / 65535.0, ui->colors[ key->bg_color ].green / 65535.0, ui->colors[ key->bg_color ].blue / 65535.0 ); @@ -5803,11 +3653,6 @@ static int x49gp_window_configure_event( GtkWidget* widget, GdkEventConfigure* e cr = gdk_cairo_create( ui->bg_pixmap ); gdk_cairo_set_source_pixbuf( cr, ui->bg_pixbuf, 0, 0 ); cairo_paint( cr ); - cairo_destroy( cr ); - - cr = gdk_cairo_create( ui->bg_pixmap ); - cairo_set_line_cap( cr, CAIRO_LINE_CAP_BUTT ); - cairo_set_line_join( cr, CAIRO_LINE_JOIN_MITER ); switch ( ui->calculator ) { case UI_CALCULATOR_HP49GP: @@ -5952,7 +3797,7 @@ static int gui_init( x49gp_module_t* module ) } memset( ui, 0, sizeof( x49gp_ui_t ) ); - ui->nr_buttons = X49GP_UI_NR_KEYS; + ui->nr_buttons = NB_KEYS; ui->buttons = malloc( ui->nr_buttons * sizeof( x49gp_ui_button_t ) ); if ( NULL == ui->buttons ) { fprintf( stderr, "%s: %s:%u: Out of memory\n", x49gp->progname, __FUNCTION__, __LINE__ ); @@ -6096,23 +3941,10 @@ static int gui_load( x49gp_module_t* module, GKeyFile* keyfile ) x49gp_ui_button_t* button; const x49gp_ui_key_t* keys; - switch ( ui->calculator ) { - case UI_CALCULATOR_HP49GP: - keys = x49gp_ui_keys; - break; - case UI_CALCULATOR_HP49GP_NEWRPL: - keys = x49gp_newrpl_ui_keys; - break; - default: - ui->calculator = UI_CALCULATOR_HP50G; - /* fall through */ - case UI_CALCULATOR_HP50G: - keys = x50g_ui_keys; - break; - case UI_CALCULATOR_HP50G_NEWRPL: - keys = x50g_newrpl_ui_keys; - break; - } + if ( ui->calculator == UI_CALCULATOR_HP49GP_NEWRPL || ui->calculator == UI_CALCULATOR_HP50G_NEWRPL ) + keys = ui_newrpl_keys; + else + keys = ui_keys; for ( int i = 0; i < ui->nr_buttons; i++ ) { button = &ui->buttons[ i ];