本文整理汇总了C++中EwkView::wkView方法的典型用法代码示例。如果您正苦于以下问题:C++ EwkView::wkView方法的具体用法?C++ EwkView::wkView怎么用?C++ EwkView::wkView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EwkView
的用法示例。
在下文中一共展示了EwkView::wkView方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleEvasObjectCalculate
void EwkView::handleEvasObjectCalculate(Evas_Object* evasObject)
{
Ewk_View_Smart_Data* smartData = toSmartData(evasObject);
ASSERT(smartData);
EwkView* self = toEwkView(smartData);
smartData->changed.any = false;
Evas_Coord x, y, width, height;
evas_object_geometry_get(evasObject, &x, &y, &width, &height);
if (smartData->changed.position) {
smartData->changed.position = false;
smartData->view.x = x;
smartData->view.y = y;
evas_object_move(smartData->image, x, y);
WKViewSetUserViewportTranslation(self->wkView(), x, y);
}
if (smartData->changed.size) {
smartData->changed.size = false;
smartData->view.w = width;
smartData->view.h = height;
WKViewSetSize(self->wkView(), WKSizeMake(width, height));
if (WKPageUseFixedLayout(self->wkPage()))
self->pageViewportController().didChangeViewportSize(self->size());
self->setNeedsSurfaceResize();
}
}
示例2: handleSingleTap
void GestureHandler::handleSingleTap(const IntPoint& position)
{
Evas* evas = evas_object_evas_get(m_ewkView->evasObject());
ASSERT(evas);
// Send mouse move, down and up event to create fake click event.
Evas_Event_Mouse_Move mouseMove;
mouseMove.buttons = 0;
mouseMove.prev.output.x = mouseMove.prev.canvas.x = position.x();
mouseMove.prev.output.y = mouseMove.prev.canvas.y = position.y();
mouseMove.cur.output.x = mouseMove.cur.canvas.x = position.x();
mouseMove.cur.output.y = mouseMove.cur.canvas.y = position.y();
mouseMove.data = 0;
mouseMove.modifiers = const_cast<Evas_Modifier*>(evas_key_modifier_get(evas));
mouseMove.locks = const_cast<Evas_Lock*>(evas_key_lock_get(evas));
mouseMove.timestamp = ecore_loop_time_get();
mouseMove.event_flags = EVAS_EVENT_FLAG_NONE;
mouseMove.dev = 0;
WKViewSendMouseMoveEvent(m_ewkView->wkView(), &mouseMove);
Evas_Event_Mouse_Down mouseDown;
mouseDown.button = 1;
mouseDown.output.x = mouseDown.canvas.x = position.x();
mouseDown.output.y = mouseDown.canvas.y = position.y();
mouseDown.data = 0;
mouseDown.modifiers = const_cast<Evas_Modifier*>(evas_key_modifier_get(evas));
mouseDown.locks = const_cast<Evas_Lock*>(evas_key_lock_get(evas));
mouseDown.flags = EVAS_BUTTON_NONE;
mouseDown.timestamp = ecore_loop_time_get();
mouseDown.event_flags = EVAS_EVENT_FLAG_NONE;
mouseDown.dev = 0;
WKViewSendMouseDownEvent(m_ewkView->wkView(), &mouseDown);
Evas_Event_Mouse_Up mouseUp;
mouseUp.button = 1;
mouseUp.output.x = mouseUp.canvas.x = position.x();
mouseUp.output.y = mouseUp.canvas.y = position.y();
mouseUp.data = 0;
mouseUp.modifiers = const_cast<Evas_Modifier*>(evas_key_modifier_get(evas));
mouseUp.locks = const_cast<Evas_Lock*>(evas_key_lock_get(evas));
mouseUp.flags = EVAS_BUTTON_NONE;
mouseUp.timestamp = ecore_loop_time_get();
mouseUp.event_flags = EVAS_EVENT_FLAG_NONE;
mouseUp.dev = 0;
WKViewSendMouseUpEvent(m_ewkView->wkView(), &mouseUp);
}
示例3: handleEvasObjectColorSet
void EwkView::handleEvasObjectColorSet(Evas_Object* evasObject, int red, int green, int blue, int alpha)
{
Ewk_View_Smart_Data* smartData = toSmartData(evasObject);
ASSERT(smartData);
EwkView* view = toEwkView(smartData);
ASSERT(view);
alpha = clampTo(alpha, 0, 255);
red = clampTo(red, 0, alpha);
green = clampTo(green, 0, alpha);
blue = clampTo(blue, 0, alpha);
evas_object_image_alpha_set(smartData->image, alpha < 255);
WKViewSetDrawsBackground(view->wkView(), red || green || blue);
WKViewSetDrawsTransparentBackground(view->wkView(), alpha < 255);
parentSmartClass.color_set(evasObject, red, green, blue, alpha);
}
示例4: ewk_view_contents_size_get
Eina_Bool ewk_view_contents_size_get(const Evas_Object* ewkView, Evas_Coord* width, Evas_Coord* height)
{
EwkView* impl = toEwkViewChecked(ewkView);
if (EINA_UNLIKELY(!impl)) {
EINA_LOG_CRIT("no private data for object %p", ewkView);
if (width)
*width = 0;
if (height)
*height = 0;
return false;
}
WKSize contentsSize = WKViewGetContentsSize(impl->wkView());
if (width)
*width = contentsSize.width;
if (height)
*height = contentsSize.height;
return true;
}