Пример #1
0
void
BIconButton::_Update()
{
	if (LockLooper()) {
		Invalidate();
		UnlockLooper();
	}
}
void NavigatorEditor::SetShortCutFilter(ShortCutFilter *_shortCutFilter)
{
	if (LockLooper())
	{
		AddFilter(_shortCutFilter);
		UnlockLooper();
	}
}
Пример #3
0
void
VideoView::RemoveOverlay()
{
	printf("VideoView::RemoveOverlay\n");
	if (LockLooperWithTimeout(50000) == B_OK) {
		ClearViewOverlay();
		fOverlayActive = false;
		UnlockLooper();
	}
}
Пример #4
0
void TextScrollerView::AddEmptyLine()
{
	if (LockLooper()) {
		text_view->Insert("\n");
		UnlockLooper();
	}
	else {
		text_view->Insert("\n");
	}
}
Пример #5
0
void FontDrawView::Draw(BRect r)
{
	if (LockLooper() )
  	{
		FillRect(Bounds(),B_SOLID_LOW);
  		CheckStringPlacement();
		DrawString(text,fontlocation);
		UnlockLooper();
 	}
}
Пример #6
0
void
TransportControlGroup::SetMuted(bool mute)
{
	if (!LockLooper())
		return;

	fVolumeSlider->SetMuted(mute);

	UnlockLooper();
}
Пример #7
0
void 
FBView::Paint()
{
  if(LockLooper())	{
 	 bufferView->LockLooper();
 	 SetDrawingMode(B_OP_COPY);
	 DrawBitmap(bufferBitmap,bufferView->Bounds(),Bounds());
	 bufferView->UnlockLooper();
	 UnlockLooper();
	}
}
Пример #8
0
// SetEnabled
void
PopupSlider::SetEnabled(bool enable)
{
	if (enable != fEnabled) {
		fEnabled = enable;
		if (LockLooper()) {
			Invalidate();
			UnlockLooper();
		}
	}
}
Пример #9
0
 void SetBuffer(void *buf, int32 width, int32 height)
 {
     _buf = buf;
     _width = width;
     _height = height;
     LockLooper();
     ResizeTo(width-1,height-1);
     UnlockLooper();
     delete _bitmap; _bitmap = NULL;
     _bitmap = new BBitmap(BRect(0,0,_width-1, _height-1), B_RGBA32);
 }
