static void ImagestateColorsSetGray(ImageState * is, unsigned int hihi, unsigned int hi, unsigned int bg, unsigned int lo, unsigned int lolo) { COLOR32_FROM_RGB(is->hihi, hihi, hihi, hihi); COLOR32_FROM_RGB(is->hi, hi, hi, hi); COLOR32_FROM_RGB(is->bg, bg, bg, bg); COLOR32_FROM_RGB(is->lo, lo, lo, lo); COLOR32_FROM_RGB(is->lolo, lolo, lolo, lolo); }
static ImageClass * ImageclassGetFallback(void) { ImageClass *ic; ic = ImageclassFind("__fb_ic", 0); if (ic) return ic; /* Create fallback imageclass */ ic = ImageclassCreate("__fb_ic"); if (!ic) return ic; ic->norm.normal = ImagestateCreate(NULL); ImagestateColorsSetGray(ic->norm.normal, 255, 255, 160, 0, 0); ic->norm.normal->bevelstyle = BEVEL_AMIGA; ic->norm.hilited = ImagestateCreate(NULL); ImagestateColorsSetGray(ic->norm.hilited, 255, 255, 192, 0, 0); ic->norm.hilited->bevelstyle = BEVEL_AMIGA; ic->norm.clicked = ImagestateCreate(NULL); ImagestateColorsSetGray(ic->norm.clicked, 0, 0, 192, 255, 255); ic->norm.clicked->bevelstyle = BEVEL_AMIGA; ic->active.normal = ImagestateCreate(NULL); ImagestateColorsSetGray(ic->active.normal, 255, 255, 0, 0, 0); COLOR32_FROM_RGB(ic->active.normal->bg, 180, 140, 160); ic->active.normal->bevelstyle = BEVEL_AMIGA; ic->active.hilited = ImagestateCreate(NULL); ImagestateColorsSetGray(ic->active.hilited, 255, 255, 0, 0, 0); COLOR32_FROM_RGB(ic->active.hilited->bg, 230, 190, 210); ic->active.hilited->bevelstyle = BEVEL_AMIGA; ic->active.clicked = ImagestateCreate(NULL); ImagestateColorsSetGray(ic->active.clicked, 0, 0, 0, 255, 255); COLOR32_FROM_RGB(ic->active.clicked->bg, 230, 190, 210); ic->active.clicked->bevelstyle = BEVEL_AMIGA; ic->padding.left = 4; ic->padding.right = 4; ic->padding.top = 4; ic->padding.bottom = 4; ImageclassPopulate(ic); return ic; }
static ImageState * ImagestateCreateX(unsigned int hihi, unsigned int hi, unsigned int lo, unsigned int lolo, unsigned int bg_r, unsigned int bg_g, unsigned int bg_b) { ImageState *is; is = ImagestateCreate(NULL); if (!is) return NULL; ImagestateColorsSetGray(is, hihi, hi, 0, lo, lolo); COLOR32_FROM_RGB(is->bg, bg_r, bg_g, bg_b); is->bevelstyle = BEVEL_AMIGA; return is; }
int ECursorConfigLoad(FILE * fs) { int err = 0; unsigned int clr, clr2; char s[FILEPATH_LEN_MAX]; char s2[FILEPATH_LEN_MAX]; char *p2; int i1, i2, r, g, b; char name[FILEPATH_LEN_MAX], *pname; char file[FILEPATH_LEN_MAX], *pfile; int native_id = -1; COLOR32_FROM_RGB(clr, 0, 0, 0); COLOR32_FROM_RGB(clr2, 255, 255, 255); pname = pfile = NULL; while (GetLine(s, sizeof(s), fs)) { i1 = ConfigParseline1(s, s2, &p2, NULL); switch (i1) { case CONFIG_CURSOR: err = -1; i2 = atoi(s2); if (i2 != CONFIG_OPEN) goto done; COLOR32_FROM_RGB(clr, 0, 0, 0); COLOR32_FROM_RGB(clr2, 255, 255, 255); pname = pfile = NULL; native_id = -1; break; case CONFIG_CLOSE: ECursorCreate(pname, pfile, native_id, clr, clr2); err = 0; break; case CONFIG_CLASSNAME: if (ECursorFind(s2)) { SkipTillEnd(fs); goto done; } strcpy(name, s2); pname = name; break; case CURS_BG_RGB: r = g = b = 0; sscanf(p2, "%d %d %d", &r, &g, &b); COLOR32_FROM_RGB(clr, r, g, b); break; case CURS_FG_RGB: r = g = b = 255; sscanf(p2, "%d %d %d", &r, &g, &b); COLOR32_FROM_RGB(clr2, r, g, b); break; case XBM_FILE: strcpy(file, s2); pfile = file; break; case NATIVE_ID: native_id = atoi(s2); break; default: break; } } done: if (err) ConfigAlertLoad("Cursor"); return err; }