当前位置: 首页>>代码示例>>C++>>正文


C++ outline函数代码示例

本文整理汇总了C++中outline函数的典型用法代码示例。如果您正苦于以下问题:C++ outline函数的具体用法?C++ outline怎么用?C++ outline使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了outline函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: nxt_to_show

/*
 * Show the selected color of the appropiate line or page 
 */
void
nxt_to_show(int toscroll)
{
	int obj;
	
	open_vwork();
	
	/* if current color is not shown, page accordingly to show it */ 
	if (curcol < headcol) {							/* page backwards */
		if ((headcol -= toscroll) < 0)	/* update color to start with */
			headcol = 0;	
		draw_boxes();					/* redraw color boxes */
	} else if (curcol >= headcol + MAX_COL_SHOWN) {	/* page forward */
		if ((headcol += toscroll) > numcol - MAX_COL_SHOWN)
			headcol = numcol - MAX_COL_SHOWN;
		draw_boxes();					/* redraw color boxes */
	}
	
	/* deselect previous color and select current one */
	obj = curcol - headcol + headbox;
	if (obj != curbox) {
		outline(curbox, DEHILITE);
		outline(obj, HILITE);
		curbox = obj;			/* update current box selected */
	}
	
	/* update color # and RGB sliders */		
	curslid = COLSLID;
	slidtext();				/* update color # */
	if (bpg)				/* if there is color */
		update_rgb(1);		/* update and draw RGB gun values */
		
	close_vwork();
}
开发者ID:daemqn,项目名称:Atari_ST_Sources,代码行数:37,代码来源:COLOR.C

示例2: print_var

void print_var(struct var_struct * p)
{
    int i,j;
    char buf[1000];
    snprintf(buf, 1000, "%s =\n", p->name);
    outline(buf);
    if(!p->p) {
        outline("null\n");
        return;
    }
    else if(is_single_var(p)) {
        if(fabs(**(p->p))>1e7||fabs(**(p->p))<1e-3)
            snprintf(buf, 1000, "%le\n", **(p->p));
        else
            snprintf(buf, 1000, "%lf\n", **(p->p));
        outline(buf);
        return;
    }
    for(i=0;i<p->height;i++){
        if(i==0) outline("[");
        else outline(" ");
        for(j=0;j<p->width;j++) {
            if(fabs(p->p[i][j])>1e7||fabs(**(p->p))<1e-3)
                snprintf(buf, 1000, "%le", p->p[i][j]);
            else
                snprintf(buf, 1000, "%lf", p->p[i][j]);
            outline(buf);
            if(j<p->width-1) outline(" ");
        }
        if(i==p->height-1) outline("]");
        outline("\n");
    }
}
开发者ID:marvelliu,项目名称:lilacsrc,代码行数:33,代码来源:calc.c

示例3: outprodgroup

static void outprodgroup( PSYMBOL s ) { /* put out all rules with s on LHS */
	PPRODUCTION p;
	PELEMENT e;
	PSYMBOL ss;

	outline();
	outsymbol( s );
	outchar( ' ' );
	barcol = getoutcol() + 1; /* remember indent for next rule */
	outstring( RULESYM );
        contcol = getoutcol() + 1; /* remember indent for continuation */

	/* output first production on same line */
	p = s->data;
	outprod( p );

	while (p->next != NULL) { /* output successive productions */
		p = p->next;
		
		outline();
		outspaces( barcol );
		outstring( "| " );

		outprod( p );
	}

	if (s->starter != NULL) { /* output start set */
		outline();
		outchar( COMMENT );
		outstring( " start set:  " );
        	contcol = getoutcol() + 1; /* remember indent */

		for (e = s->starter; e != NULL; e = e->next) {
			ss = e->data;
			outspacesym( ss, contcol, COMMENT );
			outsymbol( ss );
		}
	}
	if (s->follows != NULL) { /* output follow set */
		outline();
		outchar( COMMENT );
		outstring( " follow set: " );
        	contcol = getoutcol() + 1; /* remember indent */

		for (e = s->follows; e != NULL; e = e->next) {
			ss = e->data;
			outspacesym( ss, contcol, COMMENT );
			outsymbol( ss );
		}
	}
	if ((s->follows != NULL) || (s->starter != NULL)) {
		/* output blank line to separate from the next rule */
		outline();
	}
}
开发者ID:Twoody,项目名称:LexicalAnalyzer,代码行数:55,代码来源:writeg.c

