struct point_rect r;
int gamma,brightness,contrast;
int colormgmt;
+ int font_size;
GList *selection;
};
static void draw_circle(struct point *pnt, int diameter, int scale, int start, int len, struct point *res, int *pos, int dir);
static void graphics_process_selection(struct graphics *gra, struct displaylist *dl);
+static void graphics_gc_init(struct graphics *this_);
static int
graphics_set_attr_do(struct graphics *gra, struct attr *attr)
case attr_contrast:
gra->contrast=attr->u.num;
break;
+ case attr_font_size:
+ gra->font_size=attr->u.num;
+ return 1;
default:
return 0;
}
gra->colormgmt=(gra->gamma != 65536 || gra->brightness != 0 || gra->contrast != 65536);
+ graphics_gc_init(gra);
return 1;
}
this_->brightness=0;
this_->contrast=65536;
this_->gamma=65536;
+ this_->font_size=20;
while (*attrs) {
graphics_set_attr_do(this_,*attrs);
attrs++;
this_->meth.overlay_resize(this_->priv, p, w, h, alpha, wraparound);
}
+static void
+graphics_gc_init(struct graphics *this_)
+{
+ if (!this_->gc[0] || !this_->gc[1] || !this_->gc[2])
+ return;
+ graphics_gc_set_background(this_->gc[0], &(struct color) { 0xffff, 0xefef, 0xb7b7, 0xffff});
+ graphics_gc_set_foreground(this_->gc[0], &(struct color) { 0xffff, 0xefef, 0xb7b7, 0xffff });
+ graphics_gc_set_background(this_->gc[1], &(struct color) { 0x0000, 0x0000, 0x0000, 0xffff });
+ graphics_gc_set_foreground(this_->gc[1], &(struct color) { 0xffff, 0xffff, 0xffff, 0xffff });
+ graphics_gc_set_background(this_->gc[2], &(struct color) { 0xffff, 0xffff, 0xffff, 0xffff });
+ graphics_gc_set_foreground(this_->gc[2], &(struct color) { 0x0000, 0x0000, 0x0000, 0xffff });
+}
+
+
/**
* FIXME
if (this_->gc[0])
return;
this_->gc[0]=graphics_gc_new(this_);
- graphics_gc_set_background(this_->gc[0], &(struct color) { 0xffff, 0xefef, 0xb7b7, 0xffff});
- graphics_gc_set_foreground(this_->gc[0], &(struct color) { 0xffff, 0xefef, 0xb7b7, 0xffff });
this_->gc[1]=graphics_gc_new(this_);
- graphics_gc_set_background(this_->gc[1], &(struct color) { 0x0000, 0x0000, 0x0000, 0xffff });
- graphics_gc_set_foreground(this_->gc[1], &(struct color) { 0xffff, 0xffff, 0xffff, 0xffff });
this_->gc[2]=graphics_gc_new(this_);
- graphics_gc_set_background(this_->gc[2], &(struct color) { 0xffff, 0xffff, 0xffff, 0xffff });
- graphics_gc_set_foreground(this_->gc[2], &(struct color) { 0x0000, 0x0000, 0x0000, 0xffff });
+ graphics_gc_init(this_);
graphics_background_gc(this_, this_->gc[0]);
}
gra->font[gra->font_len++]=NULL;
}
if (! gra->font[size])
- gra->font[size]=graphics_font_new(gra, size*20, 0);
+ gra->font[size]=graphics_font_new(gra, size*gra->font_size, 0);
return gra->font[size];
}