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


C++ printing函数代码示例

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


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

示例1: width

void RenderView::layout()
{
    if (printing())
        m_minPrefWidth = m_maxPrefWidth = width();

    // Use calcWidth/Height to get the new width/height, since this will take the full page zoom factor into account.
    bool relayoutChildren = !printing() && (!m_frameView || width() != viewWidth() || height() != viewHeight());
    if (relayoutChildren) {
        setChildNeedsLayout(true, false);
        for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
            if (child->style()->height().isPercent() || child->style()->minHeight().isPercent() || child->style()->maxHeight().isPercent())
                child->setChildNeedsLayout(true, false);
        }
    }

    ASSERT(!m_layoutState);
    LayoutState state;
    // FIXME: May be better to push a clip and avoid issuing offscreen repaints.
    state.m_clipped = false;
    m_layoutState = &state;

    if (needsLayout())
        RenderBlock::layout();

    // Reset overflow and then replace it with docWidth and docHeight.
    m_overflow.clear();
    addLayoutOverflow(IntRect(0, 0, docWidth(), docHeight()));


    ASSERT(layoutDelta() == IntSize());
    ASSERT(m_layoutStateDisableCount == 0);
    ASSERT(m_layoutState == &state);
    m_layoutState = 0;
    setNeedsLayout(false);
}
开发者ID:ShouqingZhang,项目名称:webkitdriver,代码行数:35,代码来源:RenderView.cpp

示例2: printing

static inline void printing(int total_size, int node) {
    int permission = 0, llimit, ulimit, tab;

    if (node == 0) {
        permission = 1;
    } else if (mod2(node) == 0) {
        permission = (tree[div2(node - 1)] == 1) ? 1 : 0;
    } else {
        permission = (tree[div2(node)] == 1) ? 1 : 0;
    }

    if (permission) {
        llimit = ulimit = tab = 0;

        while (!(llimit <= node && node <= ulimit)) {
            tab++;
            putchar('\t');
            llimit = ulimit + 1;
            ulimit = 2 * ulimit + 2;
        }

        printf(" %d ", total_size / power_2(tab));

        if (1 < tree[node]) {
            printf("---> Allocated %d\n", tree[node]);
        } else if (tree[node] == 1) {
            printf("---> Divided\n");
        } else {
            printf("---> Free\n");
        }

        printing(total_size, 2 * node + 1);
        printing(total_size, 2 * node + 2);
    }
}
开发者ID:mopp,项目名称:CodeGarage,代码行数:35,代码来源:buddy.c

示例3: printing

void printing(int totsize,int node)
 {
int permission=0,llimit,ulimit,tab;

if(node==0)
	permission=1;
else 

if(node%2==0)
	permission=tree[(node-1)/2]==1?1:0;
else
	permission=tree[node/2]==1?1:0;

if(permission)
	{
llimit=ulimit=tab=0;
	while(1)
	{
	if(node>=llimit && node<=ulimit)
		{
		#ifdef DEBUG 
		printf("DEBUG1 value of node: %d \n",node);
		#endif 
		break;
		}
		else
		{
		tab++;
		printf(" ");
		llimit=ulimit+1;
		ulimit=2*ulimit+2;
		}
	}//while 

// a node can have 3 status : divided (=1), free (=0) and allocated (>1) frequested size

printf("\n Current Buddy Block: %d",totsize/power(2,tab)); 
 
	if(tree[node]>1)
		printf("--->allocated :%d",tree[node]);
	else 
		if(tree[node]==1)
		printf("--->divided"); 
	else printf("-->Free");
		printing(totsize,2*node+1);
		printing(totsize,2*node+2);
	}//permission
}
开发者ID:Bhaskarjyoti,项目名称:MtechAOS,代码行数:48,代码来源:buddy1312.c

示例4: viewWidth

