/** * Draw a horizontal bar to the right. * \param drvthis Pointer to driver structure. * \param x Horizontal character position (column) of the starting point. * \param y Vertical character position (row) of the starting point. * \param len Number of characters that the bar is long at 100% * \param promille Current length level of the bar in promille. * \param options Options (currently unused). */ MODULE_EXPORT void CFontzPacket_hbar (Driver *drvthis, int x, int y, int len, int promille, int options) { PrivateData *p = drvthis->private_data; if (p->ccmode != hbar) { unsigned char hBar[p->cellheight]; int i; if (p->ccmode != standard) { /* Not supported(yet) */ report(RPT_WARNING, "%s: hbar: cannot combine two modes using user-defined characters", drvthis->name); return; } p->ccmode = hbar; memset(hBar, 0x00, sizeof(hBar)); for (i = 1; i <= p->cellwidth; i++) { // fill pixel columns from left to right. memset(hBar, 0xFF & ~((1 << (p->cellwidth - i)) - 1), sizeof(hBar)-1); CFontzPacket_set_char(drvthis, i, hBar); } } lib_hbar_static(drvthis, x, y, len, promille, options, p->cellwidth, 0); }
/** * API: Draw a horizontal bar to the right. */ MODULE_EXPORT void parallax_hbar(Driver *drvthis, int x, int y, int len, int promille, int options) { PrivateData *p = drvthis->private_data; static unsigned char hbar_char[4][8] = { {0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10}, {0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, {0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C}, {0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E} /* Full block is done using icon */ }; if (p->ccmode != hbar) { int i; if (p->ccmode != standard) { report(RPT_WARNING, "%s: hbar: cannot combine two modes using user-defined characters", drvthis->name); return; } p->ccmode = hbar; for (i = 0; i < 4; i++) parallax_set_char(drvthis, i + 1, hbar_char[i]); } lib_hbar_static(drvthis, x, y, len, promille, options, p->cellwidth, 0); }
/** * Draw a horizontal bar to the right. * \param drvthis Pointer to driver structure. * \param x Horizontal character position (column) of the starting point. * \param y Vertical character position (row) of the starting point. * \param len Number of characters that the bar is long at 100% * \param promille Current length level of the bar in promille. * \param options Options (currently unused). */ MODULE_EXPORT void bayrad_hbar(Driver *drvthis, int x, int y, int len, int promille, int options) { PrivateData *p = drvthis->private_data; static unsigned char bar_right[4][8] = { {0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10}, {0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, {0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C}, {0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E}, }; //debug(RPT_DEBUG, "Hbar at %i,%i; length %i", x, y, len); if (p->ccmode != hbar) { int i; if (p->ccmode != standard) { report(RPT_WARNING, "%s: cannot combine two modes using user-defined characters", drvthis->name); return; } p->ccmode = hbar; for (i = 0; i < 4; i++) bayrad_set_char(drvthis, i + 1, bar_right[i]); } lib_hbar_static(drvthis, x, y, len, promille, options, p->cellwidth, 0x98); }
///////////////////////////////////////////////////////////////// // Draws a horizontal bar to the right. // MODULE_EXPORT void MTC_S16209X_hbar (Driver *drvthis, int x, int y, int len, int promille, int options) { PrivateData *p = drvthis->private_data; MTC_S16209X_init_hbar(drvthis); lib_hbar_static(drvthis, x, y, len, promille, options, p->cellwidth, 0); }
/** * API: Draw a horizontal bar to the right. */ MODULE_EXPORT void sdeclcd_hbar(Driver *drvthis, int x, int y, int len, int promille, int options) { PrivateData *p = drvthis->private_data; int i, j; if (hbar != p->ccmode) { for (i = 0; i < SDEC_CELL_W; i++) { for (j = 0; j < SDEC_CELL_H; j++) { /* Set Custom Char Address */ sdec_exec(SDEC_FN_CG_ADD | (i * SDEC_CELL_H + j), p->bklgt); /* Write bitmap at Address */ sdec_write(p->hbar_cg[i * SDEC_CELL_H + j], p->bklgt); } } p->ccmode = hbar; } /* 1 bar is at char 0 or 8, so offset is 7 (avoiding offset of -1) */ lib_hbar_static(drvthis, x, y, len, promille, options, SDEC_CELL_W, 7); }
///////////////////////////////////////////////////////////////// // Draws a horizontal bar to the right. // MODULE_EXPORT void lcterm_hbar(Driver *drvthis, int x, int y, int len, int promille, int options) { lcterm_init_hbar(drvthis); lib_hbar_static(drvthis, x, y, len, promille, options, LCD_DEFAULT_CELLWIDTH, 0); }