Пример #1
0
 CounterView (BRect FrameSize) : BView (FrameSize, "CounterView", B_FOLLOW_ALL_SIDES,
  B_WILL_DRAW | B_FRAME_EVENTS | B_FULL_UPDATE_ON_RESIZE | B_PULSE_NEEDED),
   m_MovingDotPoint (10, 20),
   m_BackingView (FrameSize, "BackingView", B_FOLLOW_ALL_SIDES, B_FULL_UPDATE_ON_RESIZE)
 {
   m_CurrentCount = 0;
   m_StringResizeNeededCount = 10;
   m_BackingBitmap = NULL;
   SetViewColor (B_TRANSPARENT_COLOR);
   FrameResized (FrameSize.right, FrameSize.bottom); // Set m_TextStartPoint.
   ViewPulseThreadID = spawn_thread (ViewPulserCode,
     "CounterViewPulser", 80 /* Priority */, this); // Creates but doesn't start.
   m_InputDeviceMousePntr = find_input_device ("VNC Fake Mouse");
   m_InputDeviceKeyboardPntr = find_input_device ("VNC Fake Keyboard");
   m_EventTriggerCounter = 0;
 };
Пример #2
0
static void stop_device(const char *name)
{
	BInputDevice *device;
	status_t status;

	device = find_input_device(name);
	if (device == NULL) {
		printf("Error finding device \"%s\"\n", name);
	}
	else if ((status = device->Stop()) != B_OK) {
		printf("Error stopping device \"%s\" (%ld)\n", name, status);
	}
	else {
		printf("Stopped device \"%s\"\n", name);
	}
	if (device != NULL)
		delete device;
}