void MWMDIManagerImpl::addMDIWindow(MWMDIWindow* w) { bool contains = getWindowById(w->getId())!=NULL; if (contains) { assert(0); //must never happen return; } w->setParent(mdiArea); QMdiSubWindow* qw = mdiArea->addSubWindow(w); qw->setWindowTitle(w->windowTitle()); QIcon icon = w->windowIcon(); if (icon.isNull()) { icon = QIcon(":/ugene/images/ugene_16.png"); } qw->setWindowIcon(icon); //qw->setAttribute(Qt::WA_NativeWindow); MDIItem* i = new MDIItem(w, qw); items.append(i); qw->installEventFilter(this); uiLog.trace(QString("Adding window: '%1'").arg(w->windowTitle())); updateState(); emit si_windowAdded(w); if (items.count() == 1 && defaultIsMaximized) { qw->showMaximized(); } else { qw->show(); } qw->raise(); }
int sys_updateWindow() { int window_id; int detail; color16* context; WindowLink pWindow; if (argint(0, &window_id) < 0) return -1; pWindow = getWindowById(window_id); cprintf("updateWindow called: %d\n", pWindow); if (pWindow == 0) return -1; int size = ((pWindow->window_position).right_x - (pWindow->window_position).left_x) * ((pWindow->window_position).right_y - (pWindow->window_position).left_y); //cprintf("window size: %d\n", size); if (size < 0) return -1; if (argptr(1, (void*)&context, sizeof(color16) * size) < 0) return -1; if (argint(2, &detail) < 0) return -1; drawWindow(pWindow, context, detail); return 0; }
int sys_updatePartialWindow() { int window_id; int x1, y1, x2, y2; color16* context; WindowLink pWindow; if (argint(0, &window_id) < 0) return -1; pWindow = getWindowById(window_id); cprintf("updatePartialWindow called: %d\n", pWindow); if (pWindow == 0) return -1; int size = ((pWindow->window_position).right_x - (pWindow->window_position).left_x) * ((pWindow->window_position).right_y - (pWindow->window_position).left_y); //cprintf("window size: %d\n", size); if (size < 0) return -1; if (argptr(1, (void*)&context, sizeof(color16) * size) < 0) return -1; if (argint(2, &x1) < 0 || argint(3, &y1) < 0 || argint(4, &x2) < 0 || argint(5, &y2) < 0) return -1; drawArea(pWindow, context, x1, y1, x2, y2); return 0; }