mutter/clutter/cltr-private.h

87 lines
2.1 KiB
C
Raw Normal View History

2005-04-03 16:13:08 +00:00
#ifndef _HAVE_CLTR_PRIVATE_H
#define _HAVE_CLTR_PRIVATE_H
#include "cltr.h"
#define CLTR_WANT_DEBUG 1
#if (CLTR_WANT_DEBUG)
#define CLTR_DBG(x, a...) \
g_printerr ( __FILE__ ":%d,%s() " x "\n", __LINE__, __func__, ##a)
#define CLTR_GLERR() \
{ \
GLenum err = glGetError (); /* Roundtrip */ \
if (err != GL_NO_ERROR) \
{ \
g_printerr (__FILE__ ": GL Error: %x [at %s:%d]\n", \
err, __func__, __LINE__); \
} \
}
#else
#define CLTR_DBG(x, a...) do {} while (0)
#define CLTR_GLERR() do {} while (0)
#endif
#define CLTR_MARK() CLTR_DBG("mark")
typedef void (*WidgetPaintMethod) (CltrWidget *widget ) ;
typedef void (*WidgetShowMethod) (CltrWidget *widget ) ;
typedef void (*WidgetDestroyMethod) (CltrWidget *widget) ;
2005-04-29 16:44:17 +00:00
typedef void (*WidgetFocusMethod) (CltrWidget *widget) ;
typedef void (*WidgetUnfocusMethod) (CltrWidget *widget) ;
2005-04-03 16:13:08 +00:00
typedef gboolean (*WidgetXEventHandler) (CltrWidget *widget, XEvent *xev) ;
struct CltrWidget
{
2005-04-29 16:44:17 +00:00
int type;
2005-04-03 16:13:08 +00:00
int x,y,width,height;
CltrWidget *parent;
gboolean visible;
GList *children;
2005-04-29 16:44:17 +00:00
/* focus */
CltrWidget *focus_next_north, *focus_next_south,
*focus_next_west, *focus_next_east;
2005-04-03 16:13:08 +00:00
/* methods */
WidgetPaintMethod paint;
WidgetShowMethod show;
WidgetDestroyMethod destroy;
2005-04-29 16:44:17 +00:00
WidgetFocusMethod focus_in;
WidgetUnfocusMethod focus_out;
2005-04-03 16:13:08 +00:00
WidgetXEventHandler xevent_handler;
};
typedef struct ClutterMainContext ClutterMainContext;
struct ClutterMainContext
{
Display *xdpy;
Window xwin_root;
int xscreen;
GC xgc;
GLXContext gl_context;
CltrWidget *window;
2005-04-26 08:56:53 +00:00
GAsyncQueue *internal_event_q;
2005-04-03 16:13:08 +00:00
};
ClutterMainContext CltrCntx;
#define CLTR_CONTEXT() &CltrCntx
2005-04-26 08:56:53 +00:00
#define FPS_TO_TIMEOUT(t) (1000/(t))
2005-04-03 16:13:08 +00:00
#endif