本文整理汇总了C++中ToolHandler::getGdkColor方法的典型用法代码示例。如果您正苦于以下问题:C++ ToolHandler::getGdkColor方法的具体用法?C++ ToolHandler::getGdkColor怎么用?C++ ToolHandler::getGdkColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ToolHandler
的用法示例。
在下文中一共展示了ToolHandler::getGdkColor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateCursor
void Cursor::updateCursor()
{
XOJ_CHECK_TYPE(Cursor);
MainWindow* win = control->getWindow();
if (!win)
{
return;
}
XournalView* xournal = win->getXournal();
if (!xournal)
{
return;
}
GdkCursor* cursor = NULL;
if (this->busy)
{
cursor = gdk_cursor_new(GDK_WATCH);
}
else
{
ToolHandler* handler = control->getToolHandler();
ToolType type = handler->getToolType();
if (type == TOOL_HAND)
{
if (this->mouseDown)
{
cursor = gdk_cursor_new(GDK_FLEUR);
}
else
{
cursor = gdk_cursor_new(GDK_HAND1);
}
}
else if(!this->insidePage)
{
// not inside page: so use default cursor
}
else if (this->selectionType)
{
switch (this->selectionType)
{
case CURSOR_SELECTION_MOVE:
cursor = gdk_cursor_new(GDK_FLEUR);
break;
case CURSOR_SELECTION_TOP_LEFT:
cursor = gdk_cursor_new(GDK_TOP_LEFT_CORNER);
break;
case CURSOR_SELECTION_TOP_RIGHT:
cursor = gdk_cursor_new(GDK_TOP_RIGHT_CORNER);
break;
case CURSOR_SELECTION_BOTTOM_LEFT:
cursor = gdk_cursor_new(GDK_BOTTOM_LEFT_CORNER);
break;
case CURSOR_SELECTION_BOTTOM_RIGHT:
cursor = gdk_cursor_new(GDK_BOTTOM_RIGHT_CORNER);
break;
case CURSOR_SELECTION_LEFT:
case CURSOR_SELECTION_RIGHT:
cursor = gdk_cursor_new(GDK_SB_H_DOUBLE_ARROW);
break;
case CURSOR_SELECTION_TOP:
case CURSOR_SELECTION_BOTTOM:
cursor = gdk_cursor_new(GDK_SB_V_DOUBLE_ARROW);
break;
}
}
else if (type == TOOL_PEN)
{
cursor = getPenCursor();
}
else if (type == TOOL_ERASER)
{
GdkColor bg = { 0, 65535, 65535, 65535 };
GdkColor fg = { 0, 0, 0, 0 };
GdkPixmap* source = gdk_bitmap_create_from_data(NULL, (gchar*) CURSOR_HIGLIGHTER_BITS,
16, 16);
GdkPixmap* mask = gdk_bitmap_create_from_data(NULL, (gchar*) CURSOR_HILIGHTER_MASK,
16, 16);
cursor = gdk_cursor_new_from_pixmap(source, mask, &fg, &bg, 7, 7);
gdk_bitmap_unref(source);
gdk_bitmap_unref(mask);
}
else if (type == TOOL_HILIGHTER)
{
GdkColor fg = { 0, 0, 0, 0 };
GdkColor bg = handler->getGdkColor();
GdkPixmap* source = gdk_bitmap_create_from_data(NULL, (gchar*) CURSOR_HIGLIGHTER_BITS,
16, 16);
GdkPixmap* mask = gdk_bitmap_create_from_data(NULL, (gchar*) CURSOR_HILIGHTER_MASK,
16, 16);
cursor = gdk_cursor_new_from_pixmap(source, mask, &fg, &bg, 7, 7);
gdk_bitmap_unref(source);
gdk_bitmap_unref(mask);
}
//.........这里部分代码省略.........