Beispiel #1
0
GdkEvent *gdk_event_copy(GdkEvent * event)
{
   GdkEvent *new_event;

   g_return_val_if_fail(event != NULL, NULL);

   new_event = gdk_event_new();

   *new_event = *event;
   gdk_window_ref(new_event->any.window);

   switch (event->any.type) {
   case GDK_KEY_PRESS:
   case GDK_KEY_RELEASE:
      new_event->key.string = g_strdup(event->key.string);
      break;

   case GDK_ENTER_NOTIFY:
   case GDK_LEAVE_NOTIFY:
      if (event->crossing.subwindow != NULL)
         gdk_window_ref(event->crossing.subwindow);
      break;

   case GDK_DRAG_ENTER:
   case GDK_DRAG_LEAVE:
   case GDK_DRAG_MOTION:
   case GDK_DRAG_STATUS:
   case GDK_DROP_START:
   case GDK_DROP_FINISHED:
      gdk_drag_context_ref(event->dnd.context);
      break;

   default:
      break;
   }

   return new_event;
}
Beispiel #2
0
void DragContext::incref() const
{
    if ( m_obj )
        gdk_drag_context_ref( (GdkDragContext*) m_obj );
}