2005-03-24 11:46:49 -05: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 15:12:19 -05:00
|
|
|
CLTR_PHOTO_GRID_STATE_LOADING ,
|
|
|
|
CLTR_PHOTO_GRID_STATE_LOAD_COMPLETE ,
|
2005-03-24 11:46:49 -05: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 ,
|
2005-03-31 13:19:25 -05:00
|
|
|
CLTR_PHOTO_GRID_STATE_SCROLLED_MOVE ,
|
2005-03-24 11:46:49 -05:00
|
|
|
}
|
|
|
|
ClutterPhotoGridState;
|
|
|
|
|
2005-03-27 15:12:19 -05:00
|
|
|
typedef enum ClutterPhotoGridCellState
|
|
|
|
{
|
|
|
|
CLTR_PHOTO_GRID_CELL_STATE_APPEARING,
|
|
|
|
CLTR_PHOTO_GRID_CELL_STATE_STATIC,
|
|
|
|
}
|
|
|
|
ClutterPhotoGridCellState;
|
|
|
|
|
|
|
|
|
2005-03-24 11:46:49 -05:00
|
|
|
struct ClutterPhotoGridCell
|
|
|
|
{
|
2005-03-30 11:52:02 -05:00
|
|
|
Pixbuf *pixb;
|
|
|
|
float angle;
|
|
|
|
CltrTexture *texture;
|
|
|
|
gint anim_step;
|
2005-03-27 15:12:19 -05:00
|
|
|
|
|
|
|
ClutterPhotoGridCellState state;
|
2005-03-24 11:46:49 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
struct ClutterPhotoGrid
|
|
|
|
{
|
|
|
|
/* XXX should be base widget stuff */
|
|
|
|
int x,y;
|
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
ClutterWindow *parent;
|
|
|
|
|
|
|
|
/* ****** */
|
|
|
|
|
2005-03-27 15:12:19 -05:00
|
|
|
gchar *img_path;
|
|
|
|
|
2005-03-24 11:46:49 -05:00
|
|
|
int n_rows;
|
|
|
|
int n_cols;
|
2005-03-31 13:19:25 -05:00
|
|
|
int row_offset; /* for scrolling */
|
2005-03-24 11:46:49 -05:00
|
|
|
|
|
|
|
int cell_width;
|
|
|
|
int cell_height;
|
|
|
|
|
|
|
|
GList *cells_tail;
|
|
|
|
GList *cell_active;
|
|
|
|
|
2005-03-31 13:19:25 -05:00
|
|
|
/* animation / zoom etc stuff */
|
2005-03-24 11:46:49 -05:00
|
|
|
|
|
|
|
int anim_n_steps, anim_step;
|
|
|
|
|
|
|
|
float zoom_min, zoom_max, zoom_step;
|
|
|
|
|
|
|
|
float view_min_x, view_max_x, view_min_y, view_max_y;
|
|
|
|
|
2005-03-31 13:19:25 -05:00
|
|
|
float scroll_dist;
|
|
|
|
|
2005-03-24 11:46:49 -05:00
|
|
|
ClutterPhotoGridState state;
|
2005-03-30 11:52:02 -05:00
|
|
|
|
2005-03-31 13:19:25 -05:00
|
|
|
int scroll_state, scroll_step; /* urg */
|
|
|
|
|
2005-03-24 11:46:49 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
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 15:12:19 -05:00
|
|
|
gpointer
|
|
|
|
cltr_photo_grid_populate(gpointer data) ;
|
2005-03-24 11:46:49 -05: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
|