22
22
struct _PixelDataHandle
31
/* Creates a new tile manager with the specified
32
* width for the toplevel. The toplevel sizes is
33
* used to compute the number of levels and there
34
* size. Each level is 1/2 the width and height of
31
/* Creates a new tile manager with the specified width for the
32
* toplevel. The toplevel size is used to compute the number of
33
* levels and their size. Each level is 1/2 the width and height of
35
34
* the level above it.
37
* The toplevel is level 0. The smallest level in the
38
* hierarchy is "nlevels - 1". That level will be smaller
39
* than TILE_WIDTH x TILE_HEIGHT
36
* The toplevel is level 0. The smallest level in the hierarchy
37
* is "nlevels - 1". That level will be smaller than TILE_WIDTH x
41
TileManager * tile_manager_new (gint toplevel_width,
40
TileManager * tile_manager_new (gint width,
45
44
/* Ref/Unref a tile manager.
47
46
TileManager * tile_manager_ref (TileManager *tm);
48
47
void tile_manager_unref (TileManager *tm);
50
/* Set the validate procedure for the tile manager.
51
* The validate procedure is called when an invalid tile
52
* is referenced. If the procedure is NULL, then the tile
53
* is set to valid and its memory is allocated, but
49
/* Set the validate procedure for the tile manager. The validate
50
* procedure is called when an invalid tile is referenced. If the
51
* procedure is NULL, then the tile is set to valid and its memory is
52
* allocated, but not initialized.
56
54
void tile_manager_set_validate_proc (TileManager *tm,
57
TileValidateProc proc);
55
TileValidateProc proc);
59
57
/* Get a specified tile from a tile manager.
61
59
Tile * tile_manager_get_tile (TileManager *tm,
67
65
/* Get a specified tile from a tile manager.
69
67
Tile * tile_manager_get (TileManager *tm,
74
/* Request that (if possible) the tile at x,y be swapped
75
* in. This is only a hint to improve performance; no guarantees.
76
* The tile may be swapped in or otherwise made more accessible
77
* if it is convenient...
79
void tile_manager_get_async (TileManager *tm,
83
72
void tile_manager_map_tile (TileManager *tm,
88
77
void tile_manager_map (TileManager *tm,
92
81
/* Validate a tiles memory.
94
83
void tile_manager_validate (TileManager *tm,
97
86
void tile_invalidate (Tile **tile_ptr,
100
89
void tile_invalidate_tile (Tile **tile_ptr,
105
94
/* Given a toplevel tile, this procedure will invalidate
106
95
* (set the dirty bit) for this toplevel tile.
108
97
void tile_manager_invalidate_tiles (TileManager *tm,
109
Tile *toplevel_tile);
111
100
void tile_manager_set_user_data (TileManager *tm,
113
102
gpointer tile_manager_get_user_data (const TileManager *tm);
115
104
gint tile_manager_width (const TileManager *tm);
117
106
gint tile_manager_bpp (const TileManager *tm);
119
108
void tile_manager_get_offsets (const TileManager *tm,
122
111
void tile_manager_set_offsets (TileManager *tm,
126
115
gint64 tile_manager_get_memsize (const TileManager *tm,
127
116
gboolean sparse);
129
118
void tile_manager_get_tile_coordinates (TileManager *tm,
134
123
void tile_manager_map_over_tile (TileManager *tm,
138
127
PixelDataHandle * request_pixel_data (TileManager *tm,
146
135
void release_pixel_data (PixelDataHandle *pdh);
148
void read_pixel_data (TileManager *tm,
137
void read_pixel_data (TileManager *tm,
156
void write_pixel_data (TileManager *tm,
145
void write_pixel_data (TileManager *tm,
150
const guchar *buffer,
164
153
/* Fill buffer with the pixeldata for the pixel at coordinates x,y
165
154
* if x,y is outside the area of the tilemanger, nothing is done.
167
void read_pixel_data_1 (TileManager *tm,
156
void read_pixel_data_1 (TileManager *tm,
172
void write_pixel_data_1 (TileManager *tm,
161
void write_pixel_data_1 (TileManager *tm,
164
const guchar *buffer);
177
166
#endif /* __TILE_MANAGER_H__ */