Blame gdk/quartz/gdkdnd-quartz.c

Packit 98cdb6
/* gdkdnd-quartz.c
Packit 98cdb6
 *
Packit 98cdb6
 * Copyright (C) 2005 Imendio AB
Packit 98cdb6
 *
Packit 98cdb6
 * This library is free software; you can redistribute it and/or
Packit 98cdb6
 * modify it under the terms of the GNU Lesser General Public
Packit 98cdb6
 * License as published by the Free Software Foundation; either
Packit 98cdb6
 * version 2 of the License, or (at your option) any later version.
Packit 98cdb6
 *
Packit 98cdb6
 * This library is distributed in the hope that it will be useful,
Packit 98cdb6
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 98cdb6
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 98cdb6
 * Lesser General Public License for more details.
Packit 98cdb6
 *
Packit 98cdb6
 * You should have received a copy of the GNU Lesser General Public
Packit 98cdb6
 * License along with this library; if not, write to the
Packit 98cdb6
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Packit 98cdb6
 * Boston, MA 02111-1307, USA.
Packit 98cdb6
 */
Packit 98cdb6
Packit 98cdb6
#include "gdkdnd.h"
Packit 98cdb6
#include "gdkprivate-quartz.h"
Packit 98cdb6
Packit 98cdb6
static gpointer parent_class = NULL;
Packit 98cdb6
Packit 98cdb6
static void
Packit 98cdb6
gdk_drag_context_finalize (GObject *object)
Packit 98cdb6
{
Packit 98cdb6
  GdkDragContext *context = GDK_DRAG_CONTEXT (object);
Packit 98cdb6
  GdkDragContextPrivate *private = GDK_DRAG_CONTEXT_PRIVATE (context);
Packit 98cdb6
 
Packit 98cdb6
  g_free (private);
Packit 98cdb6
  
Packit 98cdb6
  G_OBJECT_CLASS (parent_class)->finalize (object);
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
static void
Packit 98cdb6
gdk_drag_context_init (GdkDragContext *dragcontext)
Packit 98cdb6
{
Packit 98cdb6
  GdkDragContextPrivate *priv = g_new0 (GdkDragContextPrivate, 1);
Packit 98cdb6
Packit 98cdb6
  dragcontext->windowing_data = priv;
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
static void
Packit 98cdb6
gdk_drag_context_class_init (GdkDragContextClass *klass)
Packit 98cdb6
{
Packit 98cdb6
  GObjectClass *object_class = G_OBJECT_CLASS (klass);
Packit 98cdb6
  
Packit 98cdb6
  parent_class = g_type_class_peek_parent (klass);
Packit 98cdb6
Packit 98cdb6
  object_class->finalize = gdk_drag_context_finalize;
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
GType
Packit 98cdb6
gdk_drag_context_get_type (void)
Packit 98cdb6
{
Packit 98cdb6
  static GType object_type = 0;
Packit 98cdb6
Packit 98cdb6
  if (!object_type)
Packit 98cdb6
    {
Packit 98cdb6
      const GTypeInfo object_info =
Packit 98cdb6
      {
Packit 98cdb6
        sizeof (GdkDragContextClass),
Packit 98cdb6
        (GBaseInitFunc) NULL,
Packit 98cdb6
        (GBaseFinalizeFunc) NULL,
Packit 98cdb6
        (GClassInitFunc) gdk_drag_context_class_init,
Packit 98cdb6
        NULL,           /* class_finalize */
Packit 98cdb6
        NULL,           /* class_data */
Packit 98cdb6
        sizeof (GdkDragContext),
Packit 98cdb6
        0,              /* n_preallocs */
Packit 98cdb6
        (GInstanceInitFunc) gdk_drag_context_init,
Packit 98cdb6
      };
Packit 98cdb6
      
Packit 98cdb6
      object_type = g_type_register_static (G_TYPE_OBJECT,
Packit 98cdb6
                                            "GdkDragContext",
Packit 98cdb6
                                            &object_info,
Packit 98cdb6
					    0);
Packit 98cdb6
    }
Packit 98cdb6
  
Packit 98cdb6
  return object_type;
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
GdkDragContext *
Packit 98cdb6
gdk_drag_context_new (void)
Packit 98cdb6
{
Packit 98cdb6
  return (GdkDragContext *)g_object_new (gdk_drag_context_get_type (), NULL);
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
void            
Packit 98cdb6
gdk_drag_context_ref (GdkDragContext *context)
Packit 98cdb6
{
Packit 98cdb6
  g_object_ref (context);
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
void            
Packit 98cdb6
gdk_drag_context_unref (GdkDragContext *context)
Packit 98cdb6
{
Packit 98cdb6
  g_object_unref (context);
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
GdkDragContext *_gdk_quartz_drag_source_context = NULL;
Packit 98cdb6
Packit 98cdb6
GdkDragContext *
Packit 98cdb6
gdk_quartz_drag_source_context ()
Packit 98cdb6
{
Packit 98cdb6
  return _gdk_quartz_drag_source_context;
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
GdkDragContext * 
Packit 98cdb6
gdk_drag_begin (GdkWindow     *window,
Packit 98cdb6
		GList         *targets)
Packit 98cdb6
{
Packit 98cdb6
  g_assert (_gdk_quartz_drag_source_context == NULL);
Packit 98cdb6
  
Packit 98cdb6
  /* Create fake context */
Packit 98cdb6
  _gdk_quartz_drag_source_context = gdk_drag_context_new ();
Packit 98cdb6
  _gdk_quartz_drag_source_context->is_source = TRUE;
Packit 98cdb6
  
Packit 98cdb6
  return _gdk_quartz_drag_source_context;
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
gboolean        
Packit 98cdb6
gdk_drag_motion (GdkDragContext *context,
Packit 98cdb6
		 GdkWindow      *dest_window,
Packit 98cdb6
		 GdkDragProtocol protocol,
Packit 98cdb6
		 gint            x_root, 
Packit 98cdb6
		 gint            y_root,
Packit 98cdb6
		 GdkDragAction   suggested_action,
Packit 98cdb6
		 GdkDragAction   possible_actions,
Packit 98cdb6
		 guint32         time)
Packit 98cdb6
{
Packit 98cdb6
  /* FIXME: Implement */
Packit 98cdb6
  return FALSE;
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
GdkNativeWindow
Packit 98cdb6
gdk_drag_get_protocol_for_display (GdkDisplay      *display,
Packit 98cdb6
				   GdkNativeWindow  xid,
Packit 98cdb6
				   GdkDragProtocol *protocol)
Packit 98cdb6
{
Packit 98cdb6
  /* FIXME: Implement */
Packit 98cdb6
  return 0;
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
void
Packit 98cdb6
gdk_drag_find_window_for_screen (GdkDragContext  *context,
Packit 98cdb6
				 GdkWindow       *drag_window,
Packit 98cdb6
				 GdkScreen       *screen,
Packit 98cdb6
				 gint             x_root,
Packit 98cdb6
				 gint             y_root,
Packit 98cdb6
				 GdkWindow      **dest_window,
Packit 98cdb6
				 GdkDragProtocol *protocol)
Packit 98cdb6
{
Packit 98cdb6
  /* FIXME: Implement */
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
void
Packit 98cdb6
gdk_drag_drop (GdkDragContext *context,
Packit 98cdb6
	       guint32         time)
Packit 98cdb6
{
Packit 98cdb6
  /* FIXME: Implement */
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
void
Packit 98cdb6
gdk_drag_abort (GdkDragContext *context,
Packit 98cdb6
		guint32         time)
Packit 98cdb6
{
Packit 98cdb6
  g_return_if_fail (context != NULL);
Packit 98cdb6
  
Packit 98cdb6
  /* FIXME: Implement */
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
void             
Packit 98cdb6
gdk_drag_status (GdkDragContext   *context,
Packit 98cdb6
		 GdkDragAction     action,
Packit 98cdb6
		 guint32           time)
Packit 98cdb6
{
Packit 98cdb6
  context->action = action;
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
void 
Packit 98cdb6
gdk_drop_reply (GdkDragContext   *context,
Packit 98cdb6
		gboolean          ok,
Packit 98cdb6
		guint32           time)
Packit 98cdb6
{
Packit 98cdb6
  g_return_if_fail (context != NULL);
Packit 98cdb6
Packit 98cdb6
  /* FIXME: Implement */
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
void             
Packit 98cdb6
gdk_drop_finish (GdkDragContext   *context,
Packit 98cdb6
		 gboolean          success,
Packit 98cdb6
		 guint32           time)
Packit 98cdb6
{
Packit 98cdb6
  /* FIXME: Implement */
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
void            
Packit 98cdb6
gdk_window_register_dnd (GdkWindow *window)
Packit 98cdb6
{
Packit 98cdb6
  /* FIXME: Implement */
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
GdkAtom       
Packit 98cdb6
gdk_drag_get_selection (GdkDragContext *context)
Packit 98cdb6
{
Packit 98cdb6
  /* FIXME: Implement */
Packit 98cdb6
  return GDK_NONE;
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
gboolean 
Packit 98cdb6
gdk_drag_drop_succeeded (GdkDragContext *context)
Packit 98cdb6
{
Packit 98cdb6
  /* FIXME: Implement */
Packit 98cdb6
  return FALSE;
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
id
Packit 98cdb6
gdk_quartz_drag_context_get_dragging_info_libgtk_only (GdkDragContext *context)
Packit 98cdb6
{
Packit 98cdb6
  return GDK_DRAG_CONTEXT_PRIVATE (context)->dragging_info;
Packit 98cdb6
}