Graphviz 14.1.2~dev.20260123.1158
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 "config.h"
12
13#include <glcomp/glcomplabel.h>
14#include <glcomp/glcompfont.h>
15#include <glcomp/glcompset.h>
16#include <glcomp/glutils.h>
17#include <util/alloc.h>
18
19static void glCompLabelDraw(void *label) {
20 glCompLabel *p = label;
21 glCompCommon ref = p->base.common;
24}
25
26glCompLabel *glCompLabelNew(void *par, char *text) {
27 glCompLabel *p = gv_alloc(sizeof(glCompLabel));
28 glCompInitCommon(&p->base, par, 0, 0);
29
30 p->text = gv_strdup(text);
32 p->base.common.font = glNewFontFromParent(&p->base, text);
34
35 return p;
36}
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, const char *text)
Definition glcompfont.c:72
void glDeleteFont(glCompFont *f)
Definition glcompfont.c:40
void glCompRenderText(glCompFont f, glCompObj *parentObj)
Definition glcompfont.c:136
glCompLabel * glCompLabelNew(void *par, char *text)
Definition glcomplabel.c:26
static void glCompLabelDraw(void *label)
Definition glcomplabel.c:19
void glCompInitCommon(glCompObj *childObj, glCompObj *parentObj, float x, float y)
Definition glcompset.c:113
void glCompCalcWidget(glCompCommon *parent, glCompCommon *child, glCompCommon *ref)
Definition glutils.c:183
static int label(Agnode_t *n, int nodecnt, int *edgecnt)
Definition sccmap.c:163
glcompdrawfunc_t draw
Definition glcompdefs.h:150
glCompCallBacks functions
Definition glcompdefs.h:179
void * parent
Definition glcompdefs.h:172
glCompFont font
font to use
Definition glcompdefs.h:174
char * text
Definition glcompdefs.h:205
glCompObj base
Definition glcompdefs.h:204
glCompCommon common
Definition glcompdefs.h:185