19 void*
const newData = realloc(dest->
data, len + 1);
27 ((
char*)newData)[len] = 0;
42 if (*dest !=
string) {
43 const size_t len = strlen(
string);
45 *dest = (
char*)realloc(*dest, len + 1);
46 strncpy(*dest,
string, len + 1);
53#define FAIL_IF(cond) \
70 FAIL_IF((buf[1] & 0xC0u) != 0x80);
71 return ((
uint32_t)buf[0] << 6u) + buf[1] - 0x3080u;
75 FAIL_IF((buf[1] & 0xC0u) != 0x80);
76 FAIL_IF(buf[0] == 0xE0 && buf[1] < 0xA0);
77 FAIL_IF((buf[2] & 0xC0u) != 0x80);
84 FAIL_IF((buf[1] & 0xC0u) != 0x80);
85 FAIL_IF(buf[0] == 0xF0 && buf[1] < 0x90);
86 FAIL_IF(buf[0] == 0xF4 && buf[1] >= 0x90);
87 FAIL_IF((buf[2] & 0xC0u) != 0x80u);
88 FAIL_IF((buf[3] & 0xC0u) != 0x80u);
122 view->
frame.
x =
event->configure.x;
123 view->
frame.
y =
event->configure.y;
149 switch (event->
type) {
CAdPlugDatabase::CRecord::RecordType type
Definition adplugdb.cpp:93
const PuglStatus st1
Definition pugl.h:1909
return st0 st0
Definition pugl.h:1912
PuglEventType
The type of a PuglEvent.
Definition pugl.h:179
@ PUGL_UPDATE
View ready to draw, a PuglUpdateEvent.
Definition pugl.h:186
@ PUGL_EXPOSE
View must be drawn, a PuglExposeEvent.
Definition pugl.h:187
@ PUGL_LOOP_LEAVE
Recursive loop left, a PuglLoopLeaveEvent.
Definition pugl.h:203
@ PUGL_LOOP_ENTER
Recursive loop entered, a PuglLoopEnterEvent.
Definition pugl.h:202
@ PUGL_CREATE
View created, a PuglCreateEvent.
Definition pugl.h:181
@ PUGL_CLOSE
View will be closed, a PuglCloseEvent.
Definition pugl.h:188
@ PUGL_UNMAP
View made invisible, a PuglUnmapEvent.
Definition pugl.h:185
@ PUGL_MAP
View made visible, a PuglMapEvent.
Definition pugl.h:184
@ PUGL_NOTHING
No event.
Definition pugl.h:180
@ PUGL_CONFIGURE
View moved/resized, a PuglConfigureEvent.
Definition pugl.h:183
@ PUGL_DESTROY
View destroyed, a PuglDestroyEvent.
Definition pugl.h:182
PuglStatus
Return status code.
Definition pugl.h:627
@ PUGL_SUCCESS
Success.
Definition pugl.h:628
@ PUGL_NO_MEMORY
Failed to allocate memory.
Definition pugl.h:640
struct PuglViewImpl PuglView
A drawable region that receives events.
Definition pugl.h:810
uint32_t puglDecodeUTF8(const uint8_t *buf)
Return the Unicode code point for buf or the replacement character.
Definition internal.c:51
PuglStatus puglSetBlob(PuglBlob *const dest, const void *const data, const size_t len)
Set blob to data with length len, reallocating if necessary.
Definition internal.c:16
PuglStatus puglExpose(PuglView *view, const PuglEvent *event)
Process expose event while already in the graphics context.
Definition internal.c:136
PuglStatus puglDispatchEvent(PuglView *view, const PuglEvent *event)
Dispatch event to view, entering graphics context if necessary.
Definition internal.c:144
static bool puglMustConfigure(PuglView *view, const PuglConfigureEvent *configure)
Definition internal.c:110
PuglStatus puglConfigure(PuglView *view, const PuglEvent *event)
Process configure event while already in the graphics context.
Definition internal.c:116
PuglStatus puglDispatchSimpleEvent(PuglView *view, const PuglEventType type)
Dispatch an event with a simple type to view.
Definition internal.c:99
void puglSetString(char **dest, const char *string)
Reallocate and set *dest to string.
Definition internal.c:40
JSAMPIMAGE data
Definition jpeglib.h:945
unsigned int uint32_t
Definition mid.cpp:100
unsigned char uint8_t
Definition mid.cpp:98
PUGL_WARN_UNUSED_RESULT PuglStatus(* leave)(PuglView *, const PuglExposeEvent *)
Leave drawing context, after drawing if expose is non-null.
Definition types.h:85
PUGL_WARN_UNUSED_RESULT PuglStatus(* enter)(PuglView *, const PuglExposeEvent *)
Enter drawing context, for drawing if expose is non-null.
Definition types.h:81
Blob of arbitrary data.
Definition types.h:31
void * data
Dynamically allocated data.
Definition types.h:32
size_t len
Length of data in bytes.
Definition types.h:33
PuglSpan height
Height of exposed region.
Definition pugl.h:332
PuglSpan width
Width of exposed region.
Definition pugl.h:331
PuglSpan width
Definition pugl.h:90
PuglCoord y
Definition pugl.h:89
PuglCoord x
Definition pugl.h:88
PuglSpan height
Definition pugl.h:91
PuglEventFunc eventFunc
Definition types.h:42
PuglConfigureEvent lastConfigure
Definition types.h:47
PuglRect frame
Definition types.h:46
const PuglBackend * backend
Definition types.h:39
bool visible
Definition types.h:50
PuglEventType type
Event type.
Definition pugl.h:601
PuglConfigureEvent configure
PUGL_CONFIGURE
Definition pugl.h:603
PuglExposeEvent expose
PUGL_EXPOSE
Definition pugl.h:604
memcpy(hh, h, RAND_HEAD_LEN)