Пример #1
0
void
WaypointManagerWidget::OnAction(int id)
{
  switch (Buttons(id)) {
  case NEW:
    OnWaypointNewClicked();
    break;

  case IMPORT:
    OnWaypointImportClicked();
    break;

  case EDIT:
    OnWaypointEditClicked(GetList().GetCursorIndex());
    break;

  case SAVE:
    OnWaypointSaveClicked();
    break;

  case DELETE:
    OnWaypointDeleteClicked(GetList().GetCursorIndex());
    break;
  }
}
Пример #2
0
void
Keyboard( unsigned char c, int x, int y )
{
	switch( c )
	{
		case 'o':
		case 'O':
			WhichProjection = ORTHO;
			break;

		case 'p':
		case 'P':
			WhichProjection = PERSP;
			break;

		case 'q':
		case 'Q':
		case ESCAPE:
			Buttons( QUIT );	// will not return here
			break;			// happy compiler

		default:
			fprintf( stderr, "Don't know what to do with keyboard hit: '%c' (0x%0x)\n", c, c );
	}
	Glui->sync_live( );
	glutSetWindow( MainWindow );
	glutPostRedisplay( );
}
Пример #3
0
// Connected to INT13 of CPU (use MINT13 mask):
// ISR can be used by the user.
__interrupt void INT13_ISR(void)     // INT13 or CPU-Timer1
{
	 //***********************************WARNING!!********************************************\\
	//BE CAREFUL YOU NEED TO ALLOW NESTING FOR ANY INTERRUPT THAT MIGHT HAPPEN IN THIS INTERRUPT\\

	 EINT;		//enable all interrupts

	//todo USER: Define Clock ISR
	Clock_Ticks.DataOut++;
	Clock_Ticks.HeartBeat++;

	if (Clock_Ticks.DataOut >= DATAOUT_TICKS)
	{
		//send data or fill data
		Clock_Ticks.DataOut = 0;
	}

	if (Clock_Ticks.HeartBeat >= HEARTBEAT_TICKS)
	{
		HeartBeat();
		Clock_Ticks.HeartBeat = 0;
	}

	Buttons();

	ReloadCpuTimer1();
	StartCpuTimer1();

	DINT;
}
Пример #4
0
NS_IMETHODIMP
MouseEvent::GetButtons(uint16_t* aButtons)
{
  NS_ENSURE_ARG_POINTER(aButtons);
  *aButtons = Buttons();
  return NS_OK;
}
Пример #5
0
MainWindow::MainWindow(QWidget* parent)
    :QMainWindow(parent)
{
    GUI();
    Buttons();
    outGraph();
    matrixSize = 0;
}
Пример #6
0
// ----------------------------------------------------------------------
void EventInputQueue::push_RelativePointerEventCallback(OSObject* target,
                                                        int buttons_raw,
                                                        int dx,
                                                        int dy,
                                                        AbsoluteTime ts,
                                                        OSObject* sender,
                                                        void* refcon) {
  GlobalLock::ScopedLock lk;
  if (!lk) return;

  Params_RelativePointerEventCallback::log(true, Buttons(buttons_raw), dx, dy);

  // ------------------------------------------------------------
  Buttons buttons(buttons_raw);
  Buttons justPressed;
  Buttons justReleased;

  IOHIPointing* device = OSDynamicCast(IOHIPointing, sender);
  if (!device) return;

  ListHookedPointing::Item* item = static_cast<ListHookedPointing::Item*>(ListHookedPointing::instance().get(device));
  if (!item) return;

  // ------------------------------------------------------------
  CommonData::setcurrent_ts(ts);

  // ------------------------------------------------------------
  justPressed = buttons.justPressed(item->get_previousbuttons());
  justReleased = buttons.justReleased(item->get_previousbuttons());
  item->set_previousbuttons(buttons);

  // ------------------------------------------------------------
  // divide an event into button and cursormove events.
  for (int i = 0; i < ButtonStatus::MAXNUM; ++i) {
    PointingButton btn(1 << i);
    if (justPressed.isOn(btn)) {
      Params_RelativePointerEventCallback params(buttons, 0, 0, btn, true);
      bool retainFlagStatusTemporaryCount = Config::get_essential_config(BRIDGE_ESSENTIAL_CONFIG_INDEX_general_lazy_modifiers_with_mouse_event);
      enqueue_(params, retainFlagStatusTemporaryCount, item->getDeviceIdentifier());
    }
    if (justReleased.isOn(btn)) {
      Params_RelativePointerEventCallback params(buttons, 0, 0, btn, false);
      bool retainFlagStatusTemporaryCount = Config::get_essential_config(BRIDGE_ESSENTIAL_CONFIG_INDEX_general_lazy_modifiers_with_mouse_event);
      enqueue_(params, retainFlagStatusTemporaryCount, item->getDeviceIdentifier());
    }
  }
  // If (dx == 0 && dy == 0), the event is either needless event or just pressing/releasing buttons event.
  // About just pressing/releasing buttons event, we handled these in the above processes.
  // So, we can drop (dx == 0 && dy == 0) events in here.
  if (dx != 0 || dy != 0) {
    Params_RelativePointerEventCallback params(buttons, dx, dy, PointingButton::NONE, false);
    bool retainFlagStatusTemporaryCount = true;
    enqueue_(params, retainFlagStatusTemporaryCount, item->getDeviceIdentifier());
  }

  setTimer();
}
Пример #7
0
void
TrafficListWidget::OnAction(int id)
{
  switch (Buttons(id)) {
  case DETAILS:
    OpenDetails(GetList().GetCursorIndex());
    break;
  }
}
Пример #8
0
void
AirspaceListWidget::OnAction(int id)
{
  switch (Buttons(id)) {
  case DETAILS:
    OnAirspaceListEnter(GetList().GetCursorIndex());
    break;
  }
}
Пример #9
0
void
WaypointListWidget::OnAction(int id)
{
  switch (Buttons(id)) {
  case SELECT:
    OnWaypointListEnter();
    break;
  }
}
Пример #10
0
VideoPlayer::VideoPlayer(QWidget *parent): QWidget(parent), mediaPlayer(0, QMediaPlayer::VideoSurface),
    playButton(0), positionSlider(0) {
    setAcceptDrops(true);// Drag&Drop
    Widgets();
    MainMenu();
    Buttons();
    HotKeys();
    Sliders();
    Layouts();

}
Пример #11
0
void
Keyboard( unsigned char c, int x, int y )
{
	if( DebugOn != 0 )
		fprintf( stderr, "Keyboard: '%c' (0x%0x)\n", c, c );

	switch( c )
	{
		case 'o':
		case 'O':
			WhichProjection = ORTHO;
			break;

		case 'p':
		case 'P':
			WhichProjection = PERSP;
			break;

		case 'q':
		case 'Q':
		case ESCAPE:
			Buttons( QUIT );	// will not return here
			break;			// happy compiler

		case 'r':
		case 'R':
			LeftButton = ROTATE;
			break;

		case 's':
		case 'S':
			LeftButton = SCALE;
			break;

		default:
			fprintf( stderr, "Don't know what to do with keyboard hit: '%c' (0x%0x)\n", c, c );
	}


	// synchronize the GLUI display with the variables:

	Glui->sync_live( );


	// force a call to Display( ):

	glutSetWindow( MainWindow );
	glutPostRedisplay( );
}
Пример #12
0
int main(int argc , char *argv[]){	
	gtk_init(&argc,&argv);
	vbox = gtk_vbox_new(FALSE,2);
	CreateWindow();
	Buttons();
	ConnectNodes = gtk_label_new("No Torrent Selected");
	gtk_box_pack_start(GTK_BOX(vbox),HorizontalPanel(),FALSE,TRUE,2);
	gtk_box_pack_start(GTK_BOX(vbox),ConnectNodes,FALSE,TRUE,2);
	gtk_box_pack_start(GTK_BOX(vbox),ProgressBar(),FALSE,TRUE,2);
	gtk_container_add(GTK_CONTAINER(window), vbox);

	gtk_widget_show_all(window);
	gtk_widget_hide(progress);

	gtk_main();
	return 0;	 
}
Пример #13
0
void ListHookedPointing::apply(const Params_RelativePointerEventCallback& params) {
  // if all button are released, send event for all devices.
  if (params.buttons == Buttons(0) &&
      params.dx == 0 &&
      params.dy == 0) {
    for (Item* p = static_cast<Item*>(list_.safe_front()); p; p = static_cast<Item*>(p->getnext())) {
      if (!p->isReplaced()) continue;

      p->apply(params);
    }

  } else {
    ListHookedPointing::Item* p = static_cast<ListHookedPointing::Item*>(get_replaced());
    if (p) {
      p->apply(params);
    }
  }
}
  void
  ListHookedPointing::apply(const Params_RelativePointerEventCallback& params)
  {
    IOLockWrapper::ScopedLock lk(list_lock_);
    if (! lk) return;

    // if all button are released, send event for all devices.
    if (params.buttons == Buttons(0) &&
        params.dx == 0 &&
        params.dy == 0) {
      for (Item* p = static_cast<Item*>(list_->front()); p; p = static_cast<Item*>(p->getnext())) {
        if (! p->isReplaced()) continue;

        p->apply(params);
      }

    } else {
      ListHookedPointing::Item* p = static_cast<ListHookedPointing::Item*>(get_replaced_nolock());
      if (p) {
        p->apply(params);
      }
    }
  }
Пример #15
0
 static void lock_toggle(PointingButton button) { lock_toggle(Buttons(button)); }
Пример #16
0
 static void decrease(PointingButton button) { decrease(Buttons(button)); }
Пример #17
0
 static void increase(PointingButton button) { increase(Buttons(button)); }
 void EventOutputQueue::push(const Params_RelativePointerEventCallback& p) {
   PUSH_TO_OUTPUTQUEUE;
   if (p.buttons != Buttons(0)) {
     FlagStatus::sticky_clear();
   }
 }