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


C++ IDirectFBWindow::SetCursorShape方法代码示例

本文整理汇总了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;
}
开发者ID:coolstreamtech,项目名称:cst-public-plugins-links,代码行数:51,代码来源:directfb.c

示例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;
}
开发者ID:kizukukoto,项目名称:WDN900_GPL,代码行数:18,代码来源:cursor.c

示例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;
}
开发者ID:Gingar,项目名称:port,代码行数:64,代码来源:directfb.c


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