示例4: xShadowOffset

void BoxStyle::unoptimizedPaint(QPainter* painter, int xOffset, int yOffset, int contentBoxWidth,
				int contentBoxHeight) const
{
	qreal x = xOffset;
	qreal y = yOffset;

	int outlineWidth = outline_.style()!=Qt::NoPen ? outline_.width() : 0;
	// Move the figure when using antialiasing. The outline will start at a pixel boundary. This makes it sharper.
	if ( painter->testRenderHint(QPainter::Antialiasing) || painter->testRenderHint(QPainter::HighQualityAntialiasing) )
		if ( outline().style() != Qt::NoPen)
		{
			x = xOffset + outlineWidth/2.0;
			y = yOffset + outlineWidth/2.0;
		}

	// Draw shadow
	if ( shadow() != Qt::NoBrush )
	{
		painter->setPen(Qt::NoPen);
		painter->setBrush(shadow());
		painter->drawPath(getRectanglePath(xOffset + xShadowOffset(), yOffset + yShadowOffset(),
				contentBoxWidth, contentBoxHeight));
	}

	// Draw box.
	painter->setPen(outline());

	// Set the brush and fix the gradient if needed.
	if ( background().style() == Qt::LinearGradientPattern
			&& background().gradient()->coordinateMode() == QGradient::LogicalMode )
	{
		QLinearGradient g = *(static_cast<const QLinearGradient*> (background().gradient()));
		g.setStart(x + g.start().x(), y + g.start().y());
		g.setFinalStop(x + g.finalStop().x(), y + g.finalStop().y());
		painter->setBrush(g);

	}
	else if ( background().style()  == Qt::RadialGradientPattern
			&& background().gradient()->coordinateMode() == QGradient::LogicalMode )
	{
		QRadialGradient g = *(static_cast<const QRadialGradient*> (background().gradient()));
		g.setCenter(x + g.center().x(), y + g.center().y());
		g.setFocalPoint(x + g.focalPoint().x(), y + g.focalPoint().y());
		painter->setBrush(g);
	}
	else
	{
		painter->setBrush(background());
	}

	painter->drawPath(getRectanglePath(x, y, contentBoxWidth - outlineWidth, contentBoxHeight - outlineWidth));
}
开发者ID:JurajKubelka,项目名称:Envision,代码行数:52,代码来源:BoxStyle.cpp

示例5: nullBoundBox

QSizeF ArtisticTextShape::size() const
{
    if( m_ranges.isEmpty() )
        return nullBoundBox().size();
    else
        return outline().boundingRect().size();
}
开发者ID:abhishekmurthy,项目名称:Calligra,代码行数:7,代码来源:ArtisticTextShape.cpp

示例6: box_desc

Body Collision::create_outline_body(PhysicsWorld &phys_world)
{
	PhysicsContext pc = phys_world.get_pc();

	BodyDescription box_desc(phys_world);
	box_desc.set_type(body_dynamic);
	Body box(pc, box_desc);

	//Setup box fixture description.
	//
	//Outlines shouldn't be too complex. Keep it Under 100 points.
	//If it has more, think about splitting it into couple smaller groups.
	//Then create separate fixtures for the same body.
	CollisionOutline outline("test_outline.out");

	ChainShape outline_shape(phys_world);
	outline_shape.create_loop(outline);

	FixtureDescription fixture_desc2(phys_world);
	fixture_desc2.set_shape(outline_shape);
	fixture_desc2.set_restitution(0.6f);
	fixture_desc2.set_friction(0.001f);
	fixture_desc2.set_density(50.0f);

	Fixture box_fixture(pc, box,fixture_desc2);
	return box;
}
开发者ID:wbyang1985,项目名称:ClanLib,代码行数:27,代码来源:collision.cpp

