Ejemplo n.º 1
0
struct place *place_neighbor(struct level *l, struct place *p, enum direction d)
{
	int x, y;
	place_location(l, p, &x, &y);
	switch (d) {
	case LEVEL_N: return get_place(l, x, y - 1);
	case LEVEL_E: return get_place(l, x + 1, y);
	case LEVEL_S: return get_place(l, x, y + 1);
	case LEVEL_W: return get_place(l, x - 1, y);
	}
	return NULL;
}
Ejemplo n.º 2
0
void		*put_memory(void *ptr, size_t size)
{
  void		*tmp;

  tmp = get_place(size);
  if (tmp != NULL)
    {
      ptr = tmp;
      modif_list(ptr, size);
    }
  else
    {
      ptr = sbrk(size);
      my_put_bot_list(ptr, size);
      end = sbrk(0);
    }
  return (ptr);
}
Ejemplo n.º 3
0
void BBP_exit_moving(plugin_info *PI)
{
    if (false == PI->inSlit && (PI->is_moving || PI->is_sizing))
    {
        RECT r;
        GetWindowRect(PI->hwnd, &r);

        if (PI->is_sizing) {
            PI->width = r.right - r.left;
            PI->height = r.bottom - r.top;
            write_rc(PI, &PI->width);
        } else {
            PI->xpos = r.left;
            PI->ypos = r.top;
            PI->place = get_place(PI);
            write_rc(PI, &PI->xpos);
        }
    }

    PI->is_moving = false;
    PI->is_sizing = false;
}
Ejemplo n.º 4
0
	void window::exposed()
	{
      xlib::rect rc = get_place();
      int view_w = xlib::width(rc);
      int view_h = xlib::height(rc);
      if( !buffer ||
          view_w != int(buffer->width()) ||
          view_h != int(buffer->height()) )
      {
        buffer = new image(view_w,view_h);
        dirty_area.x1 = 0; rc;//agg::rect_i(rc.x1, rc.y1, rc.x2, rc.y2);
        dirty_area.y1 = 0;
        dirty_area.x2 = dirty_area.x1 + buffer->width();
        dirty_area.y2 = dirty_area.y1 + buffer->height();
        if(ximg)
        {
          ximg->data = 0;
          XDestroyImage(ximg);
        }
        ximg = XCreateImage(env, env.visual, env.depth, ZPixmap,
                       0,
                       (char*)buffer->pmap.buf(),
                       view_w,
                       view_h,
                       env.sys_bpp,
                       view_w * (env.sys_bpp / 8));
        ximg->byte_order = env.byte_order;

      }

      agg::rendering_buffer rbuf;
      rbuf.attach(buffer->pmap.buf(), buffer->pmap.width(), buffer->pmap.height(), buffer->pmap.stride());

      delegate_paint(rbuf);

      put_image( &rbuf,agg::pix_format_bgra32 );
	}