Пример #1
0
void gdk_event_free(GdkEvent * event)
{
   g_return_if_fail(event != NULL);

   g_assert(event_chunk != NULL);	/* paranoid */

   if ((event->any.window) && (event->type != GDK_DESTROY))
      gdk_window_unref(event->any.window);

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

   case GDK_ENTER_NOTIFY:
   case GDK_LEAVE_NOTIFY:
      if (event->crossing.subwindow != NULL)
         gdk_window_unref(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_unref(event->dnd.context);
      break;

   default:
      break;
   }

   g_mem_chunk_free(event_chunk, event);
}
Пример #2
0
void DragContext::decref() const
{
    if ( m_obj )
        gdk_drag_context_unref( (GdkDragContext*) m_obj );
}