本文整理汇总了C++中IDirectFBWindow::SetCursorShape方法的典型用法代码示例。如果您正苦于以下问题:C++ IDirectFBWindow::SetCursorShape方法的具体用法?C++ IDirectFBWindow::SetCursorShape怎么用?C++ IDirectFBWindow::SetCursorShape使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDirectFBWindow
的用法示例。
在下文中一共展示了IDirectFBWindow::SetCursorShape方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
static struct graphics_device *
directfb_init_device (void)
{
struct graphics_device *gd;
DFBDeviceData *data;
IDirectFBWindow *window;
DFBWindowDescription desc;
desc.flags = (DFBWindowDescriptionFlags)(DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_POSX | DWDESC_POSY);
desc.width = directfb_driver.x;
desc.height = directfb_driver.y;
desc.posx = 0;
desc.posy = 0;
retry:
if (layer->CreateWindow (layer, &desc, &window) != DFB_OK) {
if (out_of_memory(MF_GPI, NULL, 0))
goto retry;
return NULL;
}
gd = mem_alloc (sizeof (struct graphics_device));
gd->size.x1 = 0;
gd->size.y1 = 0;
window->GetSize (window, &gd->size.x2, &gd->size.y2);
gd->clip = gd->size;
data = mem_alloc (sizeof (DFBDeviceData));
data->window = window;
data->flip_pending = 0;
if (arrow)
window->SetCursorShape (window, arrow, arrow_hot_x, arrow_hot_y);
window->GetSurface (window, &data->surface);
window->GetID (window, &data->id);
gd->driver_data = data;
gd->user_data = NULL;
directfb_add_to_table (gd);
window->AttachEventBuffer (window, events);
window->SetOpacity (window, FOCUSED_OPACITY);
return gd;
}
示例2:
DFBResult
lite_set_window_cursor(LiteWindow *window, LiteCursor *cursor)
{
DFBResult res = DFB_OK;
LITE_NULL_PARAMETER_CHECK(window);
LITE_NULL_PARAMETER_CHECK(cursor);
D_DEBUG_AT(LiteCursorDomain, "Set cursor: %p for window: %p\n",
cursor, window);
IDirectFBWindow *win = window->window;
if (cursor->surface) {
res = win->SetCursorShape(win, cursor->surface, cursor->hot_x, cursor->hot_y);
}
return res;
}
示例3:
static struct graphics_device *
directfb_init_device (void)
{
struct graphics_device *gd;
DFBDeviceData *data;
IDirectFBWindow *window;
DFBWindowDescription desc;
if (!dfb || !layer)
return NULL;
desc.flags = DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_POSX | DWDESC_POSY;
/*desc.width = directfb_driver.x;
desc.height = directfb_driver.y;
desc.posx = 0;
desc.posy = 0;*/
desc.width = (int)w;
desc.height = (int)h;
desc.posx = (int)x;
desc.posy = (int)y;
if (layer->CreateWindow (layer, &desc, &window) != DFB_OK)
return NULL;
gd = mem_alloc (sizeof (struct graphics_device));
gd->size.x1 = 0;
gd->size.y1 = 0;
window->GetSize (window, &gd->size.x2, &gd->size.y2);
gd->clip = gd->size;
data = mem_alloc (sizeof (DFBDeviceData));
data->window = window;
data->mapped = 0;
data->flip_pending = 0;
data->flipWindow = 0;
data->ghostWindow = 0;
if (arrow)
window->SetCursorShape (window, arrow, arrow_hot_x, arrow_hot_y);
window->GetSurface (window, &data->surface);
window->GetID (window, &data->id);
gd->drv = &directfb_driver;
gd->driver_data = data;
gd->user_data = NULL;
directfb_add_to_table (gd);
if (!events)
{
window->CreateEventBuffer (window, &events);
event_timer = install_timer (20, directfb_check_events, events);
}
else
{
window->AttachEventBuffer (window, events);
}
return gd;
}