mutter/cltr-photo-grid.h

108 lines
2.2 KiB
C
Raw Normal View History

2005-03-24 16:46:49 +00:00
#ifndef _HAVE_CLTR_PHOTO_GRID_H
#define _HAVE_CLTR_PHOTO_GRID_H
#include "cltr.h"
typedef struct ClutterPhotoGrid ClutterPhotoGrid;
typedef struct ClutterPhotoGridCell ClutterPhotoGridCell;
typedef enum ClutterPhotoGridState
{
2005-03-27 20:12:19 +00:00
CLTR_PHOTO_GRID_STATE_LOADING ,
CLTR_PHOTO_GRID_STATE_LOAD_COMPLETE ,
2005-03-24 16:46:49 +00:00
CLTR_PHOTO_GRID_STATE_BROWSE ,
CLTR_PHOTO_GRID_STATE_ZOOM_IN ,
CLTR_PHOTO_GRID_STATE_ZOOMED ,
CLTR_PHOTO_GRID_STATE_ZOOM_OUT ,
CLTR_PHOTO_GRID_STATE_ZOOMED_MOVE ,
}
ClutterPhotoGridState;
2005-03-27 20:12:19 +00:00
typedef enum ClutterPhotoGridCellState
{
CLTR_PHOTO_GRID_CELL_STATE_APPEARING,
CLTR_PHOTO_GRID_CELL_STATE_STATIC,
}
ClutterPhotoGridCellState;
2005-03-24 16:46:49 +00:00
struct ClutterPhotoGridCell
{
Pixbuf *pixb;
2005-03-25 17:22:10 +00:00
float angle;
2005-03-27 20:12:19 +00:00
GLuint texref;
2005-03-29 23:26:36 +00:00
CltrImage *img;
gint anim_step;
2005-03-27 20:12:19 +00:00
ClutterPhotoGridCellState state;
2005-03-24 16:46:49 +00:00
};
struct ClutterPhotoGrid
{
/* XXX should be base widget stuff */
int x,y;
int width;
int height;
ClutterWindow *parent;
/* ****** */
2005-03-27 20:12:19 +00:00
gchar *img_path;
2005-03-24 16:46:49 +00:00
int n_rows;
int n_cols;
int cell_width;
int cell_height;
GList *cells_tail;
GList *cell_active;
/* animation stuff */
int anim_n_steps, anim_step;
float zoom_min, zoom_max, zoom_step;
/* below needs better naming */
float view_min_x, view_max_x, view_min_y, view_max_y;
int tex_w;
int tex_h;
int *tex_data;
GLuint *texs;
ClutterPhotoGridState state;
};
ClutterPhotoGridCell*
cltr_photo_grid_cell_new(ClutterPhotoGrid *grid,
Pixbuf *pixb,
const gchar *filename);
void
cltr_photo_grid_append_cell(ClutterPhotoGrid *grid,
ClutterPhotoGridCell *cell);
void
cltr_photo_grid_navigate(ClutterPhotoGrid *grid,
CltrDirection direction) ;
void /* bleh badly named */
cltr_photo_grid_activate_cell(ClutterPhotoGrid *grid);
2005-03-27 20:12:19 +00:00
gpointer
cltr_photo_grid_populate(gpointer data) ;
2005-03-24 16:46:49 +00:00
void
cltr_photo_grid_redraw(ClutterPhotoGrid *grid);
ClutterPhotoGrid*
cltr_photo_grid_new(ClutterWindow *win,
int n_cols,
int n_rows,
const gchar *imgs_path);
#endif