libacfutils
A general purpose library of utility functions designed to make it easier to develop addons for the X-Plane flight simulator.
Loading...
Searching...
No Matches
Macros | Functions
cairo_utils.h File Reference
#include <cairo.h>
#include "core.h"
Include dependency graph for cairo_utils.h:

Go to the source code of this file.

Macros

#define CAIRO_SURFACE_DESTROY(surf)
 
#define mt_cairo_render_rounded_rectangle   cairo_utils_rounded_rect
 

Functions

void cairo_utils_rounded_rect (cairo_t *cr, double x, double y, double w, double h, double radius)
 

Detailed Description

This file contains various utility and helper functions for cairo graphics.

Definition in file cairo_utils.h.

Macro Definition Documentation

◆ CAIRO_SURFACE_DESTROY

#define CAIRO_SURFACE_DESTROY (   surf)
Value:
do {\
if ((surf) != NULL) { \
cairo_surface_destroy((surf)); \
(surf) = NULL; \
} \
} while (0)

If surf is not NULL, calls cairo_surface_destroy() on it and resets the surf pointer to NULL afterwards.

Definition at line 45 of file cairo_utils.h.

◆ mt_cairo_render_rounded_rectangle

#define mt_cairo_render_rounded_rectangle   cairo_utils_rounded_rect

For backwards compatibility with legacy apps.

Definition at line 54 of file cairo_utils.h.

Function Documentation

◆ cairo_utils_rounded_rect()

void cairo_utils_rounded_rect ( cairo_t *  cr,
double  x,
double  y,
double  w,
double  h,
double  radius 
)

Appends a rounded rectangle to the current path. In essence operates exactly as cairo_rectangle(), except the corners can be rounded over.

Parameters
xX coordinate origin of the rectangle.
yY coordinate origin of the rectangle.
wWidth of rectangle.
hHeight of rectangle.
radiusRadius of the rounded arcs comprising the corners.

Definition at line 31 of file cairo_utils.c.