Resolution Independence

Resolution Independence

Synopsis


#include <ccc/cc-unit.h>


                    CcDistance;
enum                CcUnit;
CcDistance*         cc_distance_new                     (gdouble value,
                                                         CcUnit unit);
CcDistance*         cc_distance_copy                    (CcDistance const*self);
void                cc_distance_free                    (CcDistance *self);

Description

Details

CcDistance

typedef struct {
} CcDistance;

CcDistance represents a one-dimensional length measured in a certain unit. You shouldn't access the attributes directly.


enum CcUnit

typedef enum {
	/* relative sizes */
	CC_UNIT_DISPLAY_PIXEL,
	/* EM */
	/* EX */
	/* CC_UNIT_PIXEL, */
	/* GD */
	/* REM */
	/* VW */
	/* VH */
	/* VM */
	/* CH */
	/* absolute size */
	/* IN */
	/* CM */
	/* MM */
	CC_UNIT_POINT,
	/* PC */
	/* aliases */
	/* CC_UNIT_PX = CC_UNIT_PIXEL, */
	CC_UNIT_PT = CC_UNIT_POINT
} CcUnit;

CcUnit represents a length unit. It is used to represent sizes that are not given in pixels. It's also very useful for resolution-independent rendering of sizes and positions.

CC_UNIT_DISPLAY_PIXEL
CC_UNIT_POINT 1/72 of an inch
CC_UNIT_PT an alias for CC_UNIT_POINT

cc_distance_new ()

CcDistance*         cc_distance_new                     (gdouble value,
                                                         CcUnit unit);

Create a new distance representation.

value : the size
unit : the unit belonging to the size
Returns : a newly allocated CcDistance.

cc_distance_copy ()

CcDistance*         cc_distance_copy                    (CcDistance const*self);

Create a new CcDistance by copying another.

self : a CcDistance
Returns : a copy of self.

cc_distance_free ()

void                cc_distance_free                    (CcDistance *self);

Free the memory that was occupied by self.

self : a CcDistance