当前位置: 首页>>代码示例>>C++>>正文


C++ DECL_PRIV函数代码示例

本文整理汇总了C++中DECL_PRIV函数的典型用法代码示例。如果您正苦于以下问题:C++ DECL_PRIV函数的具体用法?C++ DECL_PRIV怎么用?C++ DECL_PRIV使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了DECL_PRIV函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ftk_source_dfb_create

FtkSource* ftk_source_dfb_create(IDirectFB* dfb)
{
	FtkSource* thiz = FTK_ZALLOC(sizeof(FtkSource)+sizeof(PrivInfo));

	if(thiz != NULL)
	{
		int fd = 0;
		DECL_PRIV(thiz, priv);
		IDirectFBEventBuffer* event_buffer = NULL;

		thiz->get_fd   =  ftk_source_dfb_get_fd;
		thiz->check    = ftk_source_dfb_check;
		thiz->dispatch = ftk_source_dfb_dispatch;
		thiz->destroy  = ftk_source_dfb_destroy;

		dfb->CreateInputEventBuffer( dfb, DICAPS_ALL, DFB_FALSE, &event_buffer );
		if(event_buffer != NULL)
		{
			event_buffer->CreateFileDescriptor(event_buffer, &fd);
		}
		thiz->ref = 1;
		priv->fd = fd;
		priv->event_buffer = event_buffer;
	}

	return thiz;
}
开发者ID:htbegin,项目名称:pyftk,代码行数:27,代码来源:ftk_source_dfb.c

示例2: ftk_source_primary_get_fd

static int ftk_source_primary_get_fd(FtkSource* thiz)
{
	DECL_PRIV(thiz, priv);
	return_val_if_fail(priv != NULL, -1);

	return ftk_pipe_get_read_handle(priv->pipe);
}
开发者ID:suzp1984,项目名称:parrot,代码行数:7,代码来源:ftk_source_primary.c

示例3: ftk_source_ps2mouse_create

FtkSource* ftk_source_ps2mouse_create(const char* filename, FtkOnEvent on_event, void* user_data, int max_x, int max_y)
{
	FtkSource* thiz = (FtkSource*)FTK_ZALLOC(sizeof(FtkSource) + sizeof(PrivInfo));

	if(thiz != NULL)
	{
		DECL_PRIV(thiz, priv);

		thiz->get_fd   = ftk_source_ps2mouse_get_fd;
		thiz->check    = ftk_source_ps2mouse_check;
		thiz->dispatch = ftk_source_ps2mouse_dispatch;
		thiz->destroy  = ftk_source_ps2mouse_destroy;

		thiz->ref = 1;
		priv->fd = open(filename, O_RDONLY);
		ftk_strncpy(priv->filename, filename, sizeof(priv->filename));

		open_device(priv, max_x, max_y);
		if(priv->fd < 0)
		{
			FTK_ZFREE(thiz, sizeof(thiz) + sizeof(PrivInfo));
			return NULL;
		}

		priv->on_event = on_event;
		priv->user_data = user_data;
		priv->is_first_move = true;
		ftk_logd("%s: %d=%s priv->user_data=%p\n", __func__, priv->fd, filename, priv->user_data);
	}

	return thiz;
}
开发者ID:bbw2008good,项目名称:ftk,代码行数:32,代码来源:ftk_source_ps2mouse.c

示例4: ftk_canvas_default_draw_bitmap_normal

