Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
glcomplabel.c
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (c) 2011 AT&T Intellectual Property
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * https://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors: Details at https://graphviz.org
9 *************************************************************************/
10
11#include <glcomp/glcomplabel.h>
12#include <glcomp/glcompfont.h>
13#include <glcomp/glcompset.h>
14#include <glcomp/glutils.h>
15#include <util/alloc.h>
16
23
24glCompLabel *glCompLabelNew(void *par, char *text) {
25 glCompLabel *p = gv_alloc(sizeof(glCompLabel));
26 glCompInitCommon(&p->base, par, 0, 0);
27
28 p->text = gv_strdup(text);
30 p->base.common.font = glNewFontFromParent(&p->base, text);
32
33 return p;
34}
Memory allocation wrappers that exit on failure.
static char * gv_strdup(const char *original)
Definition alloc.h:101
static void * gv_alloc(size_t size)
Definition alloc.h:47
glCompFont glNewFontFromParent(glCompObj *o, char *text)
Definition glcompfont.c:70
void glDeleteFont(glCompFont *f)
Definition glcompfont.c:38
void glCompRenderText(glCompFont f, glCompObj *parentObj)
Definition glcompfont.c:134
glCompLabel * glCompLabelNew(void *par, char *text)
Definition glcomplabel.c:24
static void glCompLabelDraw(void *label)
Definition glcomplabel.c:17
void glCompInitCommon(glCompObj *childObj, glCompObj *parentObj, float x, float y)
Definition glcompset.c:114
void glCompCalcWidget(glCompCommon *parent, glCompCommon *child, glCompCommon *ref)
Definition glutils.c:195
static int label(Agnode_t *n, int nodecnt, int *edgecnt)
Definition sccmap.c:161
void ref(Site *v)
Definition site.c:59
glcompdrawfunc_t draw
Definition glcompdefs.h:160
glCompCallBacks functions
Definition glcompdefs.h:194
void * parent
Definition glcompdefs.h:187
glCompFont font
font to use
Definition glcompdefs.h:189
char * text
Definition glcompdefs.h:221
glCompObj base
Definition glcompdefs.h:220
glCompCommon common
Definition glcompdefs.h:200