Renamed shared functions in draw.c, image.c, and cellrendererbutton.c.
This commit is contained in:
parent
70fd8cbf8e
commit
e0a2fc5841
|
@ -1,13 +1,3 @@
|
||||||
// draw.c
|
|
||||||
extern uiDrawContext *newContext(cairo_t *cr, GtkStyleContext *style);
|
|
||||||
extern void freeContext(uiDrawContext *);
|
|
||||||
|
|
||||||
// image.c
|
|
||||||
/*TODO remove this*/typedef struct uiImage uiImage;
|
|
||||||
extern cairo_surface_t *imageAppropriateSurface(uiImage *i, GtkWidget *w);
|
|
||||||
|
|
||||||
// cellrendererbutton.c
|
|
||||||
extern GtkCellRenderer *newCellRendererButton(void);
|
|
||||||
|
|
||||||
// future.c
|
// future.c
|
||||||
extern void loadFutures(void);
|
extern void loadFutures(void);
|
||||||
|
|
|
@ -122,7 +122,7 @@ static gboolean areaWidget_draw(GtkWidget *w, cairo_t *cr)
|
||||||
uiAreaDrawParams dp;
|
uiAreaDrawParams dp;
|
||||||
double clipX0, clipY0, clipX1, clipY1;
|
double clipX0, clipY0, clipX1, clipY1;
|
||||||
|
|
||||||
dp.Context = newContext(cr,
|
dp.Context = uiprivNewContext(cr,
|
||||||
gtk_widget_get_style_context(a->widget));
|
gtk_widget_get_style_context(a->widget));
|
||||||
|
|
||||||
loadAreaSize(a, &(dp.AreaWidth), &(dp.AreaHeight));
|
loadAreaSize(a, &(dp.AreaWidth), &(dp.AreaHeight));
|
||||||
|
@ -136,7 +136,7 @@ static gboolean areaWidget_draw(GtkWidget *w, cairo_t *cr)
|
||||||
// no need to save or restore the graphics state to reset transformations; GTK+ does that for us
|
// no need to save or restore the graphics state to reset transformations; GTK+ does that for us
|
||||||
(*(a->ah->Draw))(a->ah, a, &dp);
|
(*(a->ah->Draw))(a->ah, a, &dp);
|
||||||
|
|
||||||
freeContext(dp.Context);
|
uiprivFreeContext(dp.Context);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -293,7 +293,7 @@ static void cellRendererButton_class_init(cellRendererButtonClass *class)
|
||||||
1, G_TYPE_STRING);
|
1, G_TYPE_STRING);
|
||||||
}
|
}
|
||||||
|
|
||||||
GtkCellRenderer *newCellRendererButton(void)
|
GtkCellRenderer *uiprivNewCellRendererButton(void)
|
||||||
{
|
{
|
||||||
return GTK_CELL_RENDERER(g_object_new(cellRendererButtonType, NULL));
|
return GTK_CELL_RENDERER(g_object_new(cellRendererButtonType, NULL));
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include "uipriv_unix.h"
|
#include "uipriv_unix.h"
|
||||||
#include "draw.h"
|
#include "draw.h"
|
||||||
|
|
||||||
uiDrawContext *newContext(cairo_t *cr, GtkStyleContext *style)
|
uiDrawContext *uiprivNewContext(cairo_t *cr, GtkStyleContext *style)
|
||||||
{
|
{
|
||||||
uiDrawContext *c;
|
uiDrawContext *c;
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ uiDrawContext *newContext(cairo_t *cr, GtkStyleContext *style)
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
void freeContext(uiDrawContext *c)
|
void uiprivFreeContext(uiDrawContext *c)
|
||||||
{
|
{
|
||||||
// free neither cr nor style; we own neither
|
// free neither cr nor style; we own neither
|
||||||
uiprivFree(c);
|
uiprivFree(c);
|
||||||
|
|
|
@ -105,7 +105,7 @@ writeMatch:
|
||||||
m->distY = abs(m->targetY - y);
|
m->distY = abs(m->targetY - y);
|
||||||
}
|
}
|
||||||
|
|
||||||
cairo_surface_t *imageAppropriateSurface(uiImage *i, GtkWidget *w)
|
cairo_surface_t *uiprivImageAppropriateSurface(uiImage *i, GtkWidget *w)
|
||||||
{
|
{
|
||||||
struct matcher m;
|
struct matcher m;
|
||||||
|
|
||||||
|
|
|
@ -43,4 +43,15 @@ extern void uiprivChildSetFlag(uiprivChild *c, int flag);
|
||||||
extern GtkWidget *uiprivChildBox(uiprivChild *c);
|
extern GtkWidget *uiprivChildBox(uiprivChild *c);
|
||||||
extern void uiprivChildSetMargined(uiprivChild *c, int margined);
|
extern void uiprivChildSetMargined(uiprivChild *c, int margined);
|
||||||
|
|
||||||
|
// draw.c
|
||||||
|
extern uiDrawContext *uiprivNewContext(cairo_t *cr, GtkStyleContext *style);
|
||||||
|
extern void uiprivFreeContext(uiDrawContext *);
|
||||||
|
|
||||||
|
// image.c
|
||||||
|
/*TODO remove this*/typedef struct uiImage uiImage;
|
||||||
|
extern cairo_surface_t *uiprivImageAppropriateSurface(uiImage *i, GtkWidget *w);
|
||||||
|
|
||||||
|
// cellrendererbutton.c
|
||||||
|
extern GtkCellRenderer *uiprivNewCellRendererButton(void);
|
||||||
|
|
||||||
#include "OLD_uipriv_unix.h"
|
#include "OLD_uipriv_unix.h"
|
||||||
|
|
Loading…
Reference in New Issue