From e7da86053b3df2882816b0df8089e1a51b61939f Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Fri, 28 Sep 2012 15:26:29 +0200 Subject: autotools based build system --- osc_server.h | 105 ----------------------------------------------------------- 1 file changed, 105 deletions(-) delete mode 100644 osc_server.h (limited to 'osc_server.h') diff --git a/osc_server.h b/osc_server.h deleted file mode 100644 index f6d0c51..0000000 --- a/osc_server.h +++ /dev/null @@ -1,105 +0,0 @@ -#ifndef __OSC_SERVER_H -#define __OSC_SERVER_H - -#include -#include - -#include - -#include - -#include "osc_graphics.h" - -class Layer; - -class OSCServer { - lo_server_thread server; - -public: - struct MethodHandlerId { - char *types; - char *path; - void *data; - - MethodHandlerId(const char *_types, const char *_path, - void *_data = NULL) : - types(strdup(_types)), path(strdup(_path)), - data(_data) {} - ~MethodHandlerId() - { - free(types); - free(path); - } - }; - -private: - void add_method_v(MethodHandlerId **hnd, const char *types, - lo_method_handler handler, void *data, - const char *fmt, va_list ap) - __attribute__((format(printf, 6, 0))); - -public: - typedef void (*MethodHandlerCb)(Layer *obj, lo_arg **argv); - typedef Layer *(*CtorHandlerCb)(const char *name, SDL_Rect geo, - float alpha, lo_arg **argv); - - ~OSCServer(); - - void open(const char *port); - - inline void - start() - { - lo_server_thread_start(server); - } - inline void - stop() - { - lo_server_thread_stop(server); - } - - inline void - add_method(MethodHandlerId **hnd, const char *types, - lo_method_handler handler, void *data, - const char *fmt, ...) - __attribute__((format(printf, 6, 7))) - { - va_list ap; - va_start(ap, fmt); - add_method_v(hnd, types, handler, data, fmt, ap); - va_end(ap); - } - inline void - add_method(const char *types, - lo_method_handler handler, void *data, - const char *fmt, ...) - __attribute__((format(printf, 5, 6))) - { - va_list ap; - va_start(ap, fmt); - add_method_v(NULL, types, handler, data, fmt, ap); - va_end(ap); - } - - void del_method(const char *types, const char *fmt, ...) - __attribute__((format(printf, 3, 4))); - inline void - del_method(MethodHandlerId *hnd) - { - del_method(hnd->types, "%s", hnd->path); - delete hnd; - } - - void register_layer(const char *name, const char *types, - CtorHandlerCb ctor_cb); - - MethodHandlerId *register_method(Layer *layer, const char *method, - const char *types, - MethodHandlerCb method_cb); - void unregister_method(MethodHandlerId *hnd); -}; - -#define GEO_TYPES "iiii" /* x, y, width, height */ -#define NEW_LAYER_TYPES "is" GEO_TYPES "f" /* position, name, GEO, alpha */ - -#endif -- cgit v1.2.3