Пример #10
0
void
DeskbarControlView::DetachedFromWindow()
{
	if (LockLooper()) {
		StopWatching(fControllerMessenger, kMsgControllerCaptureStarted);
		StopWatching(fControllerMessenger, kMsgControllerCaptureStopped);	
		StopWatching(fControllerMessenger, kMsgControllerCapturePaused);	
		StopWatching(fControllerMessenger, kMsgControllerCaptureResumed);	
		UnlockLooper();
	}
}
Пример #11
0
void RDDBIcon::Draw(BRect update_rect)
{
	if (Window())
	{
		LockLooper();
		DrawString("R*\0",BPoint(0,8));
		DrawString("d\0", BPoint(8,15));
		UnlockLooper();
	}
	BView::Draw(update_rect);
}
Пример #12
0
void BBackView::flush()
{
	BBitmap * bmp = Bitmap();
	if(LockLooper())
	{	
		backView->Flush();
		SetViewBitmap(bmp, B_FOLLOW_NONE, 0);
		Invalidate();
		UnlockLooper();
	}
}
Пример #13
0
void
TransportControlGroup::SetAudioEnabled(bool enabled)
{
	if (!LockLooper())
		return;

	fMute->SetEnabled(enabled);
	fVolumeSlider->SetEnabled(enabled);

	UnlockLooper();
}
Пример #14
0
void
DesktopPoseView::ShowVolumes(bool visible, bool showShared)
{
	if (LockLooper()) {
		SavePoseLocations();
		if (!visible)
			RemoveRootPoses();
		else
			AddRootPoses(true, showShared);
		UnlockLooper();
	}
}
Пример #15
0
void
ColorField::_DrawBorder()
{
	bool looperLocked = LockLooper();

	fBgBitmap[1]->Lock();

	rgb_color background = ui_color(B_PANEL_BACKGROUND_COLOR);
	rgb_color shadow = tint_color(background, B_DARKEN_1_TINT);
	rgb_color darkShadow = tint_color(background, B_DARKEN_3_TINT);
	rgb_color light = tint_color(background, B_LIGHTEN_MAX_TINT);

	BRect bounds(fBgView[1]->Bounds());
	bounds.OffsetBy(-2.0, -2.0);
	BRegion region(bounds);
	fBgView[1]->ConstrainClippingRegion(&region);

	bounds = COLOR_FIELD_RECT;
	bounds.OffsetBy(-2.0, -2.0);

	fBgView[1]->BeginLineArray(4);
	fBgView[1]->AddLine(BPoint(bounds.left, bounds.bottom),
		BPoint(bounds.left, bounds.top), shadow);
	fBgView[1]->AddLine(BPoint(bounds.left + 1.0, bounds.top),
		BPoint(bounds.right, bounds.top), shadow);
	fBgView[1]->AddLine(BPoint(bounds.right, bounds.top + 1.0),
		BPoint(bounds.right, bounds.bottom), light);
	fBgView[1]->AddLine(BPoint(bounds.right - 1.0, bounds.bottom),
		BPoint(bounds.left + 1.0, bounds.bottom), light);
	fBgView[1]->EndLineArray();
	bounds.InsetBy(1.0, 1.0);

	fBgView[1]->BeginLineArray(4);
	fBgView[1]->AddLine(BPoint(bounds.left, bounds.bottom),
		BPoint(bounds.left, bounds.top), darkShadow);
	fBgView[1]->AddLine(BPoint(bounds.left + 1.0, bounds.top),
		BPoint(bounds.right, bounds.top), darkShadow);
	fBgView[1]->AddLine(BPoint(bounds.right, bounds.top + 1.0),
		BPoint(bounds.right, bounds.bottom), background);
	fBgView[1]->AddLine(BPoint(bounds.right - 1.0, bounds.bottom),
		BPoint(bounds.left + 1.0, bounds.bottom), background);
	fBgView[1]->EndLineArray();
	bounds.InsetBy(1.0, 1.0);

	region.Set(bounds);
	fBgView[1]->ConstrainClippingRegion(&region);

	fBgBitmap[1]->Unlock();

	if (looperLocked)
		UnlockLooper();
}
Пример #16
0
void
TransportControlGroup::SetSkippable(bool backward, bool forward)
{
	if (!LockLooper())
		return;

	if (fSkipBack)
		fSkipBack->SetEnabled(backward);
	if (fSkipForward)
		fSkipForward->SetEnabled(forward);

	UnlockLooper();
}
Пример #17
0
void
DeskbarControlView::AttachedToWindow()
{
	SetViewColor(Parent()->ViewColor());
		
	if (LockLooper()) {
		StartWatching(fControllerMessenger, kMsgControllerCaptureStarted);
		StartWatching(fControllerMessenger, kMsgControllerCaptureStopped);
		StartWatching(fControllerMessenger, kMsgControllerCapturePaused);	
		StartWatching(fControllerMessenger, kMsgControllerCaptureResumed);
		UnlockLooper();
	}
}
Пример #18
0
__USE_CORTEX_NAMESPACE

// ---------------------------------------------------------------- //
// *** deletion
// ---------------------------------------------------------------- //

// clients must call release() rather than deleting,
// to ensure that all observers are notified of the
// object's demise.  if the object has already been
// released, return an error.

