70 |
import java.awt.image.ImageProducer; |
import java.awt.image.ImageProducer; |
71 |
import java.awt.image.VolatileImage; |
import java.awt.image.VolatileImage; |
72 |
import java.awt.peer.ComponentPeer; |
import java.awt.peer.ComponentPeer; |
73 |
|
import java.awt.peer.ContainerPeer; |
74 |
import java.util.Timer; |
import java.util.Timer; |
75 |
import java.util.TimerTask; |
import java.util.TimerTask; |
76 |
|
|
100 |
native void gtkWidgetGetPreferredDimensions (int[] dim); |
native void gtkWidgetGetPreferredDimensions (int[] dim); |
101 |
native void gtkWidgetGetLocationOnScreen (int[] point); |
native void gtkWidgetGetLocationOnScreen (int[] point); |
102 |
native void gtkWidgetSetCursor (int type); |
native void gtkWidgetSetCursor (int type); |
103 |
|
native void gtkWidgetSetCursorUnlocked (int type); |
104 |
native void gtkWidgetSetBackground (int red, int green, int blue); |
native void gtkWidgetSetBackground (int red, int green, int blue); |
105 |
native void gtkWidgetSetForeground (int red, int green, int blue); |
native void gtkWidgetSetForeground (int red, int green, int blue); |
106 |
native void gtkWidgetSetSensitive (boolean sensitive); |
native void gtkWidgetSetSensitive (boolean sensitive); |
424 |
int new_y = y; |
int new_y = y; |
425 |
|
|
426 |
Component parent = awtComponent.getParent (); |
Component parent = awtComponent.getParent (); |
427 |
|
Component next_parent; |
428 |
|
|
429 |
// Heavyweight components that are children of one or more |
// Heavyweight components that are children of one or more |
430 |
// lightweight containers have to be handled specially. Because |
// lightweight containers have to be handled specially. Because |
442 |
{ |
{ |
443 |
lightweightChild = true; |
lightweightChild = true; |
444 |
|
|
445 |
|
next_parent = parent.getParent (); |
446 |
|
|
447 |
i = ((Container) parent).getInsets (); |
i = ((Container) parent).getInsets (); |
448 |
|
|
449 |
new_x += parent.getX () + i.left; |
if (next_parent instanceof Window) |
450 |
new_y += parent.getY () + i.top; |
{ |
451 |
|
new_x += i.left; |
452 |
|
new_y += i.top; |
453 |
|
} |
454 |
|
else |
455 |
|
{ |
456 |
|
new_x += parent.getX () + i.left; |
457 |
|
new_y += parent.getY () + i.top; |
458 |
|
} |
459 |
|
|
460 |
parent = parent.getParent (); |
parent = next_parent; |
461 |
} |
} |
462 |
|
|
463 |
// We only need to convert from Java to GTK coordinates if we're |
// We only need to convert from Java to GTK coordinates if we're |
489 |
|
|
490 |
public void setCursor (Cursor cursor) |
public void setCursor (Cursor cursor) |
491 |
{ |
{ |
492 |
gtkWidgetSetCursor (cursor.getType ()); |
if (Thread.currentThread() == GtkToolkit.mainThread) |
493 |
|
gtkWidgetSetCursorUnlocked (cursor.getType ()); |
494 |
|
else |
495 |
|
gtkWidgetSetCursor (cursor.getType ()); |
496 |
} |
} |
497 |
|
|
498 |
public void setEnabled (boolean b) |
public void setEnabled (boolean b) |
525 |
return new Color (rgb[0], rgb[1], rgb[2]); |
return new Color (rgb[0], rgb[1], rgb[2]); |
526 |
} |
} |
527 |
|
|
528 |
|
public native void setVisibleNative (boolean b); |
529 |
|
public native void setVisibleNativeUnlocked (boolean b); |
530 |
|
|
531 |
public void setVisible (boolean b) |
public void setVisible (boolean b) |
532 |
{ |
{ |
533 |
if (b) |
if (Thread.currentThread() == GtkToolkit.mainThread) |
534 |
show (); |
setVisibleNativeUnlocked (b); |
535 |
else |
else |
536 |
hide (); |
setVisibleNative (b); |
537 |
} |
} |
538 |
|
|
539 |
public native void hide (); |
public void hide () |
540 |
public native void show (); |
{ |
541 |
|
setVisible (false); |
542 |
|
} |
543 |
|
|
544 |
|
public void show () |
545 |
|
{ |
546 |
|
setVisible (true); |
547 |
|
} |
548 |
|
|
549 |
protected void postMouseEvent(int id, long when, int mods, int x, int y, |
protected void postMouseEvent(int id, long when, int mods, int x, int y, |
550 |
int clickCount, boolean popupTrigger) |
int clickCount, boolean popupTrigger) |
709 |
{ |
{ |
710 |
return "peer of " + awtComponent.toString(); |
return "peer of " + awtComponent.toString(); |
711 |
} |
} |
712 |
|
public Rectangle getBounds() |
713 |
|
{ |
714 |
|
// FIXME: implement |
715 |
|
return null; |
716 |
|
} |
717 |
|
public void reparent(ContainerPeer parent) |
718 |
|
{ |
719 |
|
// FIXME: implement |
720 |
|
|
721 |
|
} |
722 |
|
public void setBounds(int x, int y, int width, int height, int z) |
723 |
|
{ |
724 |
|
// FIXME: implement |
725 |
|
setBounds (x, y, width, height); |
726 |
|
|
727 |
|
} |
728 |
|
public boolean isReparentSupported() |
729 |
|
{ |
730 |
|
// FIXME: implement |
731 |
|
|
732 |
|
return false; |
733 |
|
} |
734 |
|
public void layout() |
735 |
|
{ |
736 |
|
// FIXME: implement |
737 |
|
|
738 |
|
} |
739 |
} |
} |