static int report_textview_begin(TextViewContext *tvc)
{
	// SpaceConsole *sc = (SpaceConsole *)tvc->arg1;
	ReportList *reports = (ReportList *)tvc->arg2;

	tvc->lheight = 14 * UI_DPI_FAC; //sc->lheight;
	tvc->sel_start = 0;
	tvc->sel_end = 0;

	/* iterator */
	tvc->iter = reports->list.last;

	UI_ThemeClearColor(TH_BACK);
	glClear(GL_COLOR_BUFFER_BIT);

#ifdef USE_INFO_NEWLINE
	tvc->iter_tmp = 0;
	if (tvc->iter && report_textview_skip__internal(tvc)) {
		/* init the newline iterator */
		tvc->iter_char = 0;
		report_textview_init__internal(tvc);

		return true;
	}
	else {
		return false;
	}
#else
	return (tvc->iter != NULL);
#endif
}
Exemple #2
0
/* only draws blocks with panels */
void uiEndPanels(const bContext *C, ARegion *ar)
{
	ScrArea *sa= CTX_wm_area(C);
	uiBlock *block;
	Panel *panot, *panew, *patest, *pa, *firstpa;
	
	/* offset contents */
	for(block= ar->uiblocks.first; block; block= block->next)
		if(block->active && block->panel)
			ui_offset_panel_block(block);

	/* consistency; are panels not made, whilst they have tabs */
	for(panot= ar->panels.first; panot; panot= panot->next) {
		if((panot->runtime_flag & PNL_ACTIVE)==0) { // not made

			for(panew= ar->panels.first; panew; panew= panew->next) {
				if((panew->runtime_flag & PNL_ACTIVE)) {
					if(panew->paneltab==panot) { // panew is tab in notmade pa
						break;
					}
				}
			}
			/* now panew can become the new parent, check all other tabs */
			if(panew) {
				for(patest= ar->panels.first; patest; patest= patest->next) {
					if(patest->paneltab == panot) {
						patest->paneltab= panew;
					}
				}
				panot->paneltab= panew;
				panew->paneltab= NULL;
				ED_region_tag_redraw(ar); // the buttons panew were not made
			}
		}	
	}

	/* re-align, possibly with animation */
	if(panels_re_align(sa, ar, &pa)) {
		if(pa)
			panel_activate_state(C, pa, PANEL_STATE_ANIMATION);
		else
			uiAlignPanelStep(sa, ar, 1.0, 0);
	}

	/* tag first panel */
	firstpa= NULL;
	for(block= ar->uiblocks.first; block; block=block->next)
		if(block->active && block->panel)
			if(!firstpa || block->panel->sortorder < firstpa->sortorder)
				firstpa= block->panel;
	
	if(firstpa)
		firstpa->runtime_flag |= PNL_FIRST;

	UI_ThemeClearColor(TH_BACK);
	
	/* draw panels, selected on top */
	for(block= ar->uiblocks.first; block; block=block->next) {
		if(block->active && block->panel && !(block->panel->flag & PNL_SELECT)) {
			uiDrawBlock(C, block);
		}
	}

	for(block= ar->uiblocks.first; block; block=block->next) {
		if(block->active && block->panel && (block->panel->flag & PNL_SELECT)) {
			uiDrawBlock(C, block);
		}
	}
}