Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti2002-03-01 01:21:48 +0000
committerSilenio Quarti2002-03-01 01:21:48 +0000
commitedcf1641db819efee235f0b5a4f976817242a4c3 (patch)
treeb079bf101208070648acd3618db747972aa93e98
parent17945a2779a836d0746fc4e3af284097efd2fa61 (diff)
downloadeclipse.platform.swt-edcf1641db819efee235f0b5a4f976817242a4c3.tar.gz
eclipse.platform.swt-edcf1641db819efee235f0b5a4f976817242a4c3.tar.xz
eclipse.platform.swt-edcf1641db819efee235f0b5a4f976817242a4c3.zip
flags
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/swt.c17
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/OS.java1
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Button.java4
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Control.java28
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Menu.java18
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/MenuItem.java22
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/ScrollBar.java40
7 files changed, 65 insertions, 65 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/swt.c b/bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/swt.c
index 685a12da96..9c5810b54d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/swt.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/photon/library/swt.c
@@ -6914,4 +6914,19 @@ JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_photon_OS_PhMoveCursorAbs
fprintf(stderr, "PhMoveCursorAbs\n");
#endif
PhMoveCursorAbs(input_group, x, y);
-} \ No newline at end of file
+}
+
+/*
+ * Class: org_eclipse_swt_internal_photon_OS
+ * Method: PtWidgetFlags
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_photon_OS_PtWidgetFlags
+ (JNIEnv *env, jobject that, jint widget)
+{
+#ifdef DEBUG_CALL_PRINTS
+ fprintf(stderr, "PtWidgetFlags\n");
+#endif
+
+ return (jint)PtWidgetFlags((PtWidget_t *)widget);
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/OS.java
index 4b7531caa9..ef7b43015c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/photon/org/eclipse/swt/internal/photon/OS.java
@@ -2656,6 +2656,7 @@ public static final native int PtWidgetRid (int widget);
public static final native void PtMainLoop ();
public static final native int PtEventHandler (int event);
public static final native int PtDestroyWidget (int widget);
+public static final native int PtWidgetFlags (int widget);
public static final native int PtWidgetCanvas (int widget, int canvas_rect);
public static final native int PtLabelWidgetCanvas (int widget, PhRect_t canvas_rect);
public static final native int PtWidgetExtent (int widget, int extent);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Button.java
index 83f85ac45b..2ca7e1c3cb 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Button.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Button.java
@@ -303,9 +303,7 @@ public Image getImage () {
public boolean getSelection () {
checkWidget();
if ((style & (SWT.CHECK | SWT.RADIO | SWT.TOGGLE)) == 0) return false;
- int [] args = {OS.Pt_ARG_FLAGS, 0, 0};
- OS.PtGetResources (handle, args.length / 3, args);
- return (args [1] & OS.Pt_SET) != 0;
+ return (OS.PtWidgetFlags (handle) & OS.Pt_SET) != 0;
}
String getNameText () {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Control.java
index b4de56ce7d..29b3608af1 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Control.java
@@ -618,10 +618,9 @@ public Display getDisplay () {
* </ul>
*/
public boolean getEnabled () {
- checkWidget();
- int [] args = {OS.Pt_ARG_FLAGS, 0, 0};
- OS.PtGetResources (handle, args.length / 3, args);
- return (args [1] & OS.Pt_BLOCKED) == 0;
+ checkWidget ();
+ int topHandle = topHandle ();
+ return (OS.PtWidgetFlags (topHandle) & OS.Pt_BLOCKED) == 0;
}
/**
@@ -787,11 +786,9 @@ public Shell getShell () {
* </ul>
*/
public boolean getVisible () {
- checkWidget();
+ checkWidget ();
int topHandle = topHandle ();
- int [] args = {OS.Pt_ARG_FLAGS, 0, 0};
- OS.PtGetResources (topHandle, args.length / 3, args);
- return (args [1] & OS.Pt_DELAY_REALIZE) == 0;
+ return (OS.PtWidgetFlags (topHandle) & OS.Pt_DELAY_REALIZE) == 0;
}
boolean hasFocus () {
@@ -1846,12 +1843,11 @@ public void setCursor (Cursor cursor) {
* </ul>
*/
public void setEnabled (boolean enabled) {
- checkWidget();
- int [] args = {
- OS.Pt_ARG_FLAGS, enabled ? 0 : OS.Pt_BLOCKED, OS.Pt_BLOCKED,
- OS.Pt_ARG_FLAGS, enabled ? 0 : OS.Pt_GHOST, OS.Pt_GHOST,
- };
- OS.PtSetResources (handle, args.length / 3, args);
+ checkWidget ();
+ int topHandle = topHandle ();
+ int flags = enabled ? 0 : OS.Pt_BLOCKED | OS.Pt_GHOST;
+ int [] args = {OS.Pt_ARG_FLAGS, flags, OS.Pt_BLOCKED | OS.Pt_GHOST};
+ OS.PtSetResources (topHandle, args.length / 3, args);
}
/**
@@ -2212,7 +2208,7 @@ public void setSize (int width, int height) {
* </ul>
*/
public void setVisible (boolean visible) {
- checkWidget();
+ checkWidget ();
int topHandle = topHandle ();
int [] args = {
OS.Pt_ARG_FLAGS, visible ? 0 : OS.Pt_DELAY_REALIZE, OS.Pt_DELAY_REALIZE,
@@ -2224,7 +2220,7 @@ public void setVisible (boolean visible) {
} else {
OS.PtUnrealizeWidget (topHandle);
sendEvent(SWT.Hide);
- }
+ }
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Menu.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Menu.java
index 6d6fad0b07..ebd61ac289 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Menu.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Menu.java
@@ -176,10 +176,9 @@ public Display getDisplay () {
* </ul>
*/
public boolean getEnabled () {
- checkWidget();
- int [] args = {OS.Pt_ARG_FLAGS, 0, 0};
- OS.PtGetResources (handle, args.length / 3, args);
- return (args [1] & OS.Pt_BLOCKED) == 0;
+ checkWidget ();
+ int topHandle = topHandle ();
+ return (OS.PtWidgetFlags (topHandle) & OS.Pt_BLOCKED) == 0;
}
/**
@@ -580,12 +579,11 @@ public void setDefaultItem (MenuItem item) {
* </ul>
*/
public void setEnabled (boolean enabled) {
- checkWidget();
- int [] args = {
- OS.Pt_ARG_FLAGS, enabled ? 0 : OS.Pt_BLOCKED, OS.Pt_BLOCKED,
- OS.Pt_ARG_FLAGS, enabled ? 0 : OS.Pt_GHOST, OS.Pt_GHOST,
- };
- OS.PtSetResources (handle, args.length / 3, args);
+ checkWidget ();
+ int topHandle = topHandle ();
+ int flags = enabled ? 0 : OS.Pt_BLOCKED | OS.Pt_GHOST;
+ int [] args = {OS.Pt_ARG_FLAGS, flags, OS.Pt_BLOCKED | OS.Pt_GHOST};
+ OS.PtSetResources (topHandle, args.length / 3, args);
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/MenuItem.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/MenuItem.java
index 8dcf36a546..e38d488e0b 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/MenuItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/MenuItem.java
@@ -266,16 +266,15 @@ public Display getDisplay () {
* </ul>
*/
public boolean getEnabled () {
- checkWidget();
+ checkWidget ();
/*
* Bug in Photon. The Pt_BLOCKED flag of a menu item is cleared
* when its parent menu is realized. The fix is to remember
* the menu item state and reset it when the menu item is
* realized.
*/
-// int [] args = {OS.Pt_ARG_FLAGS, 0, 0};
-// OS.PtGetResources (handle, args.length / 3, args);
-// return (args [1] & OS.Pt_BLOCKED) == 0;
+// int topHandle = topHandle ();
+// return (OS.PtWidgetFlags (topHandle) & OS.Pt_BLOCKED) == 0;
return enabled;
}
@@ -335,9 +334,7 @@ public Menu getParent () {
public boolean getSelection () {
checkWidget();
if ((style & (SWT.CHECK | SWT.RADIO | SWT.TOGGLE)) == 0) return false;
- int [] args = {OS.Pt_ARG_FLAGS, 0, 0};
- OS.PtGetResources (handle, args.length / 3, args);
- return (args [1] & OS.Pt_SET) != 0;
+ return (OS.PtWidgetFlags (handle) & OS.Pt_SET) != 0;
}
void hookEvents () {
@@ -586,13 +583,12 @@ public void setAccelerator (int accelerator) {
* </ul>
*/
public void setEnabled (boolean enabled) {
- checkWidget();
+ checkWidget ();
this.enabled = enabled;
- int [] args = {
- OS.Pt_ARG_FLAGS, enabled ? 0 : OS.Pt_BLOCKED, OS.Pt_BLOCKED,
- OS.Pt_ARG_FLAGS, enabled ? 0 : OS.Pt_GHOST, OS.Pt_GHOST,
- };
- OS.PtSetResources (handle, args.length / 3, args);
+ int topHandle = topHandle ();
+ int flags = enabled ? 0 : OS.Pt_BLOCKED | OS.Pt_GHOST;
+ int [] args = {OS.Pt_ARG_FLAGS, flags, OS.Pt_BLOCKED | OS.Pt_GHOST};
+ OS.PtSetResources (topHandle, args.length / 3, args);
}
public void setImage (Image image) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/ScrollBar.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/ScrollBar.java
index 272379c338..e3fc95c0fa 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/ScrollBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/ScrollBar.java
@@ -182,10 +182,9 @@ public Display getDisplay () {
* </ul>
*/
public boolean getEnabled () {
- checkWidget();
- int [] args = {OS.Pt_ARG_FLAGS, 0, 0};
- OS.PtGetResources (handle, args.length / 3, args);
- return (args [1] & OS.Pt_BLOCKED) == 0;
+ checkWidget ();
+ int topHandle = topHandle ();
+ return (OS.PtWidgetFlags (topHandle) & OS.Pt_BLOCKED) == 0;
}
/**
@@ -349,11 +348,9 @@ public int getThumb () {
* </ul>
*/
public boolean getVisible () {
- checkWidget();
+ checkWidget ();
int topHandle = topHandle ();
- int [] args = {OS.Pt_ARG_FLAGS, 0, 0};
- OS.PtGetResources (topHandle, args.length / 3, args);
- return (args [1] & OS.Pt_DELAY_REALIZE) == 0;
+ return (OS.PtWidgetFlags (topHandle) & OS.Pt_DELAY_REALIZE) == 0;
}
void hookEvents () {
@@ -403,7 +400,7 @@ public boolean isEnabled () {
*/
public boolean isVisible () {
checkWidget();
- return OS.PtWidgetIsRealized (handle);
+ return getVisible() && parent.isVisible();
}
int processSelection (int info) {
@@ -493,12 +490,11 @@ void setBounds (int x, int y, int width, int height) {
* </ul>
*/
public void setEnabled (boolean enabled) {
- checkWidget();
- int [] args = {
- OS.Pt_ARG_FLAGS, enabled ? 0 : OS.Pt_BLOCKED, OS.Pt_BLOCKED,
- OS.Pt_ARG_FLAGS, enabled ? 0 : OS.Pt_GHOST, OS.Pt_GHOST,
- };
- OS.PtSetResources (handle, args.length / 3, args);
+ checkWidget ();
+ int topHandle = topHandle ();
+ int flags = enabled ? 0 : OS.Pt_BLOCKED | OS.Pt_GHOST;
+ int [] args = {OS.Pt_ARG_FLAGS, flags, OS.Pt_BLOCKED | OS.Pt_GHOST};
+ OS.PtSetResources (topHandle, args.length / 3, args);
}
/**
* Sets the amount that the receiver's value will be
@@ -648,7 +644,7 @@ public void setValues (int selection, int minimum, int maximum, int thumb, int i
OS.Pt_ARG_PAGE_INCREMENT, pageIncrement, 0,
OS.Pt_ARG_SLIDER_SIZE, thumb, 0,
OS.Pt_ARG_MINIMUM, minimum, 0,
- OS.Pt_ARG_MAXIMUM, maximum - 1, 0,
+ OS.Pt_ARG_MAXIMUM, maximum-1, 0,
};
OS.PtSetResources (handle, args.length / 3, args);
}
@@ -670,21 +666,21 @@ public void setValues (int selection, int minimum, int maximum, int thumb, int i
* </ul>
*/
public void setVisible (boolean visible) {
- checkWidget();
- if (visible == OS.PtWidgetIsRealized (handle)) return;
+ checkWidget ();
+ int topHandle = topHandle ();
int [] args = {
OS.Pt_ARG_FLAGS, visible ? 0 : OS.Pt_DELAY_REALIZE, OS.Pt_DELAY_REALIZE,
};
- OS.PtSetResources (handle, args.length / 3, args);
+ OS.PtSetResources (topHandle, args.length / 3, args);
if (visible) {
sendEvent (SWT.Show);
- OS.PtRealizeWidget (handle);
+ OS.PtRealizeWidget (topHandle);
parent.resizeClientArea ();
} else {
- OS.PtUnrealizeWidget (handle);
+ OS.PtUnrealizeWidget (topHandle);
parent.resizeClientArea ();
sendEvent(SWT.Hide);
- }
+ }
}
}

Back to the top