Source

pebble / lib / src / pebble_th.h

Full commit
/** \file
 * Functions in libpblth.a.
 */
#ifndef _pblth_h_
#define _pblth_h_

#include <stdint.h>
#include "pebble_os.h"

#define PEBBLE_SCREEN_WIDTH 144
#define PEBBLE_SCREEN_HEIGHT 168


extern int
__attribute__((__format__(printf, 2, 3)))
pebble_sprintf(
	char * buf,
	const char * fmt,
	...
);


extern void
text_layer_setup(
	Window * window,
	TextLayer * layer,
	GRect frame,
	GFont font
);


void
monospace_text(
	GContext * ctx,
	const char * buf,
	GFont font,
	GPoint xy,
	int x_size,
	int y_size
);


#define container_of(ptr, type, member) ({ \
	char * __mptr = (char*)(uintptr_t) (ptr); \
	(type *)(__mptr - offsetof(type,member) ); \
})


#endif