static Ret ftk_canvas_default_draw_bitmap_normal(FtkCanvas* thiz, FtkBitmap* bitmap, FtkRect* s, FtkRect* d)
{
    int i = 0;
    int j = 0;
    int k = 0;
    int x = s->x;
    int y = s->y;
    int w = s->width;
    int h = s->height;
    int xoffset = d->x;
    int yoffset = d->y;
    FtkColor* src = NULL;
    FtkColor* dst = NULL;
    FtkColor* psrc = NULL;
    FtkColor* pdst = NULL;
    unsigned char alpha = 0;
    DECL_PRIV(thiz, priv);
    int width  = priv->w;
    int height = priv->h;
    int bitmap_width   = ftk_bitmap_width(bitmap);
    int bitmap_height  = ftk_bitmap_height(bitmap);

    return_val_if_fail(thiz != NULL && bitmap != NULL, RET_FAIL);
    return_val_if_fail(x < bitmap_width, RET_FAIL);
    return_val_if_fail(y < bitmap_height, RET_FAIL);
    return_val_if_fail(xoffset < width, RET_FAIL);
    return_val_if_fail(yoffset < height, RET_FAIL);

    src = ftk_bitmap_lock(bitmap);
    dst = priv->bits;

    w = (x + w) < bitmap_width  ? w : bitmap_width - x;
    w = (xoffset + w) < width  ? w : width  - xoffset;
    h = (y + h) < bitmap_height ? h : bitmap_height - y;
    h = (yoffset + h) < height ? h : height - yoffset;

    w += x;
    h += y;

    src += y * bitmap_width;
    dst += yoffset * width;

    if(thiz->gc.mask & FTK_GC_ALPHA)
    {
        for(i = y; i < h; i++)
        {
            for(j = x, k = xoffset; j < w; j++, k++)
            {
                pdst = dst+k;
                psrc = src+j;
                alpha = (psrc->a * thiz->gc.alpha) >> 8;
                PUT_PIXEL(pdst, psrc, alpha);
            }
            src += bitmap_width;
            dst += width;
        }
    }
    else
    {
        for(i = y; i < h; i++)
开发者ID:prife,项目名称:ftk,代码行数:60,代码来源:ftk_canvas_default.c

示例5: ftk_wnd_manager_default_map_panels

static Ret  ftk_wnd_manager_default_map_panels(FtkWndManager* thiz, int map)
{
	int i = 0;
	Ret ret = RET_IGNORED;
	FtkEvent event;
	FtkWidget* win = NULL;
	DECL_PRIV(thiz, priv);
	return_val_if_fail(thiz != NULL && priv->top > 0, RET_FAIL);
	
	for(i = 0; i < priv->top; i++)
	{
		win = priv->windows[i];
		if(ftk_widget_type(win) == FTK_STATUS_PANEL && ftk_widget_is_visible(win))
		{
			if(!(map && ftk_window_is_mapped(win)))
			{
				ftk_event_init(&event, map ? FTK_EVT_MAP : FTK_EVT_UNMAP);
				event.widget = win;
				ftk_wnd_manager_dispatch_event(thiz, &event);
				ret = RET_OK;
			}
			ftk_widget_invalidate(win);
		}
	}

	return ret;
}
开发者ID:htbegin,项目名称:pyftk,代码行数:27,代码来源:ftk_wnd_manager_default.c

示例6: ftk_canvas_default_draw_hline

static Ret ftk_canvas_default_draw_hline(FtkCanvas* thiz, int x, int y, int w)
{
    int i = 0;
    int width = 0;
    int height = 0;
    FtkColor* bits = NULL;
    unsigned char alpha = 0;
    FtkColor* pdst = NULL;
    FtkColor* color = NULL;
    DECL_PRIV(thiz, priv);
    width  = priv->w;
    height = priv->h;
    bits   = priv->bits;
    return_val_if_fail(bits != NULL && x < width, RET_FAIL);
    return_val_if_fail(y < height, RET_FAIL);
    alpha = thiz->gc.mask & FTK_GC_ALPHA ? thiz->gc.alpha :  thiz->gc.fg.a;

    x = x < 0 ? 0 : x;
    y = y < 0 ? 0 : y;
    w = (x + w) < width ? w : width - x;
    color = &(thiz->gc.fg);
    pdst = bits + y * width + x;

    for(i = w; i > 0; i--, pdst++)
    {
        PUT_PIXEL(pdst, color, alpha);
    }

    return RET_OK;
}
开发者ID:prife,项目名称:ftk,代码行数:30,代码来源:ftk_canvas_default.c

示例7: ftk_canvas_default_draw_round_rect

static Ret ftk_canvas_default_draw_round_rect(FtkCanvas* thiz, int x, int y, int w, int h, int fill)
{
    int width  = 0;
    int height = 0;
    DECL_PRIV(thiz, priv);

    width  = priv->w;
    height = priv->h;
    return_val_if_fail(x < width && y < height, RET_FAIL);
    return_val_if_fail(w > 8 && h > 8, RET_FAIL);

    ftk_canvas_default_draw_hline(thiz, x + 2, y, w-4);
    ftk_canvas_default_draw_hline(thiz, x + 1, y + 1, w-2);
    ftk_canvas_default_draw_vline(thiz, x, y + 2, h - 4);
    ftk_canvas_default_draw_vline(thiz, x + 1, y + 1, h - 2);

    ftk_canvas_default_draw_vline(thiz, x+w-1, y + 2, h - 4);
    ftk_canvas_default_draw_vline(thiz, x + w -2, y + 1, h - 2);
    ftk_canvas_default_draw_hline(thiz, x + 1, y + h - 1, w-2);
    ftk_canvas_default_draw_hline(thiz, x + 2, y + h - 2, w-4);

    if(fill)
    {
        ftk_canvas_default_draw_rect_impl(thiz, x + 2, y + 2, w - 4, h - 4, fill);
    }

    return RET_OK;
}
开发者ID:prife,项目名称:ftk,代码行数:28,代码来源:ftk_canvas_default.c

示例8: ftk_display_mem_width

static int ftk_display_mem_width(FtkDisplay* thiz)
{
	DECL_PRIV(thiz, priv);
	return_val_if_fail(priv != NULL, 0);

	return priv->width;
}
开发者ID:htbegin,项目名称:pyftk,代码行数:7,代码来源:ftk_display_mem.c

示例9: ftk_display_mem_height

static int ftk_display_mem_height(FtkDisplay* thiz)
{
	DECL_PRIV(thiz, priv);
	return_val_if_fail(priv != NULL, 0);

	return priv->height;
}
开发者ID:htbegin,项目名称:pyftk,代码行数:7,代码来源:ftk_display_mem.c

示例10: ftk_display_mem_update_directly

Ret ftk_display_mem_update_directly(FtkDisplay* thiz, FtkPixelFormat format,
	void* bits, size_t width, size_t height, size_t xoffset, size_t yoffset)
{
	size_t w = 0;
	size_t h = 0;
	char* src = NULL;
	char* dst = NULL;
	DECL_PRIV(thiz, priv);
	return_val_if_fail(bits != NULL, RET_FAIL);
	return_val_if_fail(ftk_display_mem_is_active(thiz), RET_FAIL);
	return_val_if_fail(xoffset < priv->width && yoffset < priv->height, RET_FAIL);

	w = (xoffset + width) < priv->width ? width : priv->width - xoffset;
	h = (yoffset + height) < priv->height ? height : priv->height - yoffset;

	if(format == priv->format)
	{
		src = (char*)bits;
		dst = (char*)priv->bits + priv->width * priv->bpp + xoffset;
		for(; h; h--)
		{
			memcpy(dst, src, priv->bpp * w);
			dst += priv->width * priv->bpp;
			src += width * priv->bpp;
		}
	}
	else
	{
		/*TODO*/
		assert(!"not supprted yet");
	}

	return RET_OK;
}
开发者ID:htbegin,项目名称:pyftk,代码行数:34,代码来源:ftk_display_mem.c

示例11: ftk_display_mem_update

static Ret ftk_display_mem_update(FtkDisplay* thiz, FtkBitmap* bitmap, FtkRect* rect, int xoffset, int yoffset)
{
	Ret ret = RET_OK;
	DECL_PRIV(thiz, priv);
	int display_width  = priv->width;
	int display_height = priv->height;
	return_val_if_fail(priv != NULL, RET_FAIL);

	ftk_logd("%s: ox=%d oy=%d (%d %d %d %d)\n", __func__, xoffset, yoffset, 
		rect->x, rect->y, rect->width, rect->height);
	ret = priv->copy_to_data(bitmap, rect, 
		priv->bits, xoffset, yoffset, display_width, display_height); 

	if(priv->sync != NULL && ret == RET_OK)
	{
		FtkRect r;
		r.x = xoffset;
		r.y = yoffset;
		r.width = rect->width;
		r.height = rect->height;
		priv->sync(priv->sync_ctx, &r);
	}

	return ret;
}
开发者ID:htbegin,项目名称:pyftk,代码行数:25,代码来源:ftk_display_mem.c

示例12: ftk_app_demo_get_icon

static FtkBitmap* ftk_app_demo_get_icon(FtkApp* thiz)
{
    DECL_PRIV(thiz, priv);
    return_val_if_fail(priv != NULL, NULL);

    return priv->icon;
}
开发者ID:caicha,项目名称:ftk,代码行数:7,代码来源:ftk_app_demo.c

示例13: ftk_app_demo_get_name

static const char* ftk_app_demo_get_name(FtkApp* thiz)
{
    DECL_PRIV(thiz, priv);
    return_val_if_fail(priv != NULL, NULL);

    return priv->name;
}
开发者ID:caicha,项目名称:ftk,代码行数:7,代码来源:ftk_app_demo.c

示例14: ftk_input_method_hw_create

FtkInputMethod* ftk_input_method_hw_create(void)
{
	FtkInputMethod* thiz = FTK_ZALLOC(sizeof(FtkInputMethod) + sizeof(PrivInfo));

	if(thiz != NULL)
	{
		FtkColor c = {0};
		DECL_PRIV(thiz, priv);

		thiz->ref  = 1;
		thiz->name = _("Hand Write");	
		thiz->set_type     = ftk_input_method_hw_set_type;
		thiz->focus_in     = ftk_input_method_hw_focus_in;
		thiz->focus_out    = ftk_input_method_hw_focus_out;
		thiz->handle_event = ftk_input_method_hw_handle_event;
		thiz->destroy      = ftk_input_method_hw_destroy;

		c.r = 0xff;
		c.b = 0xff;
		priv->painter = ftk_stroke_painter_create();
		priv->engine = ftk_hand_write_engine_create(on_handwrite_result, thiz);
		ftk_input_method_hw_set_rect(thiz, NULL);
		ftk_input_method_hw_set_pen_width(thiz, 3);
		ftk_input_method_hw_set_pen_color(thiz, c);
		ftk_input_method_hw_set_click_timeout(thiz, 300);
		ftk_input_method_hw_set_commit_timeout(thiz, 1500);
	}

	return thiz;
}
开发者ID:bbw2008good,项目名称:ftk,代码行数:30,代码来源:ftk_input_method_hw.c

示例15: ftk_source_psp_create

FtkSource* ftk_source_psp_create(FtkDisplay* display, FtkOnEvent on_event, void* ctx)
{
	FtkSource* thiz = NULL;
	
	return_val_if_fail(display != NULL && on_event != NULL, NULL);

	thiz = (FtkSource*)FTK_ZALLOC(sizeof(FtkSource) + sizeof(PrivInfo));

	if(thiz != NULL)
	{
		DECL_PRIV(thiz, priv);
		thiz->get_fd   = ftk_source_psp_get_fd;
		thiz->check	   = ftk_source_psp_check;
		thiz->dispatch = ftk_source_psp_dispatch;
		thiz->destroy  = ftk_source_psp_destroy;

		thiz->ref = 1;
		priv->ctx = ctx;
		priv->on_event = on_event;
		priv->display = display;

		priv->psp_keypress = 0;
	}

	return thiz;
}
开发者ID:bbw2008good,项目名称:ftk,代码行数:26,代码来源:ftk_source_psp.c


注:本文中的DECL_PRIV函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。