int RenderView::viewWidth() const
{
    int width = 0;
    if (!printing() && m_frameView)
        width = m_frameView->visibleWidth();
    return width;
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:7,代码来源:RenderView.cpp

示例5: calcWidth

void RenderView::calcWidth()
{
    if (!printing() && m_frameView)
        setWidth(viewWidth());
    m_marginLeft = 0;
    m_marginRight = 0;
}
开发者ID:ShouqingZhang,项目名称:webkitdriver,代码行数:7,代码来源:RenderView.cpp

示例6: viewHeight

int RenderView::viewHeight() const
{
    int height = 0;
    if (!printing() && m_frameView)
        height = m_frameView->visibleHeight();
    return height;
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:7,代码来源:RenderView.cpp

示例7: repaintViewRectangle

void RenderView::repaintViewRectangle(const IntRect& ur, bool immediate)
{
    if (printing() || ur.width() == 0 || ur.height() == 0)
        return;

    if (!m_frameView)
        return;

    // We always just invalidate the root view, since we could be an iframe that is clipped out
    // or even invisible.
    Element* elt = document()->ownerElement();
    if (!elt)
        m_frameView->repaintContentRectangle(ur, immediate);
    else if (RenderObject* obj = elt->renderer()) {
        IntRect vr = viewRect();
        IntRect r = intersection(ur, vr);
        
        // Subtract out the contentsX and contentsY offsets to get our coords within the viewing
        // rectangle.
        r.move(-vr.x(), -vr.y());
        
        // FIXME: Hardcoded offsets here are not good.
        r.move(obj->borderLeft() + obj->paddingLeft(),
               obj->borderTop() + obj->paddingTop());
        obj->repaintRectangle(r, immediate);
    }
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:27,代码来源:RenderView.cpp

示例8: main

int main()
{
    static int i=1;
    printf("Hello world!\n");
    int ax;
    int x=4.0/2;
    i=14;
    printf("The value of i should not change : %d\n",*&i);
    printf("See conversion : %d\n",x);
    printf("But its not implemented here : %d\n",(4.0/2));
    printf("To your surprise : %f\n",(4.0/2));
    printf("But its not implemented here : %d\n",(4.0+2));
    int y =-4.2/2;
    printf("The negative integer gives : %d\n",y);
  do
    {
        printf("Look : %d\n",i+=i);
    }
    while(i<=2);
    //looping();
    //switching();
    printing();
    return 0;

}
开发者ID:namannigam,项目名称:zealous-codetroops,代码行数:25,代码来源:BasicsPart1.c

示例9: viewRect

IntRect RenderView::viewRect() const
{
    if (printing())
        return IntRect(0, 0, m_width, m_height);
    if (m_frameView)
        return enclosingIntRect(m_frameView->visibleContentRect());
    return IntRect();
}
开发者ID:acss,项目名称:owb-mirror,代码行数:8,代码来源:RenderView.cpp

示例10: viewRect

LayoutRect RenderView::viewRect() const
{
    if (printing())
        return LayoutRect(LayoutPoint(), size());
    if (m_frameView)
        return m_frameView->visibleContentRect();
    return LayoutRect();
}
开发者ID:xiaolu31,项目名称:webkit-node,代码行数:8,代码来源:RenderView.cpp

示例11: sbd_transfer

/*
 * Handle an I/O request.
 */
static void sbd_transfer(struct sbd_device *dev, sector_t sector,
		unsigned long nsect, char *buffer, int write) {
	unsigned long offset = sector * logical_block_size;
	unsigned long nbytes = nsect * logical_block_size;

	int k;
  printk("Before decryption "); //added
  printk("\n");
  printing(buffer,nbytes); //added
  printk("\n");
  key_size = strlen(key); //added
	if(key_size == 0){
		printk(KERN_INFO "no key set\n");
	}else{
		crypto_cipher_clear_flags(tfm, ~0);
		crypto_cipher_setkey(tfm, crypto_key, key_size);
	}

	if ((offset + nbytes) > dev->size) {
		printk (KERN_NOTICE "sbd: Beyond-end write (%ld %ld)\n", offset, nbytes);
		return;
	}
	if (write){
    printing(buffer, nbytes);
    printk("\n");
		if(key_size != 0){
			for (k = 0; k < nbytes; k+= crypto_cipher_blocksize(tfm)) {
				crypto_cipher_encrypt_one(tfm, dev->data+offset+k, buffer+k);
			}
		}else{
			memcpy(dev->data + offset, buffer, nbytes);
		}
	}else{
		if(key_size != 0){
			for (k = 0; k < nbytes; k+= crypto_cipher_blocksize(tfm)) {
				crypto_cipher_decrypt_one(tfm, buffer+k, dev->data+offset+k);
			}
		}else{
			memcpy(buffer, dev->data + offset, nbytes);
		}
	}
  printk("Decrypted ");
  printk("\n");
  printing(buffer,nbytes);
  printk("\n");
}
开发者ID:anisimon,项目名称:cs444-008,代码行数:49,代码来源:cs444_project3_008.c

示例12: viewWidth

void RenderView::layout()
{
    layoutCounter.startCounting();
    if (printing())
        m_minPrefWidth = m_maxPrefWidth = m_width;

    // Use calcWidth/Height to get the new width/height, since this will take the full page zoom factor into account.
    bool relayoutChildren = !printing() && (!m_frameView || m_width != viewWidth() || m_height != viewHeight());
    if (relayoutChildren) {
        setChildNeedsLayout(true, false);
        for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
            if (child->style()->height().isPercent() || child->style()->minHeight().isPercent() || child->style()->maxHeight().isPercent())
                child->setChildNeedsLayout(true, false);
        }
    }

    ASSERT(!m_layoutState);
    LayoutState state;
    IntRect viewRectangle = viewRect();
    // An empty rect is not valid viewRect.
    state.m_clipped = !viewRectangle.isEmpty();

    if (state.m_clipped) {
        state.m_clipRect = IntRect(IntPoint(0, 0), viewRectangle.size());
        state.m_offset = IntSize(viewRectangle.x(), viewRectangle.y());
    }
    m_layoutState = &state;

    if (needsLayout())
        RenderBlock::layout();

    // Ensure that docWidth() >= width() and docHeight() >= height().
    setOverflowWidth(m_width);
    setOverflowHeight(m_height);

    setOverflowWidth(docWidth());
    setOverflowHeight(docHeight());

    ASSERT(m_layoutStateDisableCount == 0);
    ASSERT(m_layoutState == &state);
    m_layoutState = 0;
    setNeedsLayout(false);
    layoutCounter.stopCounting();
}
开发者ID:acss,项目名称:owb-mirror,代码行数:44,代码来源:RenderView.cpp

示例13: setPageLogicalHeight

void RenderView::layout()
{
    if (!document()->paginated())
        setPageLogicalHeight(0);

    if (printing())
        m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = logicalWidth();

    // Use calcWidth/Height to get the new width/height, since this will take the full page zoom factor into account.
    bool relayoutChildren = !printing() && (!m_frameView || width() != viewWidth() || height() != viewHeight());
    if (relayoutChildren) {
        setChildNeedsLayout(true, MarkOnlyThis);
        for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
            if ((child->isBox() && toRenderBox(child)->hasRelativeLogicalHeight())
                    || child->style()->logicalHeight().isPercent()
                    || child->style()->logicalMinHeight().isPercent()
                    || child->style()->logicalMaxHeight().isPercent())
                child->setChildNeedsLayout(true, MarkOnlyThis);
        }
    }

    ASSERT(!m_layoutState);
    LayoutState state;
    // FIXME: May be better to push a clip and avoid issuing offscreen repaints.
    state.m_clipped = false;
    state.m_pageLogicalHeight = m_pageLogicalHeight;
    state.m_pageLogicalHeightChanged = m_pageLogicalHeightChanged;
    state.m_isPaginated = state.m_pageLogicalHeight;
    m_pageLogicalHeightChanged = false;
    m_layoutState = &state;

    if (needsLayout()) {
        RenderBlock::layout();
        if (hasRenderNamedFlowThreads())
            layoutRenderNamedFlowThreads();
    }

    ASSERT(layoutDelta() == LayoutSize());
    ASSERT(m_layoutStateDisableCount == 0);
    ASSERT(m_layoutState == &state);
    m_layoutState = 0;
    setNeedsLayout(false);
}
开发者ID:xiaolu31,项目名称:webkit-node,代码行数:43,代码来源:RenderView.cpp

示例14: main

int main(int argc, char *argv[])
{

	program *prog = (program *) malloc(sizeof(program));
	player *user = (player *) malloc(sizeof(player));
	whitespace_info *whitespace_prog = (whitespace_info *) malloc(sizeof(whitespace_info));
	printing_board *first_board = (printing_board *) malloc(sizeof(printing_board));
	password_info *pw_info = (password_info *) malloc(sizeof(password_info));

	SDL_Simplewin sw;
	other_arg_type argument_indicator;

	check_initialisation(prog, user, whitespace_prog, first_board, pw_info);
	password_check(pw_info);

	if(pw_info -> pw_indicator == accept){

		check_command_line_arguments(user, argc, &argument_indicator, argv, pw_info);
		initialisation(prog, user, first_board);

		if(argument_indicator == secret){

			whitespace_functions(argv[1], whitespace_prog);
			open_program_file("ws_to_reg_translation.txt", prog);

		}
		else if(argument_indicator == combine_files){

			combine_ws_reg_files(prog, whitespace_prog, argv[1], argv[2]);

		}
		else if(argument_indicator != password_change){

			open_program_file(argv[1], prog);

		}

		if(argument_indicator == regular || argument_indicator == secret){

			parse_text_and_interpret(prog, user, first_board);
			printing(user, first_board, &sw);

		}
		else if(argument_indicator != password_change){

			write_file_to_whitespace(prog);

		}

	}

	free_components(first_board, prog, user, whitespace_prog, pw_info);

	return(0);
}
开发者ID:JamesCollerton,项目名称:Turtle_Graphics,代码行数:55,代码来源:turtle.c

示例15: computeAbsoluteRepaintRect

void RenderView::computeAbsoluteRepaintRect(IntRect& rect, bool fixed)
{
    if (printing())
        return;

    if (fixed && m_frameView)
        rect.move(m_frameView->scrollX(), m_frameView->scrollY());
        
    // Apply our transform if we have one (because of full page zooming).
    if (m_layer && m_layer->transform())
        rect = m_layer->transform()->mapRect(rect);
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:12,代码来源:RenderView.cpp


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