Renamed shared functions in draw.c, image.c, and cellrendererbutton.c.

This commit is contained in:
Pietro Gagliardi 2018-05-12 13:14:39 -04:00
parent 70fd8cbf8e
commit e0a2fc5841
6 changed files with 17 additions and 16 deletions

View File

@ -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
extern void loadFutures(void);

View File

@ -122,7 +122,7 @@ static gboolean areaWidget_draw(GtkWidget *w, cairo_t *cr)
uiAreaDrawParams dp;
double clipX0, clipY0, clipX1, clipY1;
dp.Context = newContext(cr,
dp.Context = uiprivNewContext(cr,
gtk_widget_get_style_context(a->widget));
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
(*(a->ah->Draw))(a->ah, a, &dp);
freeContext(dp.Context);
uiprivFreeContext(dp.Context);
return FALSE;
}

View File

@ -293,7 +293,7 @@ static void cellRendererButton_class_init(cellRendererButtonClass *class)
1, G_TYPE_STRING);
}
GtkCellRenderer *newCellRendererButton(void)
GtkCellRenderer *uiprivNewCellRendererButton(void)
{
return GTK_CELL_RENDERER(g_object_new(cellRendererButtonType, NULL));
}

View File

@ -2,7 +2,7 @@
#include "uipriv_unix.h"
#include "draw.h"
uiDrawContext *newContext(cairo_t *cr, GtkStyleContext *style)
uiDrawContext *uiprivNewContext(cairo_t *cr, GtkStyleContext *style)
{
uiDrawContext *c;
@ -12,7 +12,7 @@ uiDrawContext *newContext(cairo_t *cr, GtkStyleContext *style)
return c;
}
void freeContext(uiDrawContext *c)
void uiprivFreeContext(uiDrawContext *c)
{
// free neither cr nor style; we own neither
uiprivFree(c);

View File

@ -105,7 +105,7 @@ writeMatch:
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;

View File

@ -43,4 +43,15 @@ extern void uiprivChildSetFlag(uiprivChild *c, int flag);
extern GtkWidget *uiprivChildBox(uiprivChild *c);
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"