Beispiel #1
0
 //! Memory manager used by hash.
 MemoryManager memory_manager() const
 {
     return MemoryManager(ib_hash_pool(ib()));
 }
Beispiel #2
0
Connection ConstTransaction::connection() const
{
    return Connection(ib()->conn);
}
Beispiel #3
0
boost::posix_time::ptime ConstTransaction::started_time() const
{
    return ib_to_ptime(ib()->tv_created);
}
Beispiel #4
0
VarStore Transaction::var_store() const
{
    return VarStore(ib()->var_store);
}
Beispiel #5
0
MemoryPool ConstTransaction::memory_pool() const
{
    return MemoryPool(ib()->mp);
}
Beispiel #6
0
ParsedNameValue ConstTransaction::request_header() const
{
    return ParsedNameValue(ib()->request_header->head);
}
Beispiel #7
0
void Transaction::destroy() const
{
    ib_tx_destroy(ib());
}
Beispiel #8
0
const char* ConstContext::name() const
{
    return ib_context_name_get(ib());
}
Beispiel #9
0
const char* ConstContext::full_name() const
{
    return ib_context_full_get(ib());
}
Beispiel #10
0
MemoryManager Context::memory_manager()
{
    return MemoryManager(ib_context_get_mm(ib()));
}
Beispiel #11
0
const char* ConstContext::type() const
{
    return ib_context_type_get(ib());
}
Beispiel #12
0
ImageDraw::operator Image() const
{
	GuiLock __;
	XImage *xim = XGetImage(Xdisplay, dw, 0, 0, max(size.cx, 1), max(size.cy, 1), AllPlanes, ZPixmap);
	if(!xim)
		return Null;
	Visual *v = DefaultVisual(Xdisplay, Xscreenno);
	RasterFormat fmt;

	RGBA   palette[256];

	switch(xim->depth) {
	case 15:
	case 16:
		if(xim->byte_order == LSBFirst)
			fmt.Set16le(v->red_mask, v->green_mask, v->blue_mask);
		else
			fmt.Set16be(v->red_mask, v->green_mask, v->blue_mask);
		break;
	case 8: {
		int n = min(v->map_entries, 256);
		XColor colors[256];
		for(int i = 0; i < 256; i++) {
			colors[i].pixel = i;
			colors[i].flags = DoRed|DoGreen|DoBlue;
		}
		XQueryColors(Xdisplay, Xcolormap, colors, n);
		XColor *s = colors;
		XColor *e = s + n;
		while(s < e) {
			RGBA& t = palette[s->pixel];
			t.r = s->red >> 8;
			t.g = s->green >> 8;
			t.b = s->blue >> 8;
			t.a = 255;
			s++;
		}
		fmt.Set8();
		break;
	}
	default:
		if(xim->bits_per_pixel == 32)
			if(xim->byte_order == LSBFirst)
				fmt.Set32le(v->red_mask, v->green_mask, v->blue_mask);
			else
				fmt.Set32be(v->red_mask, v->green_mask, v->blue_mask);
		else
			if(xim->byte_order == LSBFirst)
				fmt.Set24le(v->red_mask, v->green_mask, v->blue_mask);
			else
				fmt.Set24be(v->red_mask, v->green_mask, v->blue_mask);
		break;
	}

	ImageBuffer ib(size);
	const byte *s = (const byte *)xim->data;
	RGBA *t = ib;
	for(int y = 0; y < size.cy; y++) {
		fmt.Read(t, s, size.cx, palette);
		s += xim->bytes_per_line;
		t += size.cx;
	}
	XDestroyImage(xim);
	if(has_alpha) {
		xim = XGetImage(Xdisplay, alpha.dw, 0, 0, max(size.cx, 1), max(size.cy, 1), AllPlanes, ZPixmap);
		if(xim) {
			const byte *s = (const byte *)xim->data;
			t = ib;
			Buffer<RGBA> line(size.cx);
			for(int y = 0; y < size.cy; y++) {
				fmt.Read(line, s, size.cx, palette);
				for(int x = 0; x < size.cx; x++)
					(t++)->a = line[x].r;
				s += xim->bytes_per_line;
			}
			XDestroyImage(xim);
		}
	}
	Premultiply(ib);
	return ib;
}
Beispiel #13
0
 //! Clear hash.
 void clear() const
 {
     ib_hash_clear(ib());
 }
Beispiel #14
0
 /**
  * Fetch all values into a list.
  *
  * Consider using iterators instead.
  *
  * @param[in] list List to write values to.
  **/
 void get_all(List<T>& list) const
 {
     throw_if_error(ib_hash_get_all(ib(), list.ib()));
 }
Beispiel #15
0
const char* ConstTransaction::path() const
{
    return ib()->path;
}
Beispiel #16
0
Context ConstContext::parent() const
{
    return Context(ib_context_parent_get(ib()));
}
Beispiel #17
0
ParsedRequestLine ConstTransaction::request_line() const
{
    return ParsedRequestLine(ib()->request_line);
}
Beispiel #18
0
Engine ConstContext::engine() const
{
    return Engine(ib_context_get_engine(ib()));
}
Beispiel #19
0
ConstVarStore ConstTransaction::var_store() const
{
    return ConstVarStore(ib()->var_store);
}
Beispiel #20
0
boost::posix_time::ptime ConstTransaction::postprocess_time() const
{
    return ib_to_ptime(ib()->tv_created,
                       (ib()->t.postprocess - ib()->t.started));
}
Beispiel #21
0
ib_flags_t& Transaction::flags() const
{
    return ib()->flags;
}
Beispiel #22
0
boost::posix_time::ptime ConstTransaction::logtime_time() const
{
    return ib_to_ptime(ib()->tv_created,
                       (ib()->t.logtime - ib()->t.started));
}
Beispiel #23
0
Engine ConstTransaction::engine() const
{
    return Engine(ib()->ib);
}
Beispiel #24
0
Transaction ConstTransaction::next() const
{
    return Transaction(ib()->next);
}
Beispiel #25
0
const char* ConstTransaction::id() const
{
    return ib()->id;
}
Beispiel #26
0
const char* ConstTransaction::hostname() const
{
    return ib()->hostname;
}
Beispiel #27
0
Context ConstTransaction::context() const
{
    return Context(ib()->ctx);
}
Beispiel #28
0
const char* ConstTransaction::effective_remote_ip_string() const
{
    return ib()->er_ipstr;
}
Beispiel #29
0
boost::posix_time::ptime ConstTransaction::request_finished_time() const
{
    return ib_to_ptime(ib()->tv_created,
                       (ib()->t.request_finished - ib()->t.started));
}
Beispiel #30
0
 //! Number of elements in hash. O(1)
 size_type size() const
 {
     return ib_hash_size(ib());
 }