void ScummEngine_v2::checkV2MouseOver(Common::Point pos) { VirtScreen *vs = &_virtscr[kVerbVirtScreen]; Common::Rect rect; byte *ptr, *dst; int i, x, y, new_box = -1; // Don't do anything unless the inventory is active if (!(_userState & USERSTATE_IFACE_INVENTORY)) { _mouseOverBoxV2 = -1; return; } if (_cursor.state > 0) { for (i = 0; i < ARRAYSIZE(_mouseOverBoxesV2); i++) { if (_mouseOverBoxesV2[i].rect.contains(pos.x, pos.y - vs->topline)) { new_box = i; break; } } } if ((new_box != _mouseOverBoxV2) || (_game.version == 0)) { if (_mouseOverBoxV2 != -1) { rect = _mouseOverBoxesV2[_mouseOverBoxV2].rect; dst = ptr = vs->getPixels(rect.left, rect.top); // Remove highlight. for (y = rect.height() - 1; y >= 0; y--) { for (x = rect.width() - 1; x >= 0; x--) { if (dst[x] == _mouseOverBoxesV2[_mouseOverBoxV2].hicolor) dst[x] = _mouseOverBoxesV2[_mouseOverBoxV2].color; } dst += vs->pitch; } markRectAsDirty(kVerbVirtScreen, rect); } if (new_box != -1) { rect = _mouseOverBoxesV2[new_box].rect; dst = ptr = vs->getPixels(rect.left, rect.top); // Apply highlight for (y = rect.height() - 1; y >= 0; y--) { for (x = rect.width() - 1; x >= 0; x--) { if (dst[x] == _mouseOverBoxesV2[new_box].color) dst[x] = _mouseOverBoxesV2[new_box].hicolor; } dst += vs->pitch; } markRectAsDirty(kVerbVirtScreen, rect); } _mouseOverBoxV2 = new_box; } }
void EditorView::GutterView::setOffset(KDCoordinate offset) { if (m_offset == offset) { return; } m_offset = offset; markRectAsDirty(bounds()); }
void TextField::ContentView::setEditing(bool isEditing, bool reinitDrafBuffer) { if (m_isEditing == isEditing && !reinitDrafBuffer) { return; } if (reinitDrafBuffer) { reinitDraftTextBuffer(); } m_isEditing = isEditing; markRectAsDirty(bounds()); layoutSubviews(); }
void FunctionGraphView::reloadBetweenBounds(float start, float end) { if (start == end) { return; } float pixelLowerBound = floatToPixel(Axis::Horizontal, start)-2.0; float pixelUpperBound = floatToPixel(Axis::Horizontal, end)+4.0; /* We exclude the banner frame from the dirty zone to avoid unnecessary * redrawing */ KDRect dirtyZone(KDRect(pixelLowerBound, 0, pixelUpperBound-pixelLowerBound, bounds().height()-m_bannerView->bounds().height())); markRectAsDirty(dirtyZone); }
void ExpressionField::reload() { layoutSubviews(); markRectAsDirty(bounds()); }
void BufferTextView::setText(const char * text) { assert(strlen(text) < sizeof(m_buffer)); strlcpy(m_buffer, text, sizeof(m_buffer)); markRectAsDirty(bounds()); }
void TabViewController::ContentView::setActiveView(View * view) { m_activeView = view; layoutSubviews(); markRectAsDirty(bounds()); }
void TextField::ContentView::setAlignment(float horizontalAlignment, float verticalAlignment) { m_horizontalAlignment = horizontalAlignment; m_verticalAlignment = verticalAlignment; markRectAsDirty(bounds()); }
void TextField::ContentView::setTextColor(KDColor textColor) { m_textColor = textColor; markRectAsDirty(bounds()); }
void TextField::ContentView::setBackgroundColor(KDColor backgroundColor) { m_backgroundColor = backgroundColor; markRectAsDirty(bounds()); }