AbstractVisualizedData * RenderView::addDataObject(DataObject * dataObject) { updateTitle(dataObject->name() + " (loading to GPU)"); QApplication::processEvents(QEventLoop::ExcludeUserInputEvents); // abort if we received a close event in QApplication::processEvents if (m_closingRequested) { return nullptr; } if (m_deletedData.remove(dataObject)) { return nullptr; } auto newContent = implementation().requestVisualization(*dataObject); if (!newContent) { return nullptr; } auto newContentPtr = newContent.get(); m_contents.push_back(std::move(newContent)); m_dataObjectToVisualization.insert(dataObject, newContentPtr); implementation().addContent(newContentPtr, 0); return newContentPtr; }
void RenderView::removeDataObject(DataObject * dataObject) { AbstractVisualizedData * renderedData = m_dataObjectToVisualization.value(dataObject, nullptr); // for the case that we are currently loading this object m_deletedData << dataObject; // we didn't render this object if (!renderedData) { return; } implementation().removeContent(renderedData, 0); emit beforeDeleteVisualizations({ renderedData }); auto toDelete = removeFromInternalLists({ dataObject }); updateGuiForRemovedData(); implementation().renderViewContentsChanged(); emit visualizationsChanged(); render(); toDelete.clear(); m_deletedData.clear(); }
WImage* MapImage::image() { if (wApp->environment().ajax()) { return DOWNCAST<WImage*>(implementation()); } else { return DOWNCAST<WAnchor*>(implementation())->image(); } }
bool Framebuffer::detach(const GLenum attachment) { FramebufferAttachment * attachmentObject = getAttachment(attachment); if (!attachmentObject) return false; if (attachmentObject->isTextureAttachment()) { AttachedTexture * textureAttachment = attachmentObject->asTextureAttachment(); if (textureAttachment->hasLayer()) { implementation().attachTextureLayer(this, attachment, nullptr, textureAttachment->level(), textureAttachment->layer()); } else { implementation().attachTexture(this, attachment, nullptr, textureAttachment->level()); } } else if (attachmentObject->isRenderBufferAttachment()) { implementation().attachRenderBuffer(this, attachment, nullptr); } m_attachments.erase(attachment); return true; }
void AbstractRenderView::onClearSelection() { implementation().clearSelection(); visualizationSelectionChangedEvent(implementation().selection()); emit visualizationSelectionChanged(this, implementation().selection()); }
void RenderView::updateImplementation(const QList<DataObject *> & contents) { implementation().deactivate(qvtkWidget()); assert(m_contents.empty()); m_contentCache.clear(); m_dataObjectToVisualization.clear(); m_implementationSwitch->findSuitableImplementation(contents); implementation().activate(qvtkWidget()); emit implementationChanged(); }
WSuggestionPopup::WSuggestionPopup(const Options& options, WObject *parent) : WPopupWidget(new WContainerWidget(), parent), model_(0), modelColumn_(0), filterLength_(0), filtering_(false), matcherJS_(generateMatcherJS(options)), replacerJS_(generateReplacerJS(options)), filterModel_(this), activated_(this), filter_(implementation(), "filter"), jactivated_(implementation(), "select") { init(); }
void RenderView::lookAtData(const VisualizationSelection & selection, int DEBUG_ONLY(subViewIndex)) { assert(subViewIndex == 0 || subViewIndex == -1); assert(containsUnique(m_contents, selection.visualization)); implementation().lookAtData(selection, 0u); }
WSuggestionPopup::WSuggestionPopup(const std::string& matcherJS, const std::string& replacerJS, WObject *parent) : WPopupWidget(new WContainerWidget(), parent), model_(0), modelColumn_(0), filterLength_(0), filtering_(false), defaultValue_(-1), matcherJS_(matcherJS), replacerJS_(replacerJS), filter_(implementation(), "filter"), jactivated_(implementation(), "select") { init(); }
/* * This function contains the main interpreter loop. Java * ByteCode instructions are executed one at a time. Before * calling this function the core register should contain * the correct value. */ execute() { // initialise register values printf("Interpreter started\n"); initCollector(); thread = getRef(core, CORE_RUNNING); loadRegisters(); // used to mimic a time slice int maxSize = 50; int count = 0; // execute the next instruction, indefinitely void (*implementation)(); int index; unsigned char bytecode; for (;;) { bytecode = code[pc]; dbgCodes[dbgIndex++] = bytecode; if (dbgIndex == 50) { dbgIndex = 0; } //printf("0x%X\n", bytecode); implementation = distributor[bytecode]; implementation(); count++; // check if another thread needs to be scheduled if (thread == NULL || count >= maxSize) { if (thread != NULL) { saveRegisters(); } scheduleNextThread(); //wakeSleepingThreads(); count = 0; } } }
void Framebuffer::blit(GLenum readBuffer, const std::array<GLint, 4> & srcRect, Framebuffer * destFbo, const std::vector<GLenum> & drawBuffers, const std::array<GLint, 4> & destRect, ClearBufferMask mask, GLenum filter) const { setReadBuffer(readBuffer); destFbo->setDrawBuffers(drawBuffers); implementation().blit(this, destFbo, srcRect[0], srcRect[1], srcRect[2], srcRect[3], destRect[0], destRect[1], destRect[2], destRect[3], mask, filter); }
void AbstractRenderView::setVisualizationSelection(const VisualizationSelection & selection) { if (selection == visualzationSelection()) { return; } implementation().setSelection(selection); // Trigger update according to the more generic AbstractDataView interface. // This doesn't contain information regarding the actual visualization. setSelection(DataSelection(selection)); visualizationSelectionChangedEvent(implementation().selection()); emit visualizationSelectionChanged(this, implementation().selection()); }
WSuggestionPopup::WSuggestionPopup(const Options& options, WObject *parent) : WPopupWidget(new WContainerWidget(), parent), model_(0), modelColumn_(0), filterLength_(0), filtering_(false), defaultValue_(-1), isDropDownIconUnfiltered_(false), matcherJS_(generateMatcherJS(options)), replacerJS_(generateReplacerJS(options)), filterModel_(this), activated_(this), filter_(implementation(), "filter"), jactivated_(implementation(), "select"), currentItem_(-1), editRole_(UserRole) { init(); }
optional<Utterance> Platform::respond(const String& stateName, const String& inQuestion) { auto rl = implementation().search(stateName, detail::Engine::queryForString(inQuestion)); if (rl.size()) { return rl[0]; } else { return optional<Utterance>(); } }
bool AbstractRenderView::eventFilter(QObject * watched, QEvent * event) { if (event->type() != QEvent::MouseButtonPress || watched != contentWidget()) { return AbstractDataView::eventFilter(watched, event); } auto mouseEvent = static_cast<QMouseEvent *>(event); setActiveSubView(implementation().subViewIndexAtPos(mouseEvent->pos())); return AbstractDataView::eventFilter(watched, event); }
void WMediaPlayer::setControlsWidget(WWidget *controlsWidget) { if (gui_ != this) delete gui_; gui_ = controlsWidget; WTemplate *impl = dynamic_cast<WTemplate *>(implementation()); if (gui_) { gui_->addStyleClass("jp-gui"); impl->bindWidget("gui", gui_); } else impl->bindString("gui", std::string()); }
nsresult nsWebDAVService::CreatePropfindDocument(nsIURI *resourceURI, nsIDOMDocument **requestDoc, nsIDOMElement **propfindElt) { nsresult rv; static NS_DEFINE_CID(kDOMDOMDOMDOMImplementationCID, NS_DOM_IMPLEMENTATION_CID); nsCOMPtr<nsIDOMDOMImplementation> implementation(do_CreateInstance(kDOMDOMDOMDOMImplementationCID, &rv)); NS_ENSURE_SUCCESS(rv, rv); nsCOMPtr<nsIPrivateDOMImplementation> privImpl(do_QueryInterface(implementation)); // XXXbz I doubt this is right, but I have no idea what this code is doing // or why it's creating documents without a useful principal... so I'm just // going to make the fact that those documents have no principal very // explicit, and if this causes issues then someone familiar with this code // should figure out what principals this _should_ be using. privImpl->Init(resourceURI, resourceURI, nsnull); nsCOMPtr<nsIDOMDocument> doc; rv = implementation->CreateDocument(mDAVNSString, EmptyString(), nsnull, getter_AddRefs(doc)); NS_ENSURE_SUCCESS(rv, rv); nsCOMPtr<nsIDocument> baseDoc = do_QueryInterface(doc); baseDoc->SetXMLDeclaration(NS_LITERAL_STRING("1.0").get(), EmptyString().get(), -1); baseDoc->SetDocumentURI(resourceURI); nsCOMPtr<nsIDOMElement> elt; rv = NS_WD_AppendElementWithNS(doc, doc, mDAVNSString, NS_LITERAL_STRING("propfind"), getter_AddRefs(elt)); elt->SetPrefix(NS_LITERAL_STRING("D")); NS_ENSURE_SUCCESS(rv, rv); *requestDoc = doc.get(); NS_ADDREF(*requestDoc); *propfindElt = elt.get(); NS_ADDREF(*propfindElt); return NS_OK; }
void WSuggestionPopup::init() { impl_ = dynamic_cast<WContainerWidget *>(implementation()); impl_->setList(true); impl_->setLoadLaterWhenInvisible(false); /* * We use display: none because logically, the popup is visible and * propagates signals */ setAttributeValue("style", "z-index: 10000; display: none; overflow: auto"); setModel(new WStringListModel(this)); filter_.connect(this, &WSuggestionPopup::doFilter); jactivated_.connect(this, &WSuggestionPopup::doActivate); }
void Recaptcha::update_impl() { if (!implementation()) { setImplementation(new WContainerWidget()); } get_impl()->clear(); WText* title = new WText("reCAPTCHA", get_impl()); title->addStyleClass("wc_recaptcha_title"); if (js()) { WContainerWidget* image = new WContainerWidget(get_impl()); image->setId("recaptcha_image"); response_field_ = input_ ? input_ : new WLineEdit(get_impl()); challenge_field_ = new WLineEdit(get_impl()); // not challenge_field_->hide() to get its .text() doJavaScript("$(" + challenge_field_->jsRef() + ").hide();"); response_field_->setId("recaptcha_response_field"); doJavaScript("Recaptcha.create('" + public_key_ + "', ''," "{theme: 'custom'});"); if (buttons_enabled_) { add_buttons(); } doJavaScript("clearTimeout($(" + jsRef() + ").data('timer'));"); doJavaScript("$(" + jsRef() + ").data('timer'," "setInterval(function() {" "$(" + challenge_field_->jsRef() + ")" ".val(Recaptcha.get_challenge());" "}, 200));"); } else { WTemplate* iframe = new WTemplate(get_impl()); iframe->setTemplateText("<iframe src='https://www.google.com/recaptcha/" "api/noscript?k=" + public_key_ + "' height='300' width='500' frameborder='0'>" "</iframe>", XHTMLUnsafeText); if (input_) { challenge_field_ = input_; } else { WTextArea* ta = new WTextArea(get_impl()); ta->setColumns(40); ta->setRows(3); challenge_field_ = ta; } response_field_ = new WLineEdit("manual_challenge", get_impl()); response_field_->hide(); } }
void RenderView::hideDataObjectsImpl(const QList<DataObject *> & dataObjects, int /*suViewIndex*/) { bool changed = false; for (auto dataObject : dataObjects) { auto rendered = m_dataObjectToVisualization.value(dataObject); if (!rendered) { continue; } // cached data is only accessible internally in the view, so let others know that it's gone for the moment emit beforeDeleteVisualizations({ rendered }); // move data to cache if it isn't already invisible auto contentsIt = findUnique(m_contents, rendered); if (contentsIt != m_contents.end()) { m_contentCache.push_back(std::move(*contentsIt)); m_contents.erase(contentsIt); rendered->setVisible(false); changed = true; } assert(!containsUnique(m_contents, (AbstractVisualizedData*)nullptr)); } if (!changed) { return; } resetFriendlyName(); updateGuiForRemovedData(); implementation().renderViewContentsChanged(); emit visualizationsChanged(); render(); }
void WTimePicker::configure() { WTemplate *container = dynamic_cast<WTemplate *>(implementation()); container->bindWidget("hour", sbhour_); container->bindWidget("minute", sbminute_); container->bindWidget("second", sbsecond_); if (formatMs()) container->bindWidget("millisecond", sbmillisecond_); else { container->takeWidget("millisecond"); container->bindEmpty("millisecond"); } if (formatAp()) { sbhour_->setRange(1, 12); container->bindWidget("ampm", cbAP_); } else { container->takeWidget("ampm"); container->bindEmpty("ampm"); sbhour_->setRange(0, 23); } }
void WDefaultLoadingIndicator::setMessage(const WString& text) { dynamic_cast<WText *>(implementation())->setText(text); }
int ACE_Proactor::handle_events (ACE_Time_Value &wait_time) { return implementation ()->handle_events (wait_time); }
void Texture::pageCommitment(const GLint level, const GLint xOffset, const GLint yOffset, const GLint zOffset, const GLsizei width, const GLsizei height, const GLsizei depth, const GLboolean commit) const { implementation().pageCommitment(this, level, xOffset, yOffset, zOffset, width, height, depth, commit); }
void Texture::generateMipmap() { implementation().generateMipMap(this); }
void Texture::texBufferRange(const GLenum internalFormat, Buffer * buffer, const GLintptr offset, const GLsizeiptr size) { implementation().texBufferRange(this, internalFormat, buffer, offset, size); }
void Texture::texBuffer(const GLenum internalFormat, Buffer * buffer) { implementation().texBuffer(this, internalFormat, buffer); }
void Texture::storage3D(const GLsizei levels, const GLenum internalFormat, const GLsizei width, const GLsizei height, const GLsizei depth) { implementation().storage3D(this, levels, internalFormat, width, height, depth); }
void Texture::image3DMultisample(const GLsizei samples, const GLenum internalFormat, const GLsizei width, const GLsizei height, const GLsizei depth, const GLboolean fixedSamplesLocations) { implementation().image3DMultisample(this, samples, internalFormat, width, height, depth, fixedSamplesLocations); }
void Texture::subImage3D(const GLint level, const GLint xOffset, const GLint yOffset, const GLint zOffset, const GLsizei width, const GLsizei height, const GLsizei depth, const GLenum format, const GLenum type, const GLvoid * data) { implementation().subImage3D(this, level, xOffset, yOffset, zOffset, width, height, depth, format, type, data); }