Graphviz 12.0.1~dev.20240716.0800
Loading...
Searching...
No Matches
glcomppanel.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 <cgraph/alloc.h>
12#include <glcomp/glcomppanel.h>
13#include <glcomp/glcompfont.h>
14#include <glcomp/glcompset.h>
16#include <glcomp/glutils.h>
17#include <stdbool.h>
18
19static void glCompPanelDraw(void *o) {
20 glCompPanel *p = o;
22 glCompRect r;
23 ref = p->common;
26
27 if (!p->common.visible)
28 return;
29 /*draw shadow */
30 glColor4f(p->shadowcolor.R, p->shadowcolor.G, p->shadowcolor.B,
31 p->shadowcolor.A);
32 r.h = p->shadowwidth;
33 r.w = ref.width;
34 r.pos.x = ref.pos.x + p->shadowwidth;
35 r.pos.y = ref.pos.y - p->shadowwidth;
36 r.pos.z = -0.001f;
38 r.h = ref.height;
39 r.w = p->shadowwidth;
40 r.pos.x = ref.pos.x + ref.width;
41 r.pos.y = ref.pos.y - p->shadowwidth;
42 r.pos.z = -0.001f;
44 /*draw panel */
45 glCompDrawRectPrism(&ref.pos, ref.width, ref.height, p->common.borderWidth,
46 0.01f, &ref.color, true);
47 /*draw image if there is */
48 if (p->image) {
50 }
51}
52
Memory allocation wrappers that exit on failure.
static void * gv_alloc(size_t size)
Definition alloc.h:47
#define GLCOMPSET_PANEL_SHADOW_WIDTH
Definition glcompdefs.h:40
#define GLCOMPSET_PANEL_SHADOW_COLOR_G
Definition glcompdefs.h:37
#define GLCOMPSET_PANEL_SHADOW_COLOR_R
Definition glcompdefs.h:36
#define GLCOMPSET_PANEL_BORDERWIDTH
Definition glcompdefs.h:74
#define GLCOMPSET_PANEL_SHADOW_COLOR_B
Definition glcompdefs.h:38
@ glPanelObj
Definition glcompdefs.h:93
#define GLCOMPSET_PANEL_SHADOW_COLOR_A
Definition glcompdefs.h:39
glCompFont * glNewFontFromParent(glCompObj *o, char *text)
Definition glcompfont.c:75
static void glCompPanelDraw(void *o)
Definition glcomppanel.c:19
glCompPanel * glCompPanelNew(void *parentObj, float x, float y, float w, float h)
Definition glcomppanel.c:53
void glCompInitCommon(glCompObj *childObj, glCompObj *parentObj, float x, float y)
Definition glcompset.c:120
void glCompDrawRectangle(glCompRect *r)
Definition glutils.c:299
void glCompCalcWidget(glCompCommon *parent, glCompCommon *child, glCompCommon *ref)
Definition glutils.c:195
void glCompDrawRectPrism(glCompPoint *p, float w, float h, float b, float d, glCompColor *c, bool bumped)
Definition glutils.c:309
node NULL
Definition grammar.y:149
void ref(Site *v)
Definition site.c:59
glcompdrawfunc_t draw
Definition glcompdefs.h:190
glCompCallBacks callbacks
Definition glcompdefs.h:222
glCompCallBacks functions
Definition glcompdefs.h:223
glCompFont * font
Definition glcompdefs.h:218
void * parent
Definition glcompdefs.h:216
float borderWidth
Definition glcompdefs.h:211
glCompCommon common
Definition glcompdefs.h:230
float shadowwidth
Definition glcompdefs.h:241
glCompCommon common
Definition glcompdefs.h:240
glCompImage * image
Definition glcompdefs.h:244
glCompColor shadowcolor
Definition glcompdefs.h:242
glObjType objType
Definition glcompdefs.h:239
char * text
Definition glcompdefs.h:243
glCompPoint pos
Definition glcompdefs.h:156