示例7: clear

void EnhancedPathShape::updatePath(const QSizeF &)
{
    clear();

    foreach (EnhancedPathCommand *cmd, m_commands)
        cmd->execute();

    m_viewBound = outline().boundingRect();

    m_mirrorMatrix.reset();
    m_mirrorMatrix.translate(m_viewBound.center().x(), m_viewBound.center().y());
    m_mirrorMatrix.scale(m_mirrorHorizontally ? -1 : 1, m_mirrorVertically ? -1 : 1);
    m_mirrorMatrix.translate(-m_viewBound.center().x(), -m_viewBound.center().y());

    QTransform matrix;
    matrix.translate(m_viewBoxOffset.x(), m_viewBoxOffset.y());
    matrix = m_mirrorMatrix * m_viewMatrix * matrix;

    KoSubpathList::const_iterator pathIt(m_subpaths.constBegin());
    for (; pathIt != m_subpaths.constEnd(); ++pathIt) {
        KoSubpath::const_iterator it((*pathIt)->constBegin());
        for (; it != (*pathIt)->constEnd(); ++it) {
            (*it)->map(matrix);
        }
    }
    const int handleCount = m_enhancedHandles.count();
    QList<QPointF> handles;
    for (int i = 0; i < handleCount; ++i)
        handles.append(matrix.map(m_enhancedHandles[i]->position()));
    setHandles(handles);

    normalize();
}
开发者ID:KDE,项目名称:koffice,代码行数:33,代码来源:EnhancedPathShape.cpp

示例8: applyConversion

void ArtisticTextShape::paint(QPainter &painter, const KViewConverter &converter)
{
    applyConversion( painter, converter );
    painter.setFont( m_font );
    if ( background() )
        background()->paint( painter, outline() );
}
开发者ID:KDE,项目名称:koffice,代码行数:7,代码来源:ArtisticTextShape.cpp

示例9: draw_player_inventory

static void draw_player_inventory(GameState* gs, Inventory& inv,
		const BBox& bbox, int min_slot, int max_slot, int slot_selected = -1) {
	int mx = gs->mouse_x(), my = gs->mouse_y();
	int slot = min_slot;
	for (int y = bbox.y1; y < bbox.y2; y += TILE_SIZE) {
		for (int x = bbox.x1; x < bbox.x2; x += TILE_SIZE) {
			if (slot >= max_slot)
				break;

			ItemSlot& itemslot = inv.get(slot);

			BBox slotbox(x, y, x + TILE_SIZE, y + TILE_SIZE);
			Colour outline(COL_UNFILLED_OUTLINE);
			if (itemslot.amount > 0 && slot != slot_selected) {
				outline = COL_FILLED_OUTLINE;
				if (slotbox.contains(mx, my)) {
					outline = COL_PALE_YELLOW;
					draw_console_item_description(gs, itemslot.item);
				}
			}

			if (slot != slot_selected)
				draw_player_inventory_slot(gs, itemslot, x, y);
			//draw rectangle over item edges
			gl_draw_rectangle_outline(slotbox, outline);

			slot++;
		}
	}

	if (slot_selected != -1) {
		draw_player_inventory_slot(gs, inv.get(slot_selected),
				gs->mouse_x() - TILE_SIZE / 2, gs->mouse_y() - TILE_SIZE / 2);
	}
}
开发者ID:gigimoi,项目名称:lanarts,代码行数:35,代码来源:InventoryContent.cpp

示例10: QColor

