本文整理汇总了C++中BRect::IntegerHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ BRect::IntegerHeight方法的具体用法?C++ BRect::IntegerHeight怎么用?C++ BRect::IntegerHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BRect
的用法示例。
在下文中一共展示了BRect::IntegerHeight方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool
Scaler::Matches(BRect rect, bool dither) const
{
return fRect.IntegerWidth() == rect.IntegerWidth() &&
fRect.IntegerHeight() == rect.IntegerHeight() &&
fDither == dither;
}
示例2: BGLRenderer
SoftPipeRenderer::SoftPipeRenderer(BGLView *view, ulong options,
BGLDispatcher* dispatcher)
: BGLRenderer(view, options, dispatcher),
fBitmap(NULL),
fDirectModeEnabled(false),
fInfo(NULL),
fInfoLocker("info locker"),
fOptions(options),
fColorSpace(B_NO_COLOR_SPACE)
{
CALLED();
time_t beg, end;
beg = time(NULL);
hsp_init(options);
end = time(NULL);
TRACE("hsp_init time: %f.\n", difftime(end, beg));
BRect b = GLView()->Bounds();
fColorSpace = B_RGBA32;
if (fDirectModeEnabled && fInfo != NULL) {
fColorSpace = BScreen(GLView()->Window()).ColorSpace();
}
int32 width = b.IntegerWidth();// + 1;
int32 height = b.IntegerHeight();// + 1;
TRACE("ColorSpace:\t%s\n", color_space_name(fColorSpace));
fBitmap = new BBitmap(BRect(0.f, 0.f, width /*- 1*/, height /*- 1*/), fColorSpace);
fWidth = width;
fHeight = height;
beg = time(NULL);
fContext = hsp_create_layer_context(fBitmap, 0);
TRACE("context:\t%d\n", (int)fContext);
end = time(NULL);
TRACE("hsp_create_layer_context time: %f.\n", difftime(end, beg));
if (!hsp_get_current_context())
LockGL();
}
示例3: p
// ToolDraw
void
PickManipulator::ToolDraw(BView* into, BRect itemFrame)
{
if (itemFrame.IntegerWidth() < 4)
return;
itemFrame.InsetBy(1, 1);
int32 dotCount = itemFrame.IntegerHeight() / 3;
BPoint p(itemFrame.LeftTop());
for (int32 i = 0; i < dotCount; i++) {
into->SetHighColor(0, 0, 0, 75);
into->StrokeLine(p, p);
p = p + BPoint(1, 1);
into->SetHighColor(255, 255, 255, 200);
into->StrokeLine(p, p);
p = p + BPoint(-1, 2);
}
itemFrame.right--;
if (itemFrame.IntegerWidth() < 6)
return;
p = itemFrame.RightTop();
for (int32 i = 0; i < dotCount; i++) {
into->SetHighColor(0, 0, 0, 75);
into->StrokeLine(p, p);
p = p + BPoint(1, 1);
into->SetHighColor(255, 255, 255, 200);
into->StrokeLine(p, p);
p = p + BPoint(-1, 2);
}
}
示例4: node
void
ShowImageWindow::_SaveWidthAndHeight()
{
if (fNavigator.CurrentPage() != 1)
return;
if (fImageView->Bitmap() == NULL)
return;
BRect bounds = fImageView->Bitmap()->Bounds();
int32 width = bounds.IntegerWidth() + 1;
int32 height = bounds.IntegerHeight() + 1;
BNode node(&fNavigator.CurrentRef());
if (node.InitCheck() != B_OK)
return;
const char* kWidthAttrName = "Media:Width";
const char* kHeightAttrName = "Media:Height";
int32 widthAttr;
ssize_t attrSize = node.ReadAttr(kWidthAttrName, B_INT32_TYPE, 0,
&widthAttr, sizeof(widthAttr));
if (attrSize <= 0 || widthAttr != width)
node.WriteAttr(kWidthAttrName, B_INT32_TYPE, 0, &width, sizeof(width));
int32 heightAttr;
attrSize = node.ReadAttr(kHeightAttrName, B_INT32_TYPE, 0,
&heightAttr, sizeof(heightAttr));
if (attrSize <= 0 || heightAttr != height)
node.WriteAttr(kHeightAttrName, B_INT32_TYPE, 0, &height, sizeof(height));
}
示例5: PPSize
PPSize
DisplayDevice_Haiku::getDisplayResolution() const
{
BScreen screen;
BRect frame = screen.Frame();
return PPSize(frame.IntegerWidth(), frame.IntegerHeight());
}
示例6: get_screen_size
Size2 OS_Haiku::get_screen_size(int p_screen) const {
// TODO: make this work with the p_screen parameter
BScreen *screen = new BScreen(window);
BRect frame = screen->Frame();
delete screen;
return Size2i(frame.IntegerWidth() + 1, frame.IntegerHeight() + 1);
}
示例7:
// FrameResized
void
ColorField::FrameResized(float width, float height)
{
BRect r = _BitmapRect();
_AllocBitmap(r.IntegerWidth() + 1, r.IntegerHeight() + 1);
Invalidate();
}
示例8: GetBufferSize
void MesaDriver::GetBufferSize(GLframebuffer * framebuffer, GLuint *width,
GLuint *height)
{
GET_CURRENT_CONTEXT(ctx);
if (!ctx)
return;
MesaDriver * md = (MesaDriver *) ctx->DriverCtx;
BGLView *bglview = md->m_bglview;
assert(bglview);
BRect b = bglview->Bounds();
*width = (GLuint) b.IntegerWidth() + 1; // (b.right - b.left + 1);
*height = (GLuint) b.IntegerHeight() + 1; // (b.bottom - b.top + 1);
md->m_bottom = (GLint) b.bottom;
if (ctx->Visual.doubleBufferMode) {
if (*width != md->m_width || *height != md->m_height) {
// allocate new size of back buffer bitmap
if (md->m_bitmap)
delete md->m_bitmap;
BRect rect(0.0, 0.0, *width - 1, *height - 1);
md->m_bitmap = new BBitmap(rect, B_RGBA32);
}
}
else
{
md->m_bitmap = NULL;
}
md->m_width = *width;
md->m_height = *height;
}
示例9:
/* virtual */
void
HeaderListItem::DrawItem(BView *owner, BRect itemRect, bool drawEverthing)
{
owner->SetDrawingMode(B_OP_COPY);
owner->PushState();
if (IsSelected()) {
rgb_color lowColor = owner->LowColor();
owner->SetHighColor(tint_color(lowColor, B_DARKEN_2_TINT));
owner->FillRect(itemRect);
}
owner->PopState();
itemRect.InsetBy(0, 1);
owner->StrokeRect(itemRect);
itemRect.InsetBy(1, 0);
owner->SetDrawingMode(B_OP_OVER);
BFont font;
owner->GetFont(&font);
float baseLine = itemRect.top + (itemRect.IntegerHeight() / 2 + font.Size() / 2);
for (int32 c = 0; c < sizeof(fLabels) / sizeof(fLabels[0]); c++) {
owner->MovePenTo(itemRect.left + 1 + (fRect.Width() + kDistance) * c, baseLine);
owner->DrawString(fLabels[c]);
}
}
示例10: rect
/*! \brief Returns the frame of the specified workspace within the
workspaces view.
*/
BRect
WorkspacesView::_WorkspaceAt(int32 i)
{
int32 columns, rows;
_GetGrid(columns, rows);
BRect frame = Bounds();
ConvertToScreen(&frame);
int32 width = frame.IntegerWidth() / columns;
int32 height = frame.IntegerHeight() / rows;
int32 column = i % columns;
int32 row = i / columns;
BRect rect(column * width, row * height, (column + 1) * width,
(row + 1) * height);
rect.OffsetBy(frame.LeftTop());
// make sure there is no gap anywhere
if (column == columns - 1)
rect.right = frame.right;
if (row == rows - 1)
rect.bottom = frame.bottom;
return rect;
}
示例11: sizeof
ViewBuffer::ViewBuffer(BRect frame)
: BView(frame, "ViewBuffer", B_FOLLOW_ALL, B_WILL_DRAW | B_FRAME_EVENTS),
fColumns(frame.IntegerWidth() / CHAR_WIDTH),
fRows(frame.IntegerHeight() / CHAR_HEIGHT),
fGlyphGrid(NULL),
fResizeCallback(NULL),
// initially, the cursor is hidden
fCursorX(-1),
fCursorY(-1)
{
SetFont(be_fixed_font);
// initialize private palette
for (int i = 0; i < 8; i++) {
fPalette[i].red = (sPalette32[i] >> 16) & 0xff;
fPalette[i].green = (sPalette32[i] >> 8) & 0xff;
fPalette[i].blue = (sPalette32[i] >> 0) & 0xff;
fPalette[i].alpha = 0xff;
}
// initialize glyph grid
uint32 size = fRows * fColumns;
if (size > 0) {
fGlyphGrid = new uint16[size];
memset(fGlyphGrid, 0, size * sizeof(uint16));
}
}
示例12: r
static void testSetOriginAndScale4(BView *view, BRect frame)
{
frame.InsetBy(2, 2);
BPoint center = centerPoint(frame);
BRect r(0, 0, frame.IntegerWidth() / 2, frame.IntegerHeight() / 2);
view->SetOrigin(center);
view->FillRect(r);
view->SetScale(0.5);
view->SetHighColor(kRed);
view->FillRect(r);
view->PushState();
//
view->SetOrigin(center.x+1, center.y);
// +1 to work around BeOS bug
// where setting the origin has no
// effect if it is the same as
// the previous value althou
// it is from the "outer" coordinate
// system
view->SetHighColor(kGreen);
view->FillRect(r);
view->PopState();
}
示例13: screen
/*****************************************************************************
* VideoWindow::SetFullScreen
*****************************************************************************/
void
VideoWindow::SetFullScreen(bool doIt)
{
if (doIt)
{
SetLook( B_NO_BORDER_WINDOW_LOOK );
BScreen screen( this );
BRect rect = screen.Frame();
Activate();
MoveTo(0.0, 0.0);
ResizeTo(rect.IntegerWidth(), rect.IntegerHeight());
be_app->ObscureCursor();
fInterfaceShowing = false;
fSettings->AddFlags(VideoSettings::FLAG_FULL_SCREEN);
}
else
{
SetLook( B_TITLED_WINDOW_LOOK );
MoveTo(winSize.left, winSize.top);
ResizeTo(winSize.IntegerWidth(), winSize.IntegerHeight());
be_app->ShowCursor();
fInterfaceShowing = true;
fSettings->ClearFlags(VideoSettings::FLAG_FULL_SCREEN);
}
}
示例14: DoGetSize
// Get total size
void wxWindowBeOS::DoGetSize(int *x, int *y) const
{
if (m_view)
{
BRect bounds = m_view->bounds();
*x = bounds.IntegerWidth();
*y = bounds.IntegerHeight();
}
}
示例15:
// FrameResized
void
AlphaSlider::FrameResized(float width, float height)
{
BRect r = _BitmapRect();
_AllocBitmap(r.IntegerWidth() + 1, r.IntegerHeight() + 1);
_UpdateColors();
Invalidate();
}