status_t ObservableHandler::release() {
	if(m_released)
		return B_NOT_ALLOWED;
	
//	PRINT((
//		"ObservableHandler::release(): %ld targets\n", CountTargets()));
	
	if(!LockLooper()) {
		ASSERT(!"failed to lock looper");
	}

	m_released = true;
	
	if(CountTargets()) {
		// notify
		notifyRelease();
		UnlockLooper();
	}
	else {
		releaseComplete();	
		UnlockLooper();
		delete this;
	}
	
	return B_OK;
}
Пример #19
0
void
ViewBuffer::DrawCursor(int32 x, int32 y)
{
	if (x < 0 || y < 0)
		return;
	
	x *= CHAR_WIDTH;
	y *= CHAR_HEIGHT;
	
	if (LockLooper()) {
		InvertRect(BRect(x, y, x + CHAR_WIDTH, y + CHAR_HEIGHT));
		Sync();
		UnlockLooper();
	}
}
Пример #20
0
// ObjectChanged
void
TrackHeaderView::ObjectChanged(const Observable* object)
{
	if (!LockLooper())
		return;

	if (object == fPlaylist) {
		if (fPlaylistName != fPlaylist->Name()) {
			fPlaylistName = fPlaylist->Name();
			Invalidate();
		}
	}

	UnlockLooper();
}
Пример #21
0
void
BBox::SetBorder(border_style border)
{
	if (border == fStyle)
		return;

	fStyle = border;

	InvalidateLayout();

	if (Window() != NULL && LockLooper()) {
		Invalidate();
		UnlockLooper();
	}
}
Пример #22
0
bool TMenuItemComponent::ChangeProperty(string APropertyName, string APropertyValue)
{
	ShowDebug(string("ChangeProperty Name=") + APropertyName + string(" Value=") + APropertyValue);
	if (LockLooper())
	{
		FPropertyList->SetPropertyValue(APropertyName,APropertyValue);												
		SetStandardProperties(APropertyName.c_str(),APropertyValue.c_str());
		if (FindPropertyName(APropertyName,PROP_LABEL)) SetLabel(APropertyValue.c_str());

		if (FindPropertyName(APropertyName,PROP_MESSAGE)) ((TMenuItemCodeGenerator *)FCodeGenerator)->CreateMessageReceived(!FLoaded);
		
		UnlockLooper();
		return TComponent::ChangeProperty(APropertyName,APropertyValue);		
	}
	return false;
}
Пример #23
0
void
ViewBuffer::Clear(uint8 attr)
{
	if (LockLooper()) {
		SetLowColor(GetPaletteEntry(BackgroundColor(attr)));
		SetViewColor(LowColor());
		FillRect(Frame(), B_SOLID_LOW);
		Sync();
		UnlockLooper();
	}
	
	fCursorX = -1;
	fCursorY = -1;

	if (fGlyphGrid)
		memset(fGlyphGrid, 0, fRows * fColumns * sizeof(uint16));
}
Пример #24
0
void
ViewBuffer::RenderGlyph(int32 x, int32 y, uint8 glyph, uint8 attr)
{
	char string[2];
	string[0] = glyph;
	string[1] = 0;
	
	if (LockLooper()) {
		_RenderGlyph(x, y, string, attr);
		Sync();
		UnlockLooper();
	}
	// remember the glyph in the grid
	if (fGlyphGrid) {
		fGlyphGrid[y * fColumns + x] = (glyph << 8) | attr;
	}
}
Пример #25
0
void CInfoDialog::Show()
{
	HDialog::Show();
	if (LockLooper())
	{
		HTabSheet* tabBook = (HTabSheet*)FindView("tabbook");
		BRect okFrame = FindView("ok")->Frame();
		if (tabBook) {
			BPoint bottomRight = tabBook->AdjustBottomRightOfAllPanes();
			if (bottomRight.x < okFrame.right)
				bottomRight.x = okFrame.right;
			if (bottomRight.y < okFrame.bottom)
				bottomRight.y = okFrame.bottom;
			ResizeTo(bottomRight.x+5, bottomRight.y+5);
		}
		UnlockLooper();
	}
}
Пример #26
0
// SetValue
void		
PopupSlider::SetValue(int32 value)
{
	if (!fTracking) {
/*		if (fSlider->LockLooper()) {
			fSlider->SetValue(value);
			fSlider->UnlockLooper();
		} else*/
		if (value != Value()) {
			fSlider->SetValue(value);
			if (LockLooperWithTimeout(0) >= B_OK) {
				Invalidate();
				UnlockLooper();
			}
		}
	} else
		ValueChanged(value);
}
Пример #27
0
	void AsyncRedraw(BRegion& region)
	{
		if (!LockLooper())
			return;

#if 0
		ConstrainClippingRegion(&region);
		FillRect(Bounds());
		ConstrainClippingRegion(NULL);
#else
		PushState();
		ConstrainClippingRegion(&region);
		FillRect(Bounds());
		PopState();
#endif

		UnlockLooper();
	}
