summaryrefslogtreecommitdiff
path: root/gnu/java/awt/dnd
diff options
context:
space:
mode:
authorLillian Angel <langel@redhat.com>2006-07-28 15:52:05 +0000
committerLillian Angel <langel@redhat.com>2006-07-28 15:52:05 +0000
commit9a8b6ec494c924028a9e4a550247ef72bd04d065 (patch)
tree9d223098e99931a2dc4780f808aba951663701f8 /gnu/java/awt/dnd
parent1df72fb152a2ed319bfe12ae18c3a558e3b12d53 (diff)
downloadclasspath-9a8b6ec494c924028a9e4a550247ef72bd04d065.tar.gz
2006-07-28 Lillian Angel <langel@redhat.com>
* native/jni/gtk-peer/GtkDragSourceContextPeer.c: Added more static functions to handle widget signals. (create): Initialized the javaObj field. (connectSignals): Added code to connect all signals to the appropriate functions and initialized all java function fields. (drag_begin_cb): New callback, not implemented. (drag_motion_cb): Likewise. (drag_data_get_cb): Likewise. (drag_data_delete_cb): Likewise. (drag_drop_cb): Likewise. (drag_end_cb): Likewise. (drag_data_received_cb): Likewise. (setTarget): New function. (nativeStartDrag): Added code to set the destination and source widgets. * java/awt/dnd/DragSource.java (startDrag): Removed FIXME. * java/awt/dnd/DragGestureRecognizer.java (fireDragGestureRecognized): Reset recognizer when events are fired. * java/awt/Component.java (setDropTarget): Added code to create the DropTargetContextPeer. * include/GtkDragSourceContextPeer.h: Regenerated. * gnu/java/awt/dnd/peer/gtk/GtkDropTargetPeer.java: Removed file. * gnu/java/awt/dnd/peer/gtk/GtkDropTargetContextPeer.java (GtkDropTargetContextPeer): Implemented. * gnu/java/awt/dnd/peer/gtk/GtkDragSourceContextPeer.java (GtkDragSourceContextPeer): Added code to set the target.
Diffstat (limited to 'gnu/java/awt/dnd')
-rw-r--r--gnu/java/awt/dnd/peer/gtk/GtkDragSourceContextPeer.java5
-rw-r--r--gnu/java/awt/dnd/peer/gtk/GtkDropTargetContextPeer.java8
-rw-r--r--gnu/java/awt/dnd/peer/gtk/GtkDropTargetPeer.java68
3 files changed, 9 insertions, 72 deletions
diff --git a/gnu/java/awt/dnd/peer/gtk/GtkDragSourceContextPeer.java b/gnu/java/awt/dnd/peer/gtk/GtkDragSourceContextPeer.java
index 4f9229822..2488ed509 100644
--- a/gnu/java/awt/dnd/peer/gtk/GtkDragSourceContextPeer.java
+++ b/gnu/java/awt/dnd/peer/gtk/GtkDragSourceContextPeer.java
@@ -61,11 +61,13 @@ public class GtkDragSourceContextPeer
private ComponentPeer peer;
private Cursor cursor;
private DragSourceContext context;
+ public static Component target;
native void nativeStartDrag(Image i, int x, int y, int action, String target);
native void connectSignals(ComponentPeer comp);
native void create(ComponentPeer comp);
native void nativeSetCursor(int cursor);
+ native void setTarget(ComponentPeer target);
public GtkDragSourceContextPeer(DragGestureEvent e)
{
@@ -76,6 +78,7 @@ public class GtkDragSourceContextPeer
create(peer);
connectSignals(peer);
cursor = comp.getCursor();
+ setTarget(target.getPeer());
}
ComponentPeer getComponentPeer(Component c)
@@ -93,7 +96,7 @@ public class GtkDragSourceContextPeer
throws InvalidDnDOperationException
{
this.context = context;
-
+
if (p == null)
p = new Point();
diff --git a/gnu/java/awt/dnd/peer/gtk/GtkDropTargetContextPeer.java b/gnu/java/awt/dnd/peer/gtk/GtkDropTargetContextPeer.java
index 50cd95d41..90d6fbe78 100644
--- a/gnu/java/awt/dnd/peer/gtk/GtkDropTargetContextPeer.java
+++ b/gnu/java/awt/dnd/peer/gtk/GtkDropTargetContextPeer.java
@@ -40,6 +40,7 @@ package gnu.java.awt.dnd.peer.gtk;
import gnu.java.awt.peer.gtk.GtkGenericPeer;
+import java.awt.Component;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.dnd.DropTarget;
@@ -50,10 +51,11 @@ public class GtkDropTargetContextPeer
extends GtkGenericPeer
implements DropTargetContextPeer
{
-
- public GtkDropTargetContextPeer()
+
+ public GtkDropTargetContextPeer(Object obj)
{
- super(null);
+ super(obj);
+ GtkDragSourceContextPeer.target = (Component) obj;
}
public void setTargetActions(int actions)
diff --git a/gnu/java/awt/dnd/peer/gtk/GtkDropTargetPeer.java b/gnu/java/awt/dnd/peer/gtk/GtkDropTargetPeer.java
deleted file mode 100644
index 88b75ad96..000000000
--- a/gnu/java/awt/dnd/peer/gtk/GtkDropTargetPeer.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/* GtkDropTargetPeer.java --
- Copyright (C) 2006 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.java.awt.dnd.peer.gtk;
-
-import gnu.java.awt.peer.gtk.GtkGenericPeer;
-
-import java.awt.dnd.DropTarget;
-import java.awt.dnd.peer.DropTargetPeer;
-
-public class GtkDropTargetPeer
- extends GtkGenericPeer
- implements DropTargetPeer
-{
-
- public GtkDropTargetPeer()
- {
- super(null);
- }
-
- public void addDropTarget(DropTarget target)
- {
- // FIXME: Not Implemented
-
- }
-
- public void removeDropTarget(DropTarget target)
- {
- // FIXME: Not Implemented
-
- }
-
-}