Ejemplo n.º 1
0
static gboolean
gdk_mir_event_source_dispatch (GSource     *g_source,
                               GSourceFunc  callback,
                               gpointer     user_data)
{
  GdkMirEventSource *source = (GdkMirEventSource *) g_source;
  GdkEvent *event;

  /* First, run the queue of events from the thread */
  gdk_mir_event_source_convert_events (source);

  /* Next, dispatch one single event from the display's queue.
   *
   * If there is more than one event then we will soon find ourselves
   * back here again.
   */

  gdk_threads_enter ();

  event = gdk_display_get_event (source->display);

  if (event)
    {
      _gdk_event_emit (event);

      gdk_event_free (event);
    }

  gdk_threads_leave ();

  return TRUE;
}
Ejemplo n.º 2
0
void structGraphicsScreen :: v_getMouseLocation (double *xWC, double *yWC) {
	#if cairo
		GdkEvent *gevent = gdk_display_get_event (d_display);
		if (gevent != NULL) {
			if (gevent -> type == GDK_BUTTON_RELEASE) {
				theMouseDown = false;
			}
			gdk_event_free (gevent);
		}
		gint xDC, yDC;
		gdk_window_get_pointer (d_window, & xDC, & yDC, NULL);
		Graphics_DCtoWC (this, xDC, yDC, xWC, yWC);
	#elif cocoa
	#elif win
		POINT pos;
		if (! GetCursorPos (& pos)) { Melder_warning (L"Cannot get cursor position."); return; }
		ScreenToClient (d_winWindow, & pos);
		Graphics_DCtoWC (this, pos. x, pos. y, xWC, yWC);
	#elif mac
		if (HIGetMousePosition != NULL && false) {   // AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER
			//Melder_casual ("HIGetMousePosition exists");
			HIPoint mouseLoc;
			HIGetMousePosition (kHICoordSpaceWindow, GetWindowFromPort (d_macPort), & mouseLoc);
			Graphics_DCtoWC (this, mouseLoc. x, mouseLoc. y, xWC, yWC);
		} else {
			Point mouseLoc;
			GetMouse (& mouseLoc);   // AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5
			Graphics_DCtoWC (this, mouseLoc. h, mouseLoc. v, xWC, yWC);
		}
	#endif
}
Ejemplo n.º 3
0
/**
 * gdk_event_get:
 * 
 * Checks all open displays for a #GdkEvent to process,to be processed
 * on, fetching events from the windowing system if necessary.
 * See gdk_display_get_event().
 * 
 * Return value: the next #GdkEvent to be processed, or %NULL if no events
 * are pending. The returned #GdkEvent should be freed with gdk_event_free().
 **/
GdkEvent*
gdk_event_get (void)
{
  GSList *tmp_list;

  for (tmp_list = _gdk_displays; tmp_list; tmp_list = tmp_list->next)
    {
      GdkEvent *event = gdk_display_get_event (tmp_list->data);
      if (event)
	return event;
    }

  return NULL;
}
Ejemplo n.º 4
0
static gboolean
gdk_event_source_dispatch (GSource     *source,
                           GSourceFunc  callback,
                           gpointer     user_data)
{
  GdkDisplay *display = ((GdkEventSource*) source)->display;
  GdkEvent *event;

  gdk_threads_enter ();

  event = gdk_display_get_event (display);

  if (event)
    {
      _gdk_event_emit (event);

      gdk_event_free (event);
    }

  gdk_threads_leave ();

  return TRUE;
}
Ejemplo n.º 5
0
static gboolean
gdk_event_source_dispatch (GSource     *source,
                           GSourceFunc  callback,
                           gpointer     user_data)
{
  GdkDisplay *display = ((GdkEventSource*) source)->display;
  GdkEvent *event;

  GDK_THREADS_ENTER ();

  event = gdk_display_get_event (display);

  if (event)
    {
      _gdk_event_emit (event);

      gdk_event_free (event);
    }

  GDK_THREADS_LEAVE ();

  return TRUE;
}
Ejemplo n.º 6
0
static VALUE
rg_event(VALUE self)
{
    return GEV2RVAL(gdk_display_get_event(_SELF(self)));
}