Evas_Object *obj, *scr, *pan_smart;
Pan *pan;
Evas_Coord pan_x, pan_y, minw, minh;
-
+
struct {
int w, h;
Evas_Coord total_w, total_h;
* P | | | | | | | | | | | |
* A | | | | | | | | | | | |
* N +--+ +--+ +--+ +--+ +--+ +--+
- *
+ *
*/
static Span *
Span *sp;
int i, num, bucket;
Evas_Coord p;
-
+
static int lv = 0;
-
+
sp = calloc(1, sizeof(Span));
for (i = 0; i < lv; i++) printf(" ");
printf("SP: %i tot\n", total);
sp->total_child_count = total;
sp->pos = pos;
if (bucketsize == 1) return sp;
-
+
// get max number of children per bucket
num = bucket = (bucketsize + (levels - 1)) / levels;
sp->child = calloc(levels, sizeof(Span *));
_span_first(Span *sp)
{
Span *sp2;
-
+
if (!sp->child) return sp;
sp2 = _span_first(sp->child[0]);
return sp2;
_span_last(Span *sp)
{
Span *sp2;
-
+
if (!sp->child) return sp;
sp2 = _span_last(sp->child[sp->child_count - 1]);
return sp2;
{
Span *spp;
Evas_Coord pos = sp->pos;
-
+
for (spp = sp->parent; spp; spp = spp->parent)
pos += spp->pos;
return pos;
{
Span *spp, *spp_prev;
int i, num = 0;
-
- for (spp_prev = sp, spp = sp->parent; spp;
+
+ for (spp_prev = sp, spp = sp->parent; spp;
spp_prev = spp, spp = spp->parent)
{
if (spp->child)
{
int i, n, cnt, reduce = 0, deleted = 0, delstart = -1, num2, done;
Evas_Coord deleted_size = 0, size;
-
+
if (!sp->child)
{
*delsize = sp->size;
{
Span *sp2;
int i, j, n, src;
-
+
if (num < 0) return;
next:
// total child count and size go up by what we are inserting
{
// we have some children - find a spot and plug 'er in
Span **child;
-
+
src = 0;
// alloc a new child array and copy in old child ptrs from old array
// up until the insertion point (num)
{
Span *sp0, *sp;
-
+
sp0 = _span_build(46, 10, 4);
sp = _span_first(sp0);
if (sp) printf("first @ %i [%i], size %i\n", sp->pos, _span_real_pos_get(sp), sp->size);
for (sp = _span_first(sp0); sp; sp = _span_next(sp))
{
if (sp) printf(" @ %i [%i], size %i t: %i %i\n",
- sp->pos,
- _span_real_pos_get(sp),
+ sp->pos,
+ _span_real_pos_get(sp),
sp->size,
sp->child_count,
sp->total_child_count);
if (sp) printf("sp pos 455 @ %i [%i]\n", _span_real_pos_get(sp), _span_real_num_get(sp));
sp = _span_pos_get(sp0, 461);
if (sp) printf("sp pos 461 @ %i [%i]\n", _span_real_pos_get(sp), _span_real_num_get(sp));
-
+
printf("del @13, 11 spans\n");
_span_del(sp0, 13, 11);
for (sp = _span_first(sp0); sp; sp = _span_next(sp))