static ImageState * ImagestateCreate(const char *file) { ImageState *is; is = ECALLOC(ImageState, 1); if (!is) return NULL; is->pixmapfillstyle = FILL_STRETCH; ImagestateColorsSetGray(is, 255, 200, 160, 120, 64); is->bevelstyle = BEVEL_NONE; is->im_file = Estrdup(file); return is; }
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; }
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; }
ImageClass * ImageclassGetBlack(void) { ImageClass *ic; ic = ImageclassFind("__BLACK", 0); if (ic) return ic; /* Create all black image class for filler borders */ ic = ImageclassCreate("__BLACK"); if (!ic) return ic; ic->norm.normal = ImagestateCreate(NULL); ImagestateColorsSetGray(ic->norm.normal, 0, 0, 0, 0, 0); ImageclassPopulate(ic); return ic; }