void PgxEditor::highlightCurrentLine()
{
    QList<QTextEdit::ExtraSelection> extraSelections;

    /*QTextEdit::ExtraSelection selection;
    QColor lineColor = QColor(Qt::yellow).lighter(160);
    selection.format.setBackground(lineColor);
    selection.format.setProperty(QTextFormat::FullWidthSelection, true);
    selection.cursor = textCursor();
    selection.cursor.clearSelection();
    extraSelections.append(selection);*/

    QTextEdit::ExtraSelection border;
    QPen outline(Qt::darkGreen, 2, Qt::SolidLine);
    //outline.setJoinStyle(Qt::RoundJoin);
    //outline.setCapStyle(Qt::RoundCap);
    border.format.setProperty(QTextFormat::OutlinePen, outline);
    border.cursor = textCursor();
    extraSelections.append(border);

    QTextEdit::ExtraSelection back_brush;
    QBrush brush(Qt::yellow);
    back_brush.format.setProperty(QTextFormat::BackgroundBrush, brush);
    back_brush.cursor = textCursor();
    extraSelections.append(back_brush);

    setExtraSelections(extraSelections);
}
开发者ID:ssundar81,项目名称:pgXplorer,代码行数:28,代码来源:pgxeditor.cpp

示例11: target

std::vector<CollisionOutline> Sprite_Impl::create_collision_outlines(GraphicContext &gc, int alpha_limit, OutlineAccuracy accuracy) const
{
	std::vector<CollisionOutline> outlines;
	// Fetch frames

	outlines.reserve(frames.size());

	Texture2D last_texture;
	PixelBuffer texture_pixelbuffer;

	for (unsigned int cnt = 0; cnt < frames.size(); cnt++)
	{
		const SpriteFrame &description_frame = frames[cnt];

		if (last_texture != description_frame.texture)
		{
				last_texture = description_frame.texture;
				texture_pixelbuffer = description_frame.texture.get_pixeldata(gc, tf_rgba8).to_cpu(gc);
		}

		PixelBuffer target(description_frame.position.get_width(), description_frame.position.get_height(), tf_rgba8);
		target.set_subimage(texture_pixelbuffer, Point(0, 0), description_frame.position);

		CollisionOutline outline(target, alpha_limit, accuracy);
		outlines.push_back(outline);

	}
	return outlines;

}
开发者ID:lonelylife,项目名称:ClanLib,代码行数:30,代码来源:sprite_impl.cpp

示例12: outrumor

void
outrumor(void)
{
	int             rn, i;
	FILE           *rumf;
	if (n_rumors <= n_used_rumors ||
	    (rumf = fopen(RUMORFILE, "r")) == (FILE *) 0)
		return;
	if (n_used_rumors < 0)
		init_rumors(rumf);
	if (!n_rumors)
		goto none;
	rn = rn2(n_rumors - n_used_rumors);
	i = 0;
	while (rn || used(i)) {
		(void) skipline(rumf);
		if (!used(i))
			rn--;
		i++;
	}
	usedbits[i / CHARSZ] |= (1 << (i % CHARSZ));
	n_used_rumors++;
	outline(rumf);
none:
	(void) fclose(rumf);
}
开发者ID:ajinkya93,项目名称:netbsd-src,代码行数:26,代码来源:hack.rumors.c

示例13: createAndAppendFontSubMenu