Пример #28
0
void
HTGTimeLineView::AddList(BList *tweets)
{
	/*Add the list of tweets*/
	HTTweet *currentTweet;
	for (int i = 0; i < tweets->CountItems(); i++) {
		currentTweet = (HTTweet *)tweets->ItemAt(i);

		/*Make a copy, download bitmap and add it to newList*/
		currentTweet->downloadBitmap();
		unhandledList->AddItem(new HTGTweetItem(currentTweet));
	}
	
	if(LockLooper()) {
		this->addUnhandledTweets();
		UnlockLooper();
	}
}
Пример #29
0
void TextScrollerView::AddLine(const char *text,rgb_color &c,BFont &f)
{
	text_run_array run_array;
	run_array.count = 1;
	run_array.runs[0].offset = 0;
	run_array.runs[0].color = c;
	run_array.runs[0].font = f;

	if (LockLooper()) {
		text_view->Insert(text,&run_array);
		text_view->Insert("\n");
		UnlockLooper();
	}
	else {
		text_view->Insert(text,&run_array);
		text_view->Insert("\n");
	}
}
Пример #30
0
// SetBitmap
void
VideoView::SetBitmap(const BBitmap* bitmap)
{
	VCTarget::SetBitmap(bitmap);
	// Attention: Don't lock the window, if the bitmap is NULL. Otherwise
	// we're going to deadlock when the window tells the node manager to
	// stop the nodes (Window -> NodeManager -> VideoConsumer -> VideoView
	// -> Window).
	if (bitmap && LockLooperWithTimeout(10000) == B_OK) {
		if (LockBitmap()) {
//			if (fOverlayMode || bitmap->Flags() & B_BITMAP_WILL_OVERLAY) {
			if (fOverlayMode || bitmap->ColorSpace() == B_YCbCr422) {
				if (!fOverlayMode) {
					// init overlay
					rgb_color key;
					SetViewOverlay(bitmap,
								   bitmap->Bounds(),
				                   Bounds(),
				                   &key, B_FOLLOW_ALL,
				                   B_OVERLAY_FILTER_HORIZONTAL
				                   | B_OVERLAY_FILTER_VERTICAL);
					SetViewColor(key);
					Invalidate();
					// use overlay from here on
					fOverlayMode = true;
				} else {
					// transfer overlay channel
					rgb_color key;
					SetViewOverlay(bitmap,
								   bitmap->Bounds(),
								   Bounds(),
								   &key, B_FOLLOW_ALL,
								   B_OVERLAY_FILTER_HORIZONTAL
								   | B_OVERLAY_FILTER_VERTICAL
								   | B_OVERLAY_TRANSFER_CHANNEL);
				}
			} else {
				DrawBitmap(bitmap, bitmap->Bounds(), Bounds());
			}
			UnlockBitmap();
		}
		UnlockLooper();
	}
}