您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetPageSize函数代码示例

51自学网 2021-06-01 21:12:15
  C++
这篇教程C++ GetPageSize函数代码示例写得很实用,希望能帮到您。

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

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

示例1: MmapWrapperWriteAndReadMemoryAccess

const char * MmapWrapperWriteAndReadMemoryAccess(){#if defined(TARGET_MAC)    return reinterpret_cast<const char *> (mmap(0, GetPageSize(), PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0));#else   return reinterpret_cast<const char *> (mmap(0, GetPageSize(), PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, 0, 0));#endif}
开发者ID:EmilyBragg,项目名称:profiling-tool,代码行数:8,


示例2: GetRangeMin

void CRoundSliderCtrl::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) {	const int nMin = GetRangeMin();	const int nMax = GetRangeMax()+1;	switch(nChar)	{	case VK_LEFT:	case VK_UP:		{			int nNewPos = GetPos()-GetLineSize();			while(nNewPos < nMin) nNewPos += (nMax - nMin);			SetPos(nNewPos);			RedrawWindow();			PostMessageToParent(TB_LINEUP);		}		break;		case VK_RIGHT:	case VK_DOWN:		{			int nNewPos = GetPos()+GetLineSize();			while(nNewPos >= nMax) nNewPos -= (nMax - nMin);			SetPos(nNewPos);			RedrawWindow();			PostMessageToParent(TB_LINEDOWN);		}		break;	case VK_PRIOR:		{			int nNewPos = GetPos()-GetPageSize();			while(nNewPos < nMin) nNewPos += (nMax - nMin);			SetPos(nNewPos);			RedrawWindow();			PostMessageToParent(TB_PAGEUP);		}		break;	case VK_NEXT:		{			int nNewPos = GetPos()+GetPageSize();			while(nNewPos >= nMax) nNewPos -= (nMax - nMin);			SetPos(nNewPos);			RedrawWindow();			PostMessageToParent(TB_PAGEDOWN);		}		break;	case VK_HOME:	case VK_END:		// Do nothing (ignore keystroke)		break;	default:		CSliderCtrl::OnKeyDown(nChar, nRepCnt, nFlags);	}}
开发者ID:ttrask,项目名称:staubliserver,代码行数:58,


示例3: tsk_pagesize

static int tsk_pagesize(RIOMach *riom) {#define GetPageSize(x) (host_page_size (riom->task, x) == KERN_SUCCESS)	static vm_size_t pagesize = 0;	return pagesize ? pagesize		: GetPageSize (&pagesize)			? pagesize : 4096;}
开发者ID:ghostbar,项目名称:radare2.deb,代码行数:7,


示例4: GetPageSize

bool wxNotebook::MSWPrintChild(WXHDC hDC, wxWindow *child){    // solid background colour overrides themed background drawing    if ( !UseBgCol() && DoDrawBackground(hDC, child) )        return true;    // If we're using a solid colour (for example if we've switched off    // theming for this notebook), paint it    if (UseBgCol())    {        wxRect r = GetPageSize();        if ( r.IsEmpty() )            return false;        RECT rc;        wxCopyRectToRECT(r, rc);        // map rect to the coords of the window we're drawing in        if ( child )            ::MapWindowPoints(GetHwnd(), GetHwndOf(child), (POINT *)&rc, 2);        wxBrush brush(GetBackgroundColour());        HBRUSH hbr = GetHbrushOf(brush);        ::FillRect((HDC) hDC, &rc, hbr);        return true;    }    return wxNotebookBase::MSWPrintChild(hDC, child);}
开发者ID:chromylei,项目名称:third_party,代码行数:31,


示例5: wxCHECK_MSG

bool wxNotebook::SetPageText(size_t nPage, const wxString& strText){    wxCHECK_MSG( IS_VALID_PAGE(nPage), false, wxT("notebook page out of range") );    TC_ITEM tcItem;    tcItem.mask = TCIF_TEXT;    tcItem.pszText = wxMSW_CONV_LPTSTR(strText);    if ( !HasFlag(wxNB_MULTILINE) )        return TabCtrl_SetItem(GetHwnd(), nPage, &tcItem) != 0;    // multiline - we need to set new page size if a line is added or removed    int rows = GetRowCount();    bool ret = TabCtrl_SetItem(GetHwnd(), nPage, &tcItem) != 0;    if ( ret && rows != GetRowCount() )    {        const wxRect r = GetPageSize();        const size_t count = m_pages.Count();        for ( size_t page = 0; page < count; page++ )            m_pages[page]->SetSize(r);    }    return ret;}
开发者ID:chromylei,项目名称:third_party,代码行数:25,


示例6: main

int main(int nargs, char **args){   size_t pgsz;   int MaxL1Size;   int muladd, lat, lbnreg, L1Size, mmnreg, nkflop;   FILE *fpout;   char pre;   if (nargs != 3)   {      fprintf(stderr, "USAGE: %s <pre> <file>/n", args[0]);      exit(-1);   }   pre = *args[1];   L1Size = 1024 * GetL1CacheSize(64);   if (pre == 'd') L1Size /= ATL_dsize;   else if (pre == 's') L1Size /= ATL_ssize;   else if (pre == 'z') L1Size /= ATL_csize;   else if (pre == 'c') L1Size /= ATL_zsize;   getfpinfo(pre, &muladd, &lat, &lbnreg, &nkflop);   pgsz = GetPageSize();   CreateHeader(pre, args[2], L1Size, muladd, lat, lbnreg, nkflop, 0, pgsz);   mmnreg = getmmnreg(pre);   CreateHeader(pre, args[2], L1Size, muladd, lat, lbnreg, nkflop, mmnreg,pgsz);   return(0);}
开发者ID:kevinoid,项目名称:atlas-debian,代码行数:27,


示例7: TabCtrl_HitTest

int wxNotebook::HitTest(const wxPoint& pt, long *flags) const{    TC_HITTESTINFO hitTestInfo;    hitTestInfo.pt.x = pt.x;    hitTestInfo.pt.y = pt.y;    int item = TabCtrl_HitTest(GetHwnd(), &hitTestInfo);    if ( flags )    {        *flags = 0;        if ((hitTestInfo.flags & TCHT_NOWHERE) == TCHT_NOWHERE)            *flags |= wxBK_HITTEST_NOWHERE;        if ((hitTestInfo.flags & TCHT_ONITEM) == TCHT_ONITEM)            *flags |= wxBK_HITTEST_ONITEM;        if ((hitTestInfo.flags & TCHT_ONITEMICON) == TCHT_ONITEMICON)            *flags |= wxBK_HITTEST_ONICON;        if ((hitTestInfo.flags & TCHT_ONITEMLABEL) == TCHT_ONITEMLABEL)            *flags |= wxBK_HITTEST_ONLABEL;        if ( item == wxNOT_FOUND && GetPageSize().Contains(pt) )            *flags |= wxBK_HITTEST_ONPAGE;    }    return item;}
开发者ID:chromylei,项目名称:third_party,代码行数:25,


示例8: pressed

/*---------------------------------------------------------------------- *       Class:  AmayaScrollBar *      Method:  OnScroll * Description:    -----------------------------------------------------------------------*/void AmayaScrollBar::OnScroll( wxScrollEvent& event ){  /* this flag is necessary because 2 events occure when up/down button     is pressed (it's an optimisation)     this hack works because OnLineDown is called before OnScroll,     but becareful the events orders could change in future wxWidgets     releases or can be platform specific  */  if (m_IgnoreNextScrollEvent)    {      m_IgnoreNextScrollEvent = FALSE;      event.Skip();      return;    }    if (event.GetOrientation() == wxHORIZONTAL)    {      TTALOGDEBUG_3( TTA_LOG_DIALOG, _T("AmayaScrollBar::OnScroll [wxHORIZONTAL][frameid=%d][pos=%d][pagesize=%d]"), m_ParentFrameID, event.GetPosition(), GetPageSize() );      FrameHScrolledCallback( m_ParentFrameID,                              event.GetPosition(),                              GetPageSize() );    }  else if (event.GetOrientation() == wxVERTICAL)    {      TTALOGDEBUG_3( TTA_LOG_DIALOG, _T("AmayaScrollBar::OnScroll [wxVERTICAL][frameid=%d][pos=%d][pagesize=%d]"), m_ParentFrameID, event.GetPosition(), GetPageSize() );      FrameVScrolledCallback( m_ParentFrameID,                              event.GetPosition() );    }}
开发者ID:ArcScofield,项目名称:Amaya,代码行数:34,


示例9: GetPageSize

WXHBRUSH wxNotebook::QueryBgBitmap(){    wxRect r = GetPageSize();    if ( r.IsEmpty() )        return 0;    wxUxThemeHandle theme(this, L"TAB");    if ( !theme )        return 0;    RECT rc;    wxCopyRectToRECT(r, rc);    WindowHDC hDC(GetHwnd());    wxUxThemeEngine::Get()->GetThemeBackgroundExtent                            (                                theme,                                (HDC) hDC,                                9 /* TABP_PANE */,                                0,                                &rc,                                &rc                            );    MemoryHDC hDCMem(hDC);    CompatibleBitmap hBmp(hDC, rc.right, rc.bottom);    SelectInHDC selectBmp(hDCMem, hBmp);    if ( !DoDrawBackground((WXHDC)(HDC)hDCMem) )        return 0;    return (WXHBRUSH)::CreatePatternBrush(hBmp);}
开发者ID:AdmiralCurtiss,项目名称:pcsx2,代码行数:34,


示例10: GetPageSize

void CXFA_FFPageView::GetDisplayMatrix(CFX_Matrix& mt,                                       const CFX_Rect& rtDisp,                                       int32_t iRotate) const {  CFX_SizeF sz = GetPageSize();  CFX_RectF fdePage;  fdePage.Set(0, 0, sz.x, sz.y);  GetPageMatrix(mt, fdePage, rtDisp, iRotate, 0);}
开发者ID:gradescope,项目名称:pdfium,代码行数:8,


示例11: SafeCopyTest

/*! * Test the PIN_SafeCopy() function in the following scenarios: * A. Successful copy of an entire memory region * B. Partial copy of a memory region, whose tail is inaccessible * C. Failure to copy an inaccessible memory region */VOID SafeCopyTest(){    size_t pageSize = GetPageSize();    CHAR * src = (CHAR *)MemAlloc(2*pageSize);    ASSERTX(src != 0);    CHAR * srcBuf = src + 1; // +1 for testing unaligned access    CHAR * dst = (CHAR *)MemAlloc(2*pageSize);    ASSERTX(dst != 0);    CHAR * dstBuf = dst + 1; // +1 for testing unaligned access    size_t bufSize = 2*pageSize - 1;    size_t halfBufSize = pageSize - 1;    size_t copySize;    //A.    for (unsigned int i = 0; i < bufSize; ++i)    {        src[i] = i/256;        dst[i] = 0;    }    copySize = PIN_SafeCopy(dstBuf, srcBuf, bufSize);     ASSERT(((copySize == bufSize) && (memcmp(dstBuf, srcBuf, bufSize) == 0)), "SafeCopy (A) failed./n");    out << "SafeCopy (A): Entire buffer has been copied successfully." << endl << flush;    //B.    for (unsigned int i = 0; i < pageSize; ++i)    {        dst[i] = 0;    }    MemProtect(src + pageSize, pageSize, FALSE); // second half of src is inaccessible    copySize = PIN_SafeCopy(dstBuf, srcBuf, bufSize);     ASSERT(((copySize == halfBufSize) && (memcmp(dstBuf, srcBuf, halfBufSize) == 0)), "SafeCopy (B) failed./n");    // Check to see that all accessible bytes near the end of the first page are copied successfully    for (unsigned int sz = 1; sz < 16; ++sz)    {        for (unsigned int i = 0; i < sz; ++i)        {            dstBuf[i] = 0;        }        copySize = PIN_SafeCopy(dstBuf, src + pageSize - sz, pageSize);         ASSERT(((copySize == sz) && (memcmp(dstBuf, src + pageSize - sz, sz) == 0)), "SafeCopy (B) failed./n");    }    out << "SafeCopy (B): Accessible part of the buffer has been copied successfully."  << endl << flush;    //C.    MemProtect(dst, pageSize, FALSE); // dst is inaccessible    copySize = PIN_SafeCopy(dstBuf, srcBuf, bufSize);     ASSERT((copySize == 0), "SafeCopy (C) failed./n");    out << "SafeCopy (C): Inaccessible buffer has not been copied."  << endl << flush;    MemFree(src, 2*pageSize);    MemFree(dst, 2*pageSize);}
开发者ID:EmilyBragg,项目名称:profiling-tool,代码行数:64,


示例12: wxCHECK_RET

void wxNotebook::AdjustPageSize(wxNotebookPage *page){    wxCHECK_RET( page, wxT("NULL page in wxNotebook::AdjustPageSize") );    const wxRect r = GetPageSize();    if ( !r.IsEmpty() )    {        page->SetSize(r);    }}
开发者ID:chromylei,项目名称:third_party,代码行数:10,


示例13: GetShowButtons

void ScrollBarHorizontal::SetPos(float pos){	ScrollBarBase::SetPos(pos);	float mult = GetShowButtons() ? 1.0f : 0.0f;	_btnBox->Resize(std::max(GetScrollPaneLength() * GetPageSize() / GetDocumentSize(), _btnBox->GetTextureWidth()),		_btnBox->GetHeight());	_btnBox->Move(floorf(_btnUpLeft->GetWidth() * mult + (GetWidth() - _btnBox->GetWidth()		- (_btnUpLeft->GetWidth() + _btnDownRight->GetWidth()) * mult) * GetPos() / (GetDocumentSize() - GetPageSize()) + 0.5f), _btnBox->GetY());}
开发者ID:Asqwel,项目名称:TZOD-Modified,代码行数:10,


示例14: GetPageSize

bool wxWizard::ResizeBitmap(wxBitmap& bmp){    if (!GetBitmapPlacement())        return false;    if (bmp.Ok())    {        wxSize pageSize = m_sizerPage->GetSize();        if (pageSize == wxSize(0,0))            pageSize = GetPageSize();        int bitmapWidth = wxMax(bmp.GetWidth(), GetMinimumBitmapWidth());        int bitmapHeight = pageSize.y;        if (!m_statbmp->GetBitmap().Ok() || m_statbmp->GetBitmap().GetHeight() != bitmapHeight)        {            wxBitmap bitmap(bitmapWidth, bitmapHeight);            {                wxMemoryDC dc;                dc.SelectObject(bitmap);                dc.SetBackground(wxBrush(m_bitmapBackgroundColour));                dc.Clear();                if (GetBitmapPlacement() & wxWIZARD_TILE)                {                    TileBitmap(wxRect(0, 0, bitmapWidth, bitmapHeight), dc, bmp);                }                else                {                    int x, y;                    if (GetBitmapPlacement() & wxWIZARD_HALIGN_LEFT)                        x = 0;                    else if (GetBitmapPlacement() & wxWIZARD_HALIGN_RIGHT)                        x = bitmapWidth - bmp.GetWidth();                    else                        x = (bitmapWidth - bmp.GetWidth())/2;                    if (GetBitmapPlacement() & wxWIZARD_VALIGN_TOP)                        y = 0;                    else if (GetBitmapPlacement() & wxWIZARD_VALIGN_BOTTOM)                        y = bitmapHeight - bmp.GetHeight();                    else                        y = (bitmapHeight - bmp.GetHeight())/2;                    dc.DrawBitmap(bmp, x, y, true);                    dc.SelectObject(wxNullBitmap);                }            }            bmp = bitmap;        }    }    return true;}
开发者ID:jonntd,项目名称:dynamica,代码行数:55,


示例15: main

/*! * The main procedure of the application. */int main(int argc, char *argv[]){    cerr << "SMC in the image of the application" << endl;    // buffer to move foo/bar routines into and execute    static char staticBuffer[PI_FUNC::MAX_SIZE];    // Set read-write-execute protection for the buffer     size_t pageSize = GetPageSize();    char * firstPage = (char *)(((size_t)staticBuffer) & ~(pageSize - 1));    char * endPage = (char *)(((size_t)staticBuffer + sizeof(staticBuffer) + pageSize - 1) & ~(pageSize - 1));    if (!MemProtect(firstPage, endPage - firstPage, MEM_READ_WRITE_EXEC)) {Abort("MemProtect failed");}    for (int i = 0; i < 3; ++i)    {        FOO_FUNC fooFunc;        fooFunc.Copy(staticBuffer).Execute().AssertStatus();        cerr << fooFunc.Name() << ": " << fooFunc.ErrorMessage() << endl;        BAR_FUNC barFunc;        barFunc.Copy(staticBuffer).Execute().AssertStatus();        cerr << barFunc.Name() << ": " << barFunc.ErrorMessage() << endl;    }    cerr << "Dynamic code generation" << endl;    void * dynamicBuffer;    dynamicBuffer = MemAlloc(PI_FUNC::MAX_SIZE, MEM_READ_WRITE_EXEC);    if (dynamicBuffer == 0) {Abort("MemAlloc failed");}    {        FOO_FUNC fooFunc;        fooFunc.Copy(dynamicBuffer);        if (!MemProtect(dynamicBuffer, PI_FUNC::MAX_SIZE, MEM_READ_EXEC)) {Abort("MemProtect failed");}        for (int i = 0; i < 3; ++i)        {            fooFunc.Execute().AssertStatus();            cerr << fooFunc.Name() << ": " << fooFunc.ErrorMessage() << endl;        }    }    if (!MemProtect(dynamicBuffer, PI_FUNC::MAX_SIZE, MEM_READ_WRITE_EXEC)) {Abort("MemProtect failed");}    {        BAR_FUNC barFunc;        barFunc.Copy(dynamicBuffer);        if (!MemProtect(dynamicBuffer, PI_FUNC::MAX_SIZE, MEM_READ_EXEC)) {Abort("MemProtect failed");}        for (int i = 0; i < 3; ++i)        {            barFunc.Execute().AssertStatus();            cerr << barFunc.Name() << ": " << barFunc.ErrorMessage() << endl;        }    }    return 0;}
开发者ID:EmilyBragg,项目名称:profiling-tool,代码行数:57,


示例16: GetPageAllocGranularitySize

// ////////////////////////////////////////////////////////////////////////////unsigned int GetPageAllocGranularitySize(){#if _Windows   SYSTEM_INFO system_data;   ::GetSystemInfo(&system_data);   return(static_cast<unsigned int>(system_data.dwAllocationGranularity));#else   return(GetPageSize());#endif /* #if _Windows */}
开发者ID:neilgroves,项目名称:MlbDev,代码行数:13,


示例17: GetPageSize

// static publicbool ProcessInformation::BlockInMemory (const void* start){    unsigned char x = 0;    if (mincore (const_cast<void*>(AlignToStartOfPage (start)),                 GetPageSize (),                 &x)) {        LOG (ERROR) << "mincore failed: " << strerror (errno);        return 1;    }    return x & 0x1;}
开发者ID:ericgogh,项目名称:Swift,代码行数:13,


示例18: MapFile

  void MapFile()  {    int pagesize = GetPageSize();    int flag = GetMMapFlag();    int prot = GetMMapProt();    mapped_size_ = ((size_  + pagesize - 1) / pagesize) * pagesize;    ptr_ = mmap(0, mapped_size_, prot, flag, fd_, offset_);    if(ptr_ == MAP_FAILED){      close(fd_);      throw MMapException("mmap", path_);    }  }
开发者ID:shnya,项目名称:experiments,代码行数:13,


示例19: init_heap_space

static voidinit_heap_space(size_t min_size, size_t max_size){	size_t pagesize, alloc_size, reserve_size, freesize_pre, freesize_post;	unsigned int min_num_segments, max_num_segments, bitmap_bits;	void *p;	pagesize = GetPageSize();	if (SEGMENT_SIZE % pagesize != 0)		sml_fatal(0, "SEGMENT_SIZE is not aligned in page size.");	alloc_size = ALIGNSIZE(min_size, SEGMENT_SIZE);	reserve_size = ALIGNSIZE(max_size, SEGMENT_SIZE);	if (alloc_size < SEGMENT_SIZE)		alloc_size = SEGMENT_SIZE;	if (reserve_size < alloc_size)		reserve_size = alloc_size;	min_num_segments = alloc_size / SEGMENT_SIZE;	max_num_segments = reserve_size / SEGMENT_SIZE;	p = ReservePage(HEAP_BEGIN_ADDR, SEGMENT_SIZE + reserve_size);	if (p == ReservePageError)		sml_fatal(0, "failed to alloc virtual memory.");	freesize_post = (uintptr_t)p & (SEGMENT_SIZE - 1);	if (freesize_post == 0) {		ReleasePage(p + reserve_size, SEGMENT_SIZE);	} else {		freesize_pre = SEGMENT_SIZE - freesize_post;		ReleasePage(p, freesize_pre);		p = (char*)p + freesize_pre;		ReleasePage(p + reserve_size, freesize_post);	}	heap_space.begin = p;	heap_space.end = (char*)p + reserve_size;	heap_space.min_num_segments = min_num_segments;	heap_space.max_num_segments = max_num_segments;	heap_space.num_committed = 0;	heap_space.extend_step = min_num_segments > 0 ? min_num_segments : 1;	bitmap_bits = ALIGNSIZE(max_num_segments, BITPTR_WORDBITS);	heap_space.bitmap = xmalloc(bitmap_bits / CHAR_BIT);	memset(heap_space.bitmap, 0, bitmap_bits / CHAR_BIT);	extend_heap(min_num_segments);}
开发者ID:hsk,项目名称:docs,代码行数:51,


示例20: Unmap

bool MappedFile::Map( const char* fileName, int startPage, int nBytes ){    if (m_hMapping != INVALID_HANDLE_VALUE)    {        Unmap();    }    m_hFile = CreateFile( fileName, GENERIC_READ, FILE_SHARE_READ, 0,                            OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );    if (m_hFile == INVALID_HANDLE_VALUE)    {        rlog.err( "Could not open file for mapping: %s", fileName );        return false;    }    m_FileSize = ::GetFileSize( m_hFile, NULL );    //  create mapping name    char mapName[_MAX_PATH];    strcpy( mapName, fileName );    char* pName = mapName;    while (*pName)    {        if (*pName == '//' || *pName == '/') *pName = '_';        pName++;    }    m_hMapping = CreateFileMapping( m_hFile, NULL, PAGE_READONLY, 0, 0, mapName );    uint32_t err = GetLastError();    if (m_hMapping == NULL)    {        rlog.err( "Could not memory-map file: %s", fileName );        m_hMapping = INVALID_HANDLE_VALUE;        return false;    }    m_pBuffer = (uint8_t*)MapViewOfFile( m_hMapping, FILE_MAP_READ, 0, startPage*GetPageSize(), nBytes );    if (m_pBuffer == NULL)    {        uint32_t errCode = GetLastError();        rlog.err( "Could not memory-map view of file: %s. Error code: %X", fileName );        return false;    }    CloseHandle( m_hFile );    m_hFile = INVALID_HANDLE_VALUE;    m_MappedSize        = nBytes;    m_FirstMappedPage   = startPage;    return true;} // MappedFile::Map
开发者ID:skopp,项目名称:rush,代码行数:51,


示例21: DisplayUserError

    HRESULT TiledTextureFile::Initialize()    {        TILEDFILE_HEADER& Header = m_Header;        if( Header.BaseWidthTexels == 0 || Header.BaseWidthTexels > MAX_WIDTH_TEXELS )        {            DisplayUserError( "Texture base width in texels must be between 0 and %d.", MAX_WIDTH_TEXELS );            return E_INVALIDARG;        }        if( Header.BaseHeightTexels == 0 || Header.BaseHeightTexels > MAX_HEIGHT_TEXELS )        {            DisplayUserError( "Texture base height in texels must be between 0 and %d.", MAX_HEIGHT_TEXELS );            return E_INVALIDARG;        }        if( Header.ArraySliceCount == 0 )        {            DisplayUserError( "Texture must have at least 1 array level." );            return E_INVALIDARG;        }        SIZE PageSize = GetPageSize( Header.Format );        if( PageSize.cx == 0 || PageSize.cy == 0 )        {            DisplayUserError( "Could not create texture with desired format." );            return E_INVALIDARG;        }        Header.PageWidthTexels = (UINT)PageSize.cx;        Header.PageHeightTexels = (UINT)PageSize.cy;        UINT MipLevels = Header.MipLevelCount;        UINT MaxMipLevelCount = 1;        if( MipLevels == 0 )        {            UINT Width = Header.BaseWidthTexels;            UINT Height = Header.BaseHeightTexels;            UINT WidthPages = NextWholeQuotient( Width, Header.PageWidthTexels );            UINT HeightPages = NextWholeQuotient( Height, Header.PageHeightTexels );            while( WidthPages > 1 || HeightPages > 1 )            {                ++MaxMipLevelCount;                Width = max( 1, Width >> 1 );                Height = max( 1, Height >> 1 );                WidthPages = NextWholeQuotient( Width, Header.PageWidthTexels );                HeightPages = NextWholeQuotient( Height, Header.PageHeightTexels );            }            MipLevels = MaxMipLevelCount;        }
开发者ID:kingofthebongo2008,项目名称:examples,代码行数:48,


示例22: Warmup

uint8_t MappedFile::Warmup( int startPage, int nBytes ){    if (nBytes == 0)    {        nBytes = m_MappedSize;    }    const uint8_t* pData = m_pBuffer + startPage*GetPageSize();    uint8_t res = 0;    int nTouched = 0;    while (nTouched < nBytes)    {        res      += m_pBuffer[nTouched];        nTouched += c_WarmupStep;    }    return res;} // MappedFile::Warmup
开发者ID:skopp,项目名称:rush,代码行数:17,


示例23: shared_from_this

const sf::FloatRect Scale::GetSliderRect() const {	auto slider_length = Context::Get().GetEngine().GetProperty<float>( "SliderLength", shared_from_this() );	auto slider_width = (GetOrientation() == Orientation::HORIZONTAL) ? GetAllocation().height : GetAllocation().width;	auto adjustment = GetAdjustment();	auto current_value = adjustment->GetValue();	auto value_range = adjustment->GetUpper() - adjustment->GetLower() - adjustment->GetPageSize();	if( GetOrientation() == Orientation::HORIZONTAL ) {		auto slider_x = (GetAllocation().width - slider_length) * (current_value - adjustment->GetLower()) / value_range;		auto slider_y = (GetAllocation().height - slider_width) / 2.f;		return sf::FloatRect( slider_x, slider_y, slider_length, slider_width );	}	auto slider_x = (GetAllocation().width - slider_width) / 2.f;	auto slider_y = (GetAllocation().height - slider_length) * (1 - ((current_value - adjustment->GetLower()) / value_range));	return sf::FloatRect( slider_x, slider_y, slider_width, slider_length );}
开发者ID:soarqin,项目名称:SFGUI,代码行数:19,


示例24: theme

bool wxNotebook::DoDrawBackground(WXHDC hDC, wxWindow *child){    wxUxThemeHandle theme(child ? child : this, L"TAB");    if ( !theme )        return false;    // get the notebook client rect (we're not interested in drawing tabs    // themselves)    wxRect r = GetPageSize();    if ( r.IsEmpty() )        return false;    RECT rc;    wxCopyRectToRECT(r, rc);    // map rect to the coords of the window we're drawing in    if ( child )        ::MapWindowPoints(GetHwnd(), GetHwndOf(child), (POINT *)&rc, 2);    // we have the content area (page size), but we need to draw all of the    // background for it to be aligned correctly    wxUxThemeEngine::Get()->GetThemeBackgroundExtent                            (                                theme,                                (HDC) hDC,                                9 /* TABP_PANE */,                                0,                                &rc,                                &rc                            );    wxUxThemeEngine::Get()->DrawThemeBackground                            (                                theme,                                (HDC) hDC,                                9 /* TABP_PANE */,                                0,                                &rc,                                NULL                            );    return true;}
开发者ID:chromylei,项目名称:third_party,代码行数:42,


示例25: assert

// Initializes a property page and provides the page with a pointer to the// IPropertyPageSite interface through which the property page communicates// with the property frameSTDMETHODIMP CPropertyPageEx::SetPageSite(LPPROPERTYPAGESITE pPageSite){	HRESULT	hres = NOERROR;	if (pPageSite) {		assert(!m_pPageSite);		if (m_pPageSite)			return ResultFromScode(E_UNEXPECTED);		m_pPageSite = pPageSite;		m_pPageSite->AddRef();		hres = GetPageSize(m_size);	} else {		assert(m_pPageSite);		if (m_pPageSite) {			m_pPageSite->Release();			m_pPageSite = NULL;		}	}	return hres;}
开发者ID:vicamo,项目名称:b2g_mozilla-central,代码行数:26,


示例26: posix_memalign

    MemoryChunk::MemoryChunk()    {        blocks_ = 0;#ifdef USE_DIRECT_IO        int ret_code = posix_memalign(reinterpret_cast<void**>(&blocks_), GetPageSize(), ChunkSize);        if (ret_code)        {            LOG4CPLUS_ERROR(Loggers::Service(), "Failed to allocate aligned memory buffer. ret_code="<<ret_code<<".");            blocks_ = 0;        }#else        blocks_ = reinterpret_cast<char*>(malloc(ChunkSize));#endif        if (blocks_)        {            for(size_t i = 0; i < BlocksPerChunk; ++i)            {                available_blocks_.push_back(blocks_ + i*BlockData::MaxBlockSize);            }        }    }
开发者ID:huangyt,项目名称:MyProjects,代码行数:23,


示例27: spectre_document_get_page

	QImage Document::RenderPage (int index, double xRes, double yRes)	{		auto page = spectre_document_get_page (SD_, index);		auto rc = spectre_render_context_new ();		auto size = GetPageSize (index);		spectre_render_context_set_scale (rc, xRes, yRes);		size.rwidth () *= xRes;		size.rheight () *= yRes;		unsigned char *data = 0;		int rowLength = 0;		spectre_page_render (page, rc, &data, &rowLength);		spectre_render_context_free (rc);		spectre_page_free (page);		const QImage& img = rowLength == size.width () * 4 ?				QImage (data, size.width (), size.height (), QImage::Format_RGB32) :				QImage (data, rowLength / 4, size.height (), QImage::Format_RGB32)					.copy (0, 0, size.width (), size.height ());		free (data);		return img;	}
开发者ID:SboichakovDmitriy,项目名称:leechcraft,代码行数:23,


示例28: AfxGetCurrentSettings

void CVolumeCtrl::IncreaseVolume(){	AppSettings& s = AfxGetCurrentSettings();	if(GetPos() > 99 && !s.fAudioNormalize){		SetPosInternal(GetPos() + 1);		/*		DWORD plVolume;				int WaveOutVol = 100;		// 		if(MMSYSERR_NOERROR == waveOutGetVolume(0, (DWORD*)plVolume) ){		// 			WaveOutVol = (HIWORD(plVolume) + LOWORD(plVolume)) * 100 / 2 / 0xFFFF;		// 		}				if( WaveOutVol > 90){					int iBVol = (int)(50.0f*log10(s.AudioBoost));					iBVol = min(iBVol + 8, 100);					s.AudioBoost = pow(10.0f, (float)iBVol/50);					if( s.AudioBoost > 100)						s.AudioBoost = 100;				}else{					//increaseWaveOut										//plVolume = (min( (HIWORD(plVolume) + 0x0FFF), 0xFFFF) << 16) |  min( (LOWORD(plVolume) + 0x0FFF), 0xFFFF) ;					//waveOutSetVolume(0, plVolume);									}*/			}else{		if (GetPos() > 95 ){			SetPosInternal(100);		}else if (GetPos() > 25 ){			SetPosInternal(GetPos() + GetPageSize());		}else if (GetPos() > 15 ){			SetPosInternal(GetPos() + 3);		}else{			SetPosInternal(GetPos() + 1);		}	}}
开发者ID:Strongc,项目名称:playasa,代码行数:37,



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


C++ GetParamNode函数代码示例
C++ GetPageEnd函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。