// Setup the device context for drawing void cef_dark_window::InitDeviceContext(HDC hdc) { RECT rectClipClient; SetRectEmpty(&rectClipClient); ComputeLogicalClientRect(rectClipClient); // exclude the client area to reduce flicker ::ExcludeClipRect(hdc, rectClipClient.left, rectClipClient.top, rectClipClient.right, rectClipClient.bottom); }
void Outpin::AddVIH( CMediaTypes& mtv, const GUID& subtype, REFERENCE_TIME AvgTimePerFrame, LONG width, LONG height, DWORD dwBitCount, DWORD dwSizeImage) { AM_MEDIA_TYPE mt; VIDEOINFOHEADER vih; BITMAPINFOHEADER& bmih = vih.bmiHeader; mt.majortype = MEDIATYPE_Video; mt.subtype = subtype; mt.bFixedSizeSamples = TRUE; mt.bTemporalCompression = FALSE; mt.lSampleSize = 0; mt.formattype = FORMAT_VideoInfo; mt.pUnk = 0; mt.cbFormat = sizeof vih; mt.pbFormat = (BYTE*)&vih; SetRectEmpty(&vih.rcSource); SetRectEmpty(&vih.rcTarget); vih.dwBitRate = 0; vih.dwBitErrorRate = 0; vih.AvgTimePerFrame = AvgTimePerFrame; bmih.biSize = sizeof bmih; bmih.biWidth = width; bmih.biHeight = height; bmih.biPlanes = 1; //because Microsoft says so bmih.biBitCount = static_cast<WORD>(dwBitCount); bmih.biCompression = subtype.Data1; bmih.biSizeImage = dwSizeImage; bmih.biXPelsPerMeter = 0; bmih.biYPelsPerMeter = 0; bmih.biClrUsed = 0; bmih.biClrImportant = 0; mtv.Add(mt); }
void StringItem::Measure(HDC hDC, SIZE *size) { MenuItem::Measure(hDC, size); if (false == Settings_menu.showBroams) { size->cx = imax(size->cx + 20, 120); size->cy += 6; } SetRectEmpty(&m_textrect); }
/* Effect: Handle any actions relating to the user pressing *down* the left mouse button within the widget. In particular, we need to prepare the widget for moving || sizing. To do this, we remove any drag blobs already present on the widget. We also capture the mouse input, so we can track the movement of the mouse. We will release the capture when the user releases the mouse key. Since the window class style of the widget might not accept double clicks, we will need to compute double clicks ourselves. If someone else has control of the mouse (like the session window || another widget), we won't be getting this mouse message. See Also: WidgetLButtonUp, WidgetLMouseMove. Called By: WidgetWndProc, in response to WM_LBUTTONDOWN messages. LayoutWndProc, in response to WM_LBUTTONDOWN messages when the mouse is over a drag blob. */ void WidgetLButtonDown(HWND hWnd, int nDragMode, POINT ptScreen) { RECT rcParentScreen; HWND hWndParent, hWndPrev; HDC hDC; CurrentWidgetInfo.ptPrev = ptScreen; hWndParent = GetParent(hWnd); CurrentWidgetInfo.nDragMode = nDragMode; hDC = GetDC(hWndParent); /* Erase the drag blobs from the current widget. The blobs will */ /* be repainted in WidgetButtonUp after the user finishes dragging */ /* || sizing. */ GetWindowRect(hWnd, &CurrentWidgetInfo.rcPrevDots); GetWindowRect(hWnd, &CurrentWidgetInfo.rcPrev); hWndPrev = CurrentWidgetInfo.hWnd; CurrentWidgetInfo.bDotsDrawn = FALSE; CurrentWidgetInfo.bDotsDrawn = TRUE; if (hWnd != CurrentWidgetInfo.hWnd) { if (KpsSetCurrentWidget(hWnd)) { if (IsWindow(hWndPrev)) { if (KpsIsAWidget(hWndPrev)) { InvalidateRect(hWndPrev, NULL, TRUE); UpdateWindow(hWndPrev); } } } InvalidateRect(hWnd, NULL, TRUE); UpdateWindow(hWnd); } if (!CurrentWidgetInfo.bCapture) { SetCapture(hWnd); GetClientRect(hWndParent, &rcParentScreen); KpsClientRectToScreen(hWndParent, &rcParentScreen); ClipCursor(&rcParentScreen); CurrentWidgetInfo.bCapture = TRUE; } ReleaseDC(hWndParent, hDC); /* Clear out the rectangle, indicating there is nothing to erase! */ SetRectEmpty(&rcPrev); }
/*********************************************************************** * DrawInsert (COMCTL32.15) * * Draws insert arrow by the side of the ListBox item in the parent window. * * RETURNS * Nothing. */ VOID WINAPI DrawInsert (HWND hwndParent, HWND hwndLB, INT nItem) { RECT rcItem, rcListBox, rcDragIcon; HDC hdc; DRAGLISTDATA * data; TRACE("(%p %p %d)\n", hwndParent, hwndLB, nItem); if (!hDragArrow) hDragArrow = LoadIconW(COMCTL32_hModule, (LPCWSTR)IDI_DRAGARROW); if (LB_ERR == SendMessageW(hwndLB, LB_GETITEMRECT, nItem, (LPARAM)&rcItem)) return; if (!GetWindowRect(hwndLB, &rcListBox)) return; /* convert item rect to parent co-ordinates */ if (!MapWindowPoints(hwndLB, hwndParent, (LPPOINT)&rcItem, 2)) return; /* convert list box rect to parent co-ordinates */ if (!MapWindowPoints(HWND_DESKTOP, hwndParent, (LPPOINT)&rcListBox, 2)) return; rcDragIcon.left = rcListBox.left - DRAGICON_HOTSPOT_X; rcDragIcon.top = rcItem.top - DRAGICON_HOTSPOT_Y; rcDragIcon.right = rcListBox.left; rcDragIcon.bottom = rcDragIcon.top + DRAGICON_HEIGHT; if (!GetWindowSubclass(hwndLB, DragList_SubclassWindowProc, DRAGLIST_SUBCLASSID, (DWORD_PTR*)&data)) return; if (nItem < 0) SetRectEmpty(&rcDragIcon); /* prevent flicker by only redrawing when necessary */ if (!EqualRect(&rcDragIcon, &data->last_drag_icon_rect)) { /* get rid of any previous inserts drawn */ RedrawWindow(hwndParent, &data->last_drag_icon_rect, NULL, RDW_INTERNALPAINT | RDW_ERASE | RDW_INVALIDATE | RDW_UPDATENOW); CopyRect(&data->last_drag_icon_rect, &rcDragIcon); if (nItem >= 0) { hdc = GetDC(hwndParent); DrawIcon(hdc, rcDragIcon.left, rcDragIcon.top, hDragArrow); ReleaseDC(hwndParent, hdc); } } }
//工具栏从停靠行脱离,调用本函数须确保dockbar有效 int RingDockSite::BarOutLine(RingDockBar* dockbar,BOOL bCalcSize,LPRINGBARLINEINFO& line) { int nMax=0,nExtra=0; RingDockBar* bar = dockbar->m_lineInfo->m_first; if(bCalcSize) { //计算除要删除的工具栏外行的总高/宽度 while(bar) { if(bar != dockbar) { if(bar->IsVisible()) nMax = max(nMax,bar->m_nSize); } bar = bar->m_next; } } else nMax = dockbar->m_lineInfo->m_maxSize; line = dockbar->m_lineInfo; //连接前后工具栏 if(dockbar->m_next) dockbar->m_next->m_prev = dockbar->m_prev; if(dockbar->m_prev) dockbar->m_prev->m_next = dockbar->m_next; else line->m_first = dockbar->m_next; //设置行的总高/宽度 line->m_maxSize = nMax; if(dockbar->IsSizeBar()) { line->m_nSizeBarCnt --; if(line->m_nSizeBarCnt == 0) { nExtra = m_SplitterSize; //已无SizeBar,清空调整线信息 if(line->m_SplitRc.right != 0) SetRectEmpty(&line->m_SplitRc); } } //清空工具栏连接信息 dockbar->m_lineInfo = NULL; dockbar->m_prev = dockbar->m_next = NULL; if(line->m_first == NULL) //行内没有工具栏了,返回NULL line = NULL; if(line && nMax == 0) //其他工具栏是隐藏的 line->isVisible = FALSE; return min(0,nMax - dockbar->m_nSize - nExtra); }
// See Directshow help topic for IAMStreamConfig for details on this method HRESULT CVCamStream::GetMediaType(int iPosition, CMediaType *pmt) { if (iPosition < 0) return E_INVALIDARG; if (iPosition > 8) return VFW_S_NO_MORE_ITEMS; if (iPosition == 0) { *pmt = m_mt; return S_OK; } // TODO: the pvi is mostly duplicated from GetStreamCaps DECLARE_PTR(VIDEOINFOHEADER, pvi, pmt->AllocFormatBuffer(sizeof(VIDEOINFOHEADER))); ZeroMemory(pvi, sizeof(VIDEOINFOHEADER)); pvi->bmiHeader.biCompression = BI_RGB; pvi->bmiHeader.biBitCount = 24; pvi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); pvi->bmiHeader.biWidth = 80 * iPosition; pvi->bmiHeader.biHeight = 60 * iPosition; pvi->bmiHeader.biPlanes = 1; pvi->bmiHeader.biSizeImage = GetBitmapSize(&pvi->bmiHeader); pvi->bmiHeader.biClrImportant = 0; pvi->AvgTimePerFrame = 1000000; SetRectEmpty(&(pvi->rcSource)); // we want the whole image area rendered. SetRectEmpty(&(pvi->rcTarget)); // no particular destination rectangle pmt->SetType(&MEDIATYPE_Video); pmt->SetFormatType(&FORMAT_VideoInfo); pmt->SetTemporalCompression(TRUE); // Work out the GUID for the subtype from the header info. /*const GUID SubTypeGUID = GetBitmapSubtype(&pvi->bmiHeader); pmt->SetSubtype(&SubTypeGUID);*/ pmt->SetSubtype(&MEDIASUBTYPE_H264); pmt->SetSampleSize(pvi->bmiHeader.biSizeImage); return NOERROR; } // GetMediaType
HRESULT CPushPinBitmapSet::GetMediaType(CMediaType *pMediaType) { CAutoLock cAutoLock(m_pFilter->pStateLock()); CheckPointer(pMediaType, E_POINTER); // If the bitmap files were not loaded, just fail here. if (!m_bFilesLoaded) return E_FAIL; // Allocate enough room for the VIDEOINFOHEADER and the color tables VIDEOINFOHEADER *pvi = (VIDEOINFOHEADER*)pMediaType->AllocFormatBuffer(SIZE_PREHEADER + m_cbBitmapInfo[m_iCurrentBitmap]); if (pvi == 0) return(E_OUTOFMEMORY); // Initialize the video info header ZeroMemory(pvi, pMediaType->cbFormat); pvi->AvgTimePerFrame = m_rtFrameLength; // Copy the header info from the current bitmap memcpy(&(pvi->bmiHeader), m_pBmi[m_iCurrentBitmap], m_cbBitmapInfo[m_iCurrentBitmap]); // Set image size for use in FillBuffer pvi->bmiHeader.biSizeImage = GetBitmapSize(&pvi->bmiHeader); // Clear source and target rectangles SetRectEmpty(&(pvi->rcSource)); // we want the whole image area rendered SetRectEmpty(&(pvi->rcTarget)); // no particular destination rectangle pMediaType->SetType(&MEDIATYPE_Video); pMediaType->SetFormatType(&FORMAT_VideoInfo); pMediaType->SetTemporalCompression(FALSE); // Work out the GUID for the subtype from the header info. const GUID SubTypeGUID = GetBitmapSubtype(&pvi->bmiHeader); pMediaType->SetSubtype(&SubTypeGUID); pMediaType->SetSampleSize(pvi->bmiHeader.biSizeImage); return S_OK; }
HRESULT CTMReceiverOutputPin::GetMediaType(int iPosition, CMediaType *pmt){ CheckPointer(pmt,E_POINTER); CAutoLock cAutoLock(m_pFilter->pStateLock()); if(iPosition < 0) { return E_INVALIDARG; } if(iPosition > 0) { return VFW_S_NO_MORE_ITEMS; } VIDEOINFO* pvih = (VIDEOINFO*)pmt->AllocFormatBuffer(sizeof(VIDEOINFO)); LPBITMAPINFOHEADER lpBitmapInfoHeader = &(pvih->bmiHeader); lpBitmapInfoHeader->biSize = sizeof(BITMAPINFOHEADER); lpBitmapInfoHeader->biBitCount = 32; lpBitmapInfoHeader->biWidth = ((CTMReceiverSrc *)m_pFilter)->GetImageWidth()/4*4; lpBitmapInfoHeader->biHeight = ((CTMReceiverSrc *)m_pFilter)->GetImageHeight(); lpBitmapInfoHeader->biPlanes = 1; lpBitmapInfoHeader->biCompression = BI_RGB; lpBitmapInfoHeader->biSizeImage = ((CTMReceiverSrc *)m_pFilter)->GetImageWidth() / 4 * 4 * ((CTMReceiverSrc *)m_pFilter)->GetImageHeight() * 4; lpBitmapInfoHeader->biXPelsPerMeter = 0; lpBitmapInfoHeader->biYPelsPerMeter =0; lpBitmapInfoHeader->biClrUsed = 0; lpBitmapInfoHeader->biClrImportant = 0; pvih->AvgTimePerFrame = m_rtAvgTimePerFrame; pmt->SetFormatType(&FORMAT_VideoInfo); pmt->SetTemporalCompression(FALSE); SetRectEmpty(&(pvih->rcSource)); // we want the whole image area rendered. SetRectEmpty(&(pvih->rcTarget)); // no particular destination rectangle pmt->SetType(&MEDIATYPE_Video); // Work out the GUID for the subtype from the header info. const GUID SubTypeGUID = GetBitmapSubtype(&pvih->bmiHeader); pmt->SetSubtype(&SubTypeGUID); pmt->SetSampleSize(pvih->bmiHeader.biSizeImage); return S_OK; }
// ============================================================================ // // GetMenuItemRect() // // ============================================================================ BOOL xxxGetMenuItemRect(PWND pwnd, PMENU pMenu, UINT uIndex, LPRECT lprcScreen) { PITEM pItem; int dx, dy; CheckLock(pwnd); CheckLock(pMenu); SetRectEmpty(lprcScreen); if (uIndex >= pMenu->cItems) return(FALSE); /* * Raid #315084: Compatiblity with NT4/Win95/98 * * WordPerfect does a long complex way to calc the menu rect * by calling this API. It calls GetMenuItemRect() with the app's * window. */ if (pwnd == NULL || TestWF(pwnd, WFWIN50COMPAT)) { pwnd = GetMenuPwnd(pwnd, pMenu); } /* * If no pwnd, no go. * IMPORTANT: for MFISPOPUP we might get a different pwnd but we don't lock * it because we won't call back */ if (pwnd == NULL) { return FALSE; } if (TestMF(pMenu, MFISPOPUP)) { dx = pwnd->rcClient.left; dy = pwnd->rcClient.top; } else { xxxMNRecomputeBarIfNeeded(pwnd, pMenu); dx = pwnd->rcWindow.left; dy = pwnd->rcWindow.top; } if (uIndex >= pMenu->cItems) return(FALSE); pItem = pMenu->rgItems + uIndex; lprcScreen->right = pItem->cxItem; lprcScreen->bottom = pItem->cyItem; OffsetRect(lprcScreen, dx + pItem->xItem, dy + pItem->yItem); return(TRUE); }
CDelayRepaint::CDelayRepaint( CEdit *pCtrl ) { ASSERT( pCtrl ); m_pCtrl = pCtrl; ASSERT( m_pCtrl->m_nDelayPaint >= 0 ); if ( ++m_pCtrl->m_nDelayPaint == 1 ) { m_pCtrl->m_Selection.HideCaret(); SetRectEmpty( &m_pCtrl->m_rcDelayPaint ); } }
void CListViewNode::_init(int ix, bool before) { _calcTextDisplayLength(); m_selected = false; m_focused = false; m_editable = false; SetRectEmpty(&m_iconRect); SetRectEmpty(&m_textRect); SetRectEmpty(&m_borderRect); m_imageIndex = -1; if ( m_listView ) { m_editable = m_listView->is_Editable(); if ( ix < 0 ) m_listView->set_Node(m_listView->get_NodeCount(), this); else m_listView->ins_Node(ix, this, before); m_listView->Update(TRUE); } }
CEditView::CEditView( CEdit *pCtrl, CBuffer *pBuffer, int nLeftIndex, int nTopIndex ) { m_pCtrl = pCtrl; m_hWndView = pCtrl->GetWindow(); m_pBuffer = pBuffer; SetRectEmpty( &m_rcAll ); SetRectEmpty( &m_rcView ); m_hWndHScroll = m_hWndVScroll = NULL; m_nBottomIndex = m_nRightIndex = m_nBottomIndexFullyVisible = m_nRightIndexFullyVisible = 0; m_nLeftIndex = nLeftIndex; m_nTopIndex = nTopIndex; m_nLineDamageStart = MAXROW; m_nLineDamageEnd = -1; m_nEditLevel = 0; if ( !m_bInit ) { CharFill( m_szSpace, _T(' '), CBuffer::MAX_TABSIZE ); m_bInit = TRUE; } OnFontChanged( pCtrl->GetFont( FALSE ), pCtrl->GetCharWidth() ); }
BOOL CSkinBase::DoSysMenu(HWND hWnd, CPoint ptCursor, LPRECT prExclude, BOOL bCopy) { HMENU hMenu = GetSystemMenu(hWnd, FALSE); ASSERT ( hMenu ); if ( hMenu ) { TPMPARAMS tpmp; tpmp.cbSize = sizeof(tpmp); if (prExclude) tpmp.rcExclude = *prExclude; else SetRectEmpty(&tpmp.rcExclude); UINT uAlignFlags = TPM_LEFTALIGN | TPM_TOPALIGN | TPM_VERTICAL | TPM_RIGHTBUTTON | TPM_RETURNCMD; UINT uID = 0; if (bCopy) // skinning { HMENU hSysMenu = CSkinBase::MakeMenuCopy(hMenu); ASSERT (hSysMenu); if (hSysMenu) { InitSysMenu( hSysMenu, pWnd ); uID = ::TrackPopupMenuEx(hSysMenu, uAlignFlags, ptCursor.x, ptCursor.y, hWnd, &tpmp); ::DestroyMenu(hSysMenu); // cleanup } } else { InitSysMenu(hMenu, hWnd); uID = ::TrackPopupMenuEx(hMenu, uAlignFlags, ptCursor.x, ptCursor.y, hWnd, &tpmp); } if (uID & 0xf000) // syscommand { //MSG& curMsg = AfxGetThreadState()->m_lastSentMsg; // always post this command to allow this function to unwind // correctly before the command is handled //pWnd->PostMessage(WM_SYSCOMMAND, (uID & 0xfff0), MAKELPARAM(curMsg.pt.x, curMsg.pt.y)); PostMessage(hWnd, WM_SYSCOMMAND, (uID & 0xfff0), MAKELPARAM(ptCursor.x, ptCursor.y)); } } return TRUE; }
// Setup the device context for drawing void cef_dark_aero_window::InitDeviceContext(HDC hdc) { if (CanUseAeroGlass()) { RECT rectClipClient; SetRectEmpty(&rectClipClient); GetRealClientRect(&rectClipClient); // exclude the client area to reduce flicker ::ExcludeClipRect(hdc, rectClipClient.left, rectClipClient.top, rectClipClient.right, rectClipClient.bottom); } else { cef_dark_window::InitDeviceContext(hdc); } }
void KGUIWin32Wnd::InitDraw_Internal() { RECT rcTemp; ::GetWindowRect(m_hWnd, &rcTemp); m_RcWnd = rcTemp; OffsetRect(&m_RcWnd, -m_RcWnd.left, -m_RcWnd.top); SetRectEmpty(&m_RcMin); SetRectEmpty(&m_RcMax); SetRectEmpty(&m_RcClose); m_RcClose = m_RcWnd; m_RcClose.right -= KUDEET_SYS_BUTTON_RIGHT; m_RcClose.left = m_RcClose.right - KUDEET_SYS_BUTTON_SIZE; m_RcClose.top = KUDEET_TITLE_SIZE / 2 - KUDEET_SYS_BUTTON_SIZE / 2; m_RcClose.bottom = m_RcClose.top + KUDEET_SYS_BUTTON_SIZE; if (m_bCanMin) { m_RcMin = m_RcClose; m_RcMin.right = m_RcMin.left - KUDEET_SYS_BUTTON_SPACE; m_RcMin.left = m_RcMin.right - KUDEET_SYS_BUTTON_SIZE; } }
WINMON_API BOOL Winmon_DeskWndPainted(RECT *dskRt) { BOOL ret = dskWndPainted; dskWndPainted = FALSE; if (dskRt != NULL) { WaitForSingleObject(hSem, INFINITE); CopyRect(dskRt, &dskWndPaintedRect); SetRectEmpty(&dskWndPaintedRect); ReleaseSemaphore(hSem, 1, NULL); } return ret; }
void CEqualizerWnd::DrawButton(HDC _hDC) { TString _tempstr; // RECT _oPoint; if(m_MainWnd3) { SetRectEmpty(&m_rtOK); m_MainWnd3->m_Skincfg.FindConfig((TString)L"ÉèÖÃ_È·¶¨_λÖÃ",_tempstr); CovertStr2Rect(_tempstr,&m_rtOK); m_MainWnd3->m_Skincfg.FindConfig((TString)L"ÉèÖÃ_È·¶¨_Õý³£",_tempstr); _tempstr = (TString)(m_MainWnd3->m_szUIBasePath) + _tempstr; DrawPngFromFile(_hDC,_tempstr.c_str(),&m_rtOK,RGB(0,0,0)); SetRectEmpty(&m_rtCancel); m_MainWnd3->m_Skincfg.FindConfig((TString)L"ÉèÖÃ_È¡Ïû_λÖÃ",_tempstr); CovertStr2Rect(_tempstr,&m_rtCancel); m_MainWnd3->m_Skincfg.FindConfig((TString)L"ÉèÖÃ_È¡Ïû_Õý³£",_tempstr); _tempstr = (TString)(m_MainWnd3->m_szUIBasePath) + _tempstr; DrawPngFromFile(_hDC,_tempstr.c_str(),&m_rtCancel,RGB(0,0,0)); } }
int CommonInit( vout_thread_t *p_vout ) { vout_sys_t *p_sys = p_vout->p_sys; p_sys->hwnd = NULL; p_sys->hvideownd = NULL; p_sys->hparent = NULL; p_sys->hfswnd = NULL; p_sys->i_changes = 0; SetRectEmpty( &p_sys->rect_display ); SetRectEmpty( &p_sys->rect_parent ); vlc_mutex_init( &p_sys->lock ); var_Create( p_vout, "video-title", VLC_VAR_STRING | VLC_VAR_DOINHERIT ); /* Set main window's size */ p_sys->i_window_width = p_vout->i_window_width; p_sys->i_window_height = p_vout->i_window_height; p_sys->p_event = EventThreadCreate( p_vout ); if( !p_sys->p_event ) return VLC_EGENERIC; if( EventThreadStart( p_sys->p_event ) ) return VLC_EGENERIC; /* Variable to indicate if the window should be on top of others */ /* Trigger a callback right now */ var_TriggerCallback( p_vout, "video-on-top" ); /* Why not with glwin32 */ #if !defined(UNDER_CE) && !defined(MODULE_NAME_IS_glwin32) var_Create( p_vout, "disable-screensaver", VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); DisableScreensaver ( p_vout ); #endif return VLC_SUCCESS; }
static void test_margin(void) { RECT r, r1; HWND hwnd; DWORD ret; hwnd = CreateWindowExA(0, TOOLTIPS_CLASSA, NULL, 0, 10, 10, 300, 100, NULL, NULL, NULL, 0); ok(hwnd != NULL, "failed to create tooltip wnd\n"); ret = SendMessageA(hwnd, TTM_SETMARGIN, 0, 0); ok(!ret, "got %d\n", ret); SetRect(&r, -1, -1, 1, 1); ret = SendMessageA(hwnd, TTM_SETMARGIN, 0, (LPARAM)&r); ok(!ret, "got %d\n", ret); SetRectEmpty(&r1); ret = SendMessageA(hwnd, TTM_GETMARGIN, 0, (LPARAM)&r1); ok(!ret, "got %d\n", ret); ok(EqualRect(&r, &r1), "got %s, was %s\n", wine_dbgstr_rect(&r1), wine_dbgstr_rect(&r)); ret = SendMessageA(hwnd, TTM_SETMARGIN, 0, 0); ok(!ret, "got %d\n", ret); SetRectEmpty(&r1); ret = SendMessageA(hwnd, TTM_GETMARGIN, 0, (LPARAM)&r1); ok(!ret, "got %d\n", ret); ok(EqualRect(&r, &r1), "got %s, was %s\n", wine_dbgstr_rect(&r1), wine_dbgstr_rect(&r)); ret = SendMessageA(hwnd, TTM_GETMARGIN, 0, 0); ok(!ret, "got %d\n", ret); DestroyWindow(hwnd); }
CCEGLView::CCEGLView() : m_bCaptured(false) , m_bOrientationInitVertical(false) , m_bOrientationReverted(false) , m_pDelegate(NULL) , m_pEGL(NULL) , m_hWnd(NULL) , m_eInitOrientation(CCDeviceOrientationPortrait) , m_fScreenScaleFactor(1.0f) { m_pTouch = new CCTouch; m_pSet = new CCSet; m_tSizeInPoints.cx = m_tSizeInPoints.cy = 0; SetRectEmpty(&m_rcViewPort); }
BOOL GetGameBoardRect(HWND &hwnd, RECT *pRect) { RECT rc; if (GetClientRect(hwnd, &rc)) { pRect->left = ((rc.right - rc.left) - CELL_SIZE * 3) / 2; pRect->top = ((rc.bottom - rc.top) - CELL_SIZE * 3) / 2; pRect->right = pRect->left + CELL_SIZE * 3; pRect->bottom = pRect->top + CELL_SIZE * 3; return TRUE; } SetRectEmpty(pRect); return FALSE; }
BOOL WRectangle::IntersectRect( LPCRECT lpRect1, LPCRECT lpRect2 ) { int x1 = max(lpRect1->left, lpRect2->left); int x2 = min(lpRect1->right, lpRect2->right); int y1 = max(lpRect1->top, lpRect2->top); int y2 = min(lpRect1->bottom, lpRect2->bottom); if (x2 >= x1 && y2 >= y1) { SetRect(x1,x2,y1,y2); } SetRectEmpty(); return false; }
void GUIAPI EmptyClipRgn (PCLIPRGN pRgn) { PCLIPRECT pCRect, pTemp; pCRect = pRgn->head; while (pCRect) { pTemp = pCRect->next; FreeClipRect (pRgn->heap, pCRect); pCRect = pTemp; } SetRectEmpty (&pRgn->rcBound); pRgn->head = NULL; pRgn->tail = NULL; }
/************************** clip region operation ****************************/ static void EvaluateBoundRect (PCLIPRGN pRgn) { PCLIPRECT pCRect, pTemp; pCRect = pRgn->head; if (pCRect == NULL) { SetRectEmpty (&pRgn->rcBound); return; } pRgn->rcBound = pCRect->rc; pCRect = pCRect->next; while (pCRect) { if(pRgn->rcBound.left > pCRect->rc.left) pRgn->rcBound.left = pCRect->rc.left; if(pRgn->rcBound.top > pCRect->rc.top) pRgn->rcBound.top = pCRect->rc.top; if(pRgn->rcBound.right < pCRect->rc.right) pRgn->rcBound.right = pCRect->rc.right; if(pRgn->rcBound.bottom < pCRect->rc.bottom) pRgn->rcBound.bottom = pCRect->rc.bottom; pCRect = pCRect->next; } // Remove empty clip rects. pCRect = pRgn->head; while (pCRect->next) { if (IsRectEmpty (&pCRect->next->rc)) { pTemp = pCRect->next; pCRect->next = pTemp->next; FreeClipRect (pRgn->heap, pTemp); } else pCRect = pCRect->next; } pRgn->tail = pCRect; if (IsRectEmpty (&pRgn->head->rc)) { pTemp = pRgn->head; pRgn->head = pTemp->next; FreeClipRect (pRgn->heap, pTemp); } }
/* * Rectangle-related functions * * Copyright 1993, 1996 Alexandre Julliard * */ BOOL WINAPI IntersectRect( LPRECT dest, const RECT *src1, const RECT *src2 ) { if (IsRectEmpty(src1) || IsRectEmpty(src2) || (src1->left >= src2->right) || (src2->left >= src1->right) || (src1->top >= src2->bottom) || (src2->top >= src1->bottom)) { SetRectEmpty( dest ); return FALSE; } dest->left = MWMAX( src1->left, src2->left ); dest->right = MWMIN( src1->right, src2->right ); dest->top = MWMAX( src1->top, src2->top ); dest->bottom = MWMIN( src1->bottom, src2->bottom ); return TRUE; }
CAdInventoryBox::CAdInventoryBox(CBGame* inGame):CBObject(inGame) { SetRectEmpty(&m_ItemsArea); m_ScrollOffset = 0; m_Spacing = 0; m_ItemWidth = m_ItemHeight = 50; m_ScrollBy = 1; m_Window = NULL; m_CloseButton = NULL; m_HideSelected = false; m_Visible = false; m_Exclusive = false; }
void _dx_FontRect(ID3DX10Font* pFont,ID3DX10Sprite* pSprite, RECT* rect, float x, float y, LPCWSTR text) { SetRectEmpty(rect); // Get the rectangle dimension pFont->DrawText(pSprite,text,-1,rect,DT_CALCRECT, SW_BLACK); // Apply the x/y if supplied if (x > 0) { rect->left += (LONG)x; rect->right += (LONG)x; } if (y > 0) { rect->top += (LONG)y; rect->bottom += (LONG)y; } }
BOOL CBPlatform::IntersectRect(LPRECT lprcDst, CONST LPRECT lprcSrc1, CONST LPRECT lprcSrc2) { if (IsRectEmpty(lprcSrc1) || IsRectEmpty(lprcSrc2) || lprcSrc1->left >= lprcSrc2->right || lprcSrc2->left >= lprcSrc1->right || lprcSrc1->top >= lprcSrc2->bottom || lprcSrc2->top >= lprcSrc1->bottom) { SetRectEmpty(lprcDst); return FALSE; } lprcDst->left = max(lprcSrc1->left, lprcSrc2->left); lprcDst->right = min(lprcSrc1->right, lprcSrc2->right); lprcDst->top = max(lprcSrc1->top, lprcSrc2->top); lprcDst->bottom = min(lprcSrc1->bottom, lprcSrc2->bottom); return TRUE; }
CPartEmitter::CPartEmitter(CBGame* inGame, CBScriptHolder* Owner) : CBObject(inGame) { m_Width = m_Height = 0; SetRectEmpty(&m_Border); m_BorderThicknessLeft = m_BorderThicknessRight = m_BorderThicknessTop = m_BorderThicknessBottom = 0; m_Angle1 = m_Angle2 = 0; m_Velocity1 = m_Velocity2 = 0.0f; m_VelocityZBased = false; m_Scale1 = m_Scale2 = 100.0f; m_ScaleZBased = false; m_MaxParticles = 100; m_LifeTime1 = m_LifeTime2 = 1000; m_LifeTimeZBased = false; m_LastGenTime = 0; m_GenInterval = 0; m_GenAmount = 1; m_OverheadTime = 0; m_Running = false; m_MaxBatches = 0; m_BatchesGenerated = 0; m_FadeInTime = m_FadeOutTime = 0; m_Alpha1 = m_Alpha2 = 255; m_AlphaTimeBased = false; m_Rotation1 = m_Rotation2 = 0.0f; m_AngVelocity1 = m_AngVelocity2 = 0.0f; m_GrowthRate1 = m_GrowthRate2 = 0.0f; m_ExponentialGrowth = false; m_UseRegion = false; m_EmitEvent = NULL; m_Owner = Owner; }