mutter/cltr.h

124 lines
2.3 KiB
C
Raw Normal View History

2005-03-22 14:53:51 +00:00
#ifndef _HAVE_CLTR_H
#define _HAVE_CLTR_H
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <math.h>
#include <X11/Xlib.h>
#include <GL/glx.h>
#include <GL/gl.h>
#include <glib.h>
#include "pixbuf.h"
#include "fonts.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) \
{ \
2005-03-27 20:12:19 +00:00
g_printerr (__FILE__ ": GL Error: %x [at %s:%d]\n", \
2005-03-23 21:09:57 +00:00
err, __func__, __LINE__); \
2005-03-22 14:53:51 +00:00
} \
}
#else
#define CLTR_DBG(x, a...) do {} while (0)
#define CLTR_GLERR() do {} while (0)
#endif
2005-03-22 17:25:52 +00:00
#define CLTR_MARK() CLTR_DBG("mark")
2005-03-29 23:26:36 +00:00
typedef struct CltrTexturePool CltrTexturePool;
struct CltrTexturePool
{
GList *texture_items;
gint n_texture_items;
GLuint *gl_textures;
};
2005-03-23 17:33:37 +00:00
typedef struct ClutterMainContext ClutterMainContext;
struct ClutterMainContext
{
2005-03-29 23:26:36 +00:00
Display *xdpy;
Window xwin_root;
int xscreen;
GC xgc;
GLXContext gl_context;
CltrTexturePool texture_pool;
2005-03-23 17:33:37 +00:00
};
typedef enum CltrDirection
{
CLTR_NORTH,
CLTR_SOUTH,
CLTR_EAST,
CLTR_WEST
}
CltrDirection;
typedef struct ClutterWindow ClutterWindow;
struct ClutterWindow
{
Window xwin;
int width;
int height;
};
ClutterMainContext CltrCntx;
/* Event Loop Integration */
typedef void (*CltrXEventFunc) (XEvent *xev, gpointer user_data);
typedef struct
{
GSource source;
Display *display;
GPollFD event_poll_fd;
}
CltrXEventSource;
2005-03-29 23:26:36 +00:00
/* texture stuff */
2005-03-30 16:52:02 +00:00
typedef struct CltrTexture CltrTexture;
2005-03-29 23:26:36 +00:00
2005-03-30 16:52:02 +00:00
struct CltrTexture
2005-03-29 23:26:36 +00:00
{
Pixbuf *pixb;
int width, height;
int n_x_tiles, n_y_tiles;
int *tile_x_position, *tile_x_size, *tile_x_waste;
int *tile_y_position, *tile_y_size, *tile_y_waste;
GLuint *tiles;
gint refcnt;
};
/* ******************* */
2005-03-30 16:52:02 +00:00
#include "cltr-texture.h"
2005-03-24 16:46:49 +00:00
#include "cltr-photo-grid.h"
2005-03-23 17:33:37 +00:00
2005-03-22 14:53:51 +00:00
#endif