Preparation for adding uiDrawCaret().
This commit is contained in:
parent
0e5be32299
commit
b52600d9cd
|
@ -119,7 +119,8 @@ static gboolean areaWidget_draw(GtkWidget *w, cairo_t *cr)
|
|||
uiAreaDrawParams dp;
|
||||
double clipX0, clipY0, clipX1, clipY1;
|
||||
|
||||
dp.Context = newContext(cr);
|
||||
dp.Context = newContext(cr,
|
||||
gtk_widget_get_style_context(a->widget));
|
||||
|
||||
loadAreaSize(a, &(dp.AreaWidth), &(dp.AreaHeight));
|
||||
|
||||
|
|
|
@ -2,17 +2,19 @@
|
|||
#include "uipriv_unix.h"
|
||||
#include "draw.h"
|
||||
|
||||
uiDrawContext *newContext(cairo_t *cr)
|
||||
uiDrawContext *newContext(cairo_t *cr, GtkStyleContext *style)
|
||||
{
|
||||
uiDrawContext *c;
|
||||
|
||||
c = uiNew(uiDrawContext);
|
||||
c->cr = cr;
|
||||
c->style = style;
|
||||
return c;
|
||||
}
|
||||
|
||||
void freeContext(uiDrawContext *c)
|
||||
{
|
||||
// free neither cr nor style; we own neither
|
||||
uiFree(c);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
// draw.c
|
||||
struct uiDrawContext {
|
||||
cairo_t *cr;
|
||||
GtkStyleContext *style;
|
||||
};
|
||||
|
||||
// drawpath.c
|
||||
|
|
|
@ -42,7 +42,7 @@ extern GtkWidget *childBox(struct child *c);
|
|||
extern void childSetMargined(struct child *c, int margined);
|
||||
|
||||
// draw.c
|
||||
extern uiDrawContext *newContext(cairo_t *);
|
||||
extern uiDrawContext *newContext(cairo_t *cr, GtkStyleContext *style);
|
||||
extern void freeContext(uiDrawContext *);
|
||||
|
||||
// drawtext.c
|
||||
|
|
Loading…
Reference in New Issue