static void createAndAppendFontSubMenu(const HitTestResult& result, ContextMenuItem& fontMenuItem)
{
    ContextMenu fontMenu(result);

#if PLATFORM(MAC)
    ContextMenuItem showFonts(ActionType, ContextMenuItemTagShowFonts, contextMenuItemTagShowFonts());
#endif
    ContextMenuItem bold(CheckableActionType, ContextMenuItemTagBold, contextMenuItemTagBold());
    ContextMenuItem italic(CheckableActionType, ContextMenuItemTagItalic, contextMenuItemTagItalic());
    ContextMenuItem underline(CheckableActionType, ContextMenuItemTagUnderline, contextMenuItemTagUnderline());
    ContextMenuItem outline(ActionType, ContextMenuItemTagOutline, contextMenuItemTagOutline());
#if PLATFORM(MAC)
    ContextMenuItem styles(ActionType, ContextMenuItemTagStyles, contextMenuItemTagStyles());
    ContextMenuItem showColors(ActionType, ContextMenuItemTagShowColors, contextMenuItemTagShowColors());
#endif

#if PLATFORM(MAC)
    fontMenu.appendItem(showFonts);
#endif
    fontMenu.appendItem(bold);
    fontMenu.appendItem(italic);
    fontMenu.appendItem(underline);
    fontMenu.appendItem(outline);
#if PLATFORM(MAC)
    fontMenu.appendItem(styles);
    fontMenu.appendItem(*separatorItem());
    fontMenu.appendItem(showColors);
#endif

    fontMenuItem.setSubMenu(&fontMenu);
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:31,代码来源:BCContextMenuWK.cpp

示例14: slideRowanMultichoice

void slideRowanMultichoice(u8 index) {
	//task *tasks = (task *) 0x3005090;
	u32 **ptr = (u32**) 0x0203B108;
	u16 *		displace = (u16*) 0x02021BC8;
	u16 arg;
	u16 id;
	u8 current;

	/* Wait message */
	if (check_a_pressed(0)) return;

	arg = tasks[index].args[6];

	if (arg > 0) {
		/* Slide sprite right */
		u16 (*mod)(u8,u32,u8) = (u16 (*)(void)) 0x08001B90 + 1;
		mod(2, 0x200, 2);
		tasks[index].args[6] = arg - 1;
		return;
	}

	/* Show multichoice */

	// Load rbox
	u16 (*func)(u32) = (u16 (*)(void)) 0x08003CE4 + 1;
	//id = func(&info_multichoice);

	// New
	tasks[index].args[0xD] = id;
	u16 (*func2)(u16) = (u16 (*)(void)) 0x8003FA0 + 1;
	func2(id);

	// Draw its border
	int (*outline)(u16, u8, u16, u8) = (int (*)(void)) 0x0810F2E8 + 1;
	outline(id, 1, 0x214, 0xE);

	// Clear the contents
	int (*clear)(u16, u8) = (int (*)(void)) 0x0800445C + 1;
	clear(id, 0x11);

	// Draw strings
	// id, font, x, y, bg_color, fg_color, str
	int (*print)(u16, u8, u8, u8, u32, u32, u32*) = (int (*)(void)) 0x0812E51C + 1;

	print(id, 2, 8, 1, 1, 0, caOptionInfoControls);
	print(id, 2, 8, 0x11, 1, 0, caOptionInfoAdventure);
	print(id, 2, 8, 0x21, 1, 0, caOptionInfoNone);

	// Field
	u8 (*field)(u8, u8) = (u8 (*)(void)) 0x080F79D8 + 1;
	current = field(2, 1);

	// Allow moving the selecty thing
	int (*huh)(u8, u8, u8, u8, u8, u8, u32) = (int (*)(void)) 0x0810F7D8 + 1;
	huh(id, 2, 0, 1, current + 2, 3, 0);

	rboxid_to_vram(id, 3);
	
	tasks[index].function = (u32) handleRowanMultichoice;
}
开发者ID:Touched,项目名称:OakTutorial,代码行数:60,代码来源:main.c

示例15: outline

void
ColumnDragState::DrawOutline(float pos)
{
	BRect outline(fTitle->Bounds());
	outline.OffsetBy(pos, 0);
	fTitleView->Draw(fTitleView->Bounds(), true, false, fTitle, _DrawOutline, outline);
}
开发者ID:mmadia,项目名称:Haiku-services-branch,代码行数:7,代码来源:TitleView.cpp


注:本文中的outline函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。