Urgent: 5000 Euro Reward

Where does the below code fail? What does the JNI create controls do?

Thanks,
Rodney



Sergiy Uvarov wrote:

Rodney Dowdall wrote:

Can you please post the code where you added the extra widget? You
have to make sure that the mapping in the Display class is correct.
If it is off it will cause this problem.

I added widgets as this article recommends:
http://www.eclipse.org/articles/Article-Writing%20Your%20Own%20Widget/Writing%20Your%20Own%20Widget.htm


By the way I moved all native calls for printing in separate library
so that I don’t need to recompile SWT native but printing also doesn’t
work. At first photon call (PpCreatePC) j9 throws unhandeled exception.

This is the widget class:
package org.eclipse.swt.widgets;

import org.eclipse.swt.internal.;
import org.eclipse.swt.internal.photon.
;
import org.eclipse.swt.;
import org.eclipse.swt.graphics.
;
import org.eclipse.swt.events.*;

/**

  • Wrapper around Photon PtTrend widget
    */
    public class Trend extends Composite {
    int handleTrend;
    private static final int Pt_ARG_TREND_FLAGS = 0x11D2F;
    private static final int Pt_ARG_TREND_GRID_COLOR = 0x11D30;
    private static final int Pt_ARG_TREND_GRID_X = 0x11D29;
    private static final int Pt_ARG_TREND_GRID_Y = 0x11D2A;
    private static final int Pt_ARG_TREND_COUNT = 0x11D2B;
    private static final int Pt_ARG_TREND_COLOR_LIST = 0x11D31;
    private static final int Pt_ARG_TREND_ATTRIBUTES = 0x11D32;
    private static final int Pt_ARG_TREND_DATA = 0x11D28;
    private static final int Pt_ARG_TREND_MAX = 0x11D2C;
    private static final int Pt_ARG_TREND_MIN = 0x11D2D;

private static final int Pt_GRID = 2;
private static final int Pt_GRID_IS_TRANSLUCENT = 0x400;
private static final int Pt_GRID_FORCE = 0x800;
private static final int Pt_RESULT_GRID = (Pt_GRID |
Pt_GRID_IS_TRANSLUCENT | Pt_GRID_FORCE);

private double min = 0,max = 100;
private short trendMin, trendMax;
private int [] handles = new int[2];

static { System.loadLibrary(“jinf”); }

public Trend(Composite parent, int style) {
// create parent composite
super(parent,style);

// create native widget
// PtOSContainer → handles[0]
// PtTrend → handles[1]
createControl(handle,handles);
handleTrend = handles[1];
if(handleTrend==0) SWT.error(SWT.ERROR_NO_HANDLES);
OS.PtSetResource(handleTrend,Pt_ARG_TREND_COUNT,1,0);
addControlListener(new ControlAdapter(){
public void controlResized(ControlEvent e) {
Rectangle rect = getClientArea();
resizeControl(handles[0], rect.x, rect.y, rect.width,
rect.height);
}
});

addFocusListener( new FocusAdapter() {
public void focusGained(FocusEvent e) {
setFocus(handles[0]);
}
});

/* Get min/mx biunds from trend */
int [] args = new int[] {Pt_ARG_TREND_MIN,0,0};
OS.PtGetResources(handleTrend,args.length / 3,args);
trendMin = (short) args[1];

args = new int[] {Pt_ARG_TREND_MAX,0,0};
OS.PtGetResources(handleTrend,args.length / 3,args);
trendMax = (short) args[1];
}


public Point computeSize(int wHint, int hHint, boolean changed) {
checkWidget();
int [] result = new int[2];
computeSize(handles[0], result);
if (wHint != SWT.DEFAULT) result[0] = wHint;
if (hHint != SWT.DEFAULT) result[1] = hHint;
int border = getBorderWidth();
return new Point(result[0] + border2, result[1] + border2);
}


/** Enables the graphic widget to draw grid if argument is
code>true</code

  • and disabes it otherwise.
  • @param flag the new grid state /
    public void setGrid(boolean flag) {
    OS.PtSetResource(handleTrend, Pt_ARG_TREND_FLAGS, ((flag) ? -1 :
    0), Pt_RESULT_GRID);
    }


    /
    *
  • Set grid’s lines color
    /
    public void setGridColor(Color c){
    int color = (c.getRed() & 0xff) << 16 | (c.getGreen() & 0xff) << 8 |
    (c.getBlue() & 0xff);
    OS.PtSetResource(handleTrend, Pt_ARG_TREND_GRID_COLOR, color, 0);
    }


    /
    *
  • Set grid dimensions
    /
    public void setGridSize(int x,int y){
    OS.PtSetResource(handleTrend, Pt_ARG_TREND_GRID_X, x, 0);
    OS.PtSetResource(handleTrend, Pt_ARG_TREND_GRID_Y, y, 0);
    }


    /
    *
  • Set min/max boundaries for the trend
    /
    public void setMinMaxBounds(double min,double max){
    this.min = min; this.max = max;
    }


    /
    *
  • Set pen’s color
    */
    public void setPenColor(Color c){
    int color = (c.getRed() & 0xff) << 16 | (c.getGreen() & 0xff) << 8 |
    (c.getBlue() & 0xff);
    int [] jarray = new int[] {color};
    int ptr = OS.malloc(4);
    OS.memmove(ptr,jarray,4);
    OS.PtSetResource(handleTrend, Pt_ARG_TREND_COLOR_LIST, ptr, 1);

jarray[0] = 1; // number of color here
OS.memset(ptr,0,4);
OS.memmove(ptr,jarray,4);

OS.PtSetResource(handleTrend,Pt_ARG_TREND_ATTRIBUTES,ptr,1);
OS.free(ptr);
}


/**

  • Push data at end of trend
    */
    public void pushData(double v){
    if(v>max) v = max;
    if(v<min) v = min;
    short data = (short)(v * (trendMax-trendMin)/(max-min) + trendMin);
    int [] jarray = new int[] {data};
    int ptr = OS.malloc(4);
    OS.memmove(ptr,jarray,4);
    OS.PtSetResource(handleTrend, Pt_ARG_TREND_DATA,ptr,1);
    OS.free(ptr);
    }

static final native int createControl(int handleParent,int [] res);
static final native void resizeControl(int handle, int x, int y, int
width, int height);
static final native void setFocus(int handle);
static final native void computeSize(int handle, int [] result);
}

This is the native code:

#include <unistd.h
#include <jni.h
#include <math.h

#include <Ph.h
#include <Pt.h

#define NATIVE(func) Java_org_eclipse_swt_widgets_Trend_##func

/**

  • PtOSContainer → [0]
  • PtTrend → [1]
    */
    JNIEXPORT jint JNICALL NATIVE(createControl)(JNIEnv *env, jclass that,
    jint parent, jintArray handles) {
    jint *result = (*env)->GetIntArrayElements(env, handles, NULL);

result[0] = (jint) PtCreateWidget(PtOSContainer,(PtWidget_t*)
parent,0,NULL);
result[1] = (jint) PtCreateWidget(PtTrend,(PtWidget_t*)
result[0],0,NULL);

PtSetResource((PtWidget_t*) result[1], Pt_ARG_ANCHOR_FLAGS, Pt_TRUE,
Pt_LEFT_ANCHORED_LEFT |
Pt_RIGHT_ANCHORED_RIGHT | Pt_TOP_ANCHORED_TOP |
Pt_BOTTOM_ANCHORED_BOTTOM );
(env)->ReleaseIntArrayElements(env, handles, result, 0);
return result[0];
}


JNIEXPORT void JNICALL NATIVE(resizeControl)(JNIEnv
env,jclass
that,jint handle,jint x,jint y,jint width,jint height){
PhArea_t area;
area.pos.x = x;
area.pos.y = y;
area.size.w = width;
area.size.h = height;
PtSetResource((PtWidget_t*)handle,Pt_ARG_AREA,&area,0);
PtUnrealizeWidget((PtWidget_t*)handle);
PtRealizeWidget((PtWidget_t*)handle);
}

JNIEXPORT void JNICALL NATIVE(setFocus)(JNIEnv *env, jclass that, jint
handle){}


JNIEXPORT void JNICALL NATIVE(computeSize)(JNIEnv *env, jclass that,
jint handle, jintArray result){
jint *result1 = (*env)->GetIntArrayElements(env,result,NULL);
PhDim_t dim;

PtWidgetPreferredSize((PtWidget_t*) handle,&dim);
result1[0] = dim.w;
result1[1] = dim.h;
(*env)->ReleaseIntArrayElements(env,result,result1,0);
}


Sergiy Uvarov wrote:

Hi, All.

I use SWT to build gui applications and added some extra widgets to
SWT as eclipse recommending. In QNX6.2.1 all my applications work well
but in QNX6.3 during any photon call in JNI j9 is stopped by
unhandeled exception.

What have changed that I can’t create widget in JNI?


Sergiy Uvarov

Rodney Dowdall wrote:

Where does the below code fail?

The problem occurs in native function createControl() when widget is created



What does the JNI create controls do?
What do you mean?



Sergiy Uvarov wrote:

Rodney Dowdall wrote:

Can you please post the code where you added the extra widget? You
have to make sure that the mapping in the Display class is correct.
If it is off it will cause this problem.

I added widgets as this article recommends:
http://www.eclipse.org/articles/Article-Writing%20Your%20Own%20Widget/Writing%20Your%20Own%20Widget.htm


By the way I moved all native calls for printing in separate library
so that I don’t need to recompile SWT native but printing also doesn’t
work. At first photon call (PpCreatePC) j9 throws unhandeled exception.

This is the widget class:
package org.eclipse.swt.widgets;

import org.eclipse.swt.internal.;
import org.eclipse.swt.internal.photon.
;
import org.eclipse.swt.;
import org.eclipse.swt.graphics.
;
import org.eclipse.swt.events.*;

/**

  • Wrapper around Photon PtTrend widget
    */
    public class Trend extends Composite {
    int handleTrend;
    private static final int Pt_ARG_TREND_FLAGS = 0x11D2F;
    private static final int Pt_ARG_TREND_GRID_COLOR = 0x11D30;
    private static final int Pt_ARG_TREND_GRID_X = 0x11D29;
    private static final int Pt_ARG_TREND_GRID_Y = 0x11D2A;
    private static final int Pt_ARG_TREND_COUNT = 0x11D2B;
    private static final int Pt_ARG_TREND_COLOR_LIST = 0x11D31;
    private static final int Pt_ARG_TREND_ATTRIBUTES = 0x11D32;
    private static final int Pt_ARG_TREND_DATA = 0x11D28;
    private static final int Pt_ARG_TREND_MAX = 0x11D2C;
    private static final int Pt_ARG_TREND_MIN = 0x11D2D;

private static final int Pt_GRID = 2;
private static final int Pt_GRID_IS_TRANSLUCENT = 0x400;
private static final int Pt_GRID_FORCE = 0x800;
private static final int Pt_RESULT_GRID = (Pt_GRID |
Pt_GRID_IS_TRANSLUCENT | Pt_GRID_FORCE);

private double min = 0,max = 100;
private short trendMin, trendMax;
private int [] handles = new int[2];

static { System.loadLibrary(“jinf”); }

public Trend(Composite parent, int style) {
// create parent composite
super(parent,style);
// create native widget
// PtOSContainer → handles[0]
// PtTrend → handles[1]
createControl(handle,handles);
handleTrend = handles[1];
if(handleTrend==0) SWT.error(SWT.ERROR_NO_HANDLES);
OS.PtSetResource(handleTrend,Pt_ARG_TREND_COUNT,1,0);
addControlListener(new ControlAdapter(){
public void controlResized(ControlEvent e) {
Rectangle rect = getClientArea();
resizeControl(handles[0], rect.x, rect.y, rect.width,
rect.height);
}
});
addFocusListener( new FocusAdapter() {
public void focusGained(FocusEvent e) {
setFocus(handles[0]);
}
});

/* Get min/mx biunds from trend /
int [] args = new int[] {Pt_ARG_TREND_MIN,0,0};
OS.PtGetResources(handleTrend,args.length / 3,args);
trendMin = (short) args[1];
args = new int[] {Pt_ARG_TREND_MAX,0,0};
OS.PtGetResources(handleTrend,args.length / 3,args);
trendMax = (short) args[1];
}


public Point computeSize(int wHint, int hHint, boolean changed) {
checkWidget();
int [] result = new int[2];
computeSize(handles[0], result);
if (wHint != SWT.DEFAULT) result[0] = wHint;
if (hHint != SWT.DEFAULT) result[1] = hHint;
int border = getBorderWidth();
return new Point(result[0] + border
2, result[1] + border*2);
}


/** Enables the graphic widget to draw grid if argument is
code>true</code

  • and disabes it otherwise.
  • @param flag the new grid state /
    public void setGrid(boolean flag) {
    OS.PtSetResource(handleTrend, Pt_ARG_TREND_FLAGS, ((flag) ? -1 :
    0), Pt_RESULT_GRID); }


    /
    *
  • Set grid’s lines color
    /
    public void setGridColor(Color c){
    int color = (c.getRed() & 0xff) << 16 | (c.getGreen() & 0xff) << 8
    | (c.getBlue() & 0xff);
    OS.PtSetResource(handleTrend, Pt_ARG_TREND_GRID_COLOR, color,
    0); }


    /
    *
  • Set grid dimensions
    /
    public void setGridSize(int x,int y){
    OS.PtSetResource(handleTrend, Pt_ARG_TREND_GRID_X, x, 0);
    OS.PtSetResource(handleTrend, Pt_ARG_TREND_GRID_Y, y, 0); }


    /
    *
  • Set min/max boundaries for the trend
    /
    public void setMinMaxBounds(double min,double max){
    this.min = min; this.max = max;
    }


    /
    *
  • Set pen’s color
    */
    public void setPenColor(Color c){
    int color = (c.getRed() & 0xff) << 16 | (c.getGreen() & 0xff) << 8
    | (c.getBlue() & 0xff);
    int [] jarray = new int[] {color};
    int ptr = OS.malloc(4);
    OS.memmove(ptr,jarray,4);
    OS.PtSetResource(handleTrend, Pt_ARG_TREND_COLOR_LIST, ptr, 1);

jarray[0] = 1; // number of color here
OS.memset(ptr,0,4);
OS.memmove(ptr,jarray,4);
OS.PtSetResource(handleTrend,Pt_ARG_TREND_ATTRIBUTES,ptr,1);
OS.free(ptr);
}


/**

  • Push data at end of trend
    */
    public void pushData(double v){
    if(v>max) v = max;
    if(v<min) v = min;
    short data = (short)(v * (trendMax-trendMin)/(max-min) + trendMin);
    int [] jarray = new int[] {data};
    int ptr = OS.malloc(4);
    OS.memmove(ptr,jarray,4);
    OS.PtSetResource(handleTrend, Pt_ARG_TREND_DATA,ptr,1);
    OS.free(ptr);
    }

static final native int createControl(int handleParent,int [] res);
static final native void resizeControl(int handle, int x, int y, int
width, int height);
static final native void setFocus(int handle);
static final native void computeSize(int handle, int [] result);
}

This is the native code:

#include <unistd.h
#include <jni.h
#include <math.h

#include <Ph.h
#include <Pt.h

#define NATIVE(func) Java_org_eclipse_swt_widgets_Trend_##func

/**

  • PtOSContainer → [0]
  • PtTrend → [1]
    */
    JNIEXPORT jint JNICALL NATIVE(createControl)(JNIEnv *env, jclass that,
    jint parent, jintArray handles) {
    jint *result = (*env)->GetIntArrayElements(env, handles, NULL);

result[0] = (jint) PtCreateWidget(PtOSContainer,(PtWidget_t*)
parent,0,NULL);
result[1] = (jint) PtCreateWidget(PtTrend,(PtWidget_t*)
result[0],0,NULL);

PtSetResource((PtWidget_t*) result[1], Pt_ARG_ANCHOR_FLAGS, Pt_TRUE,
Pt_LEFT_ANCHORED_LEFT |
Pt_RIGHT_ANCHORED_RIGHT | Pt_TOP_ANCHORED_TOP |
Pt_BOTTOM_ANCHORED_BOTTOM );
(env)->ReleaseIntArrayElements(env, handles, result, 0);
return result[0];
}


JNIEXPORT void JNICALL NATIVE(resizeControl)(JNIEnv
env,jclass
that,jint handle,jint x,jint y,jint width,jint height){
PhArea_t area;
area.pos.x = x;
area.pos.y = y;
area.size.w = width;
area.size.h = height;
PtSetResource((PtWidget_t*)handle,Pt_ARG_AREA,&area,0);
PtUnrealizeWidget((PtWidget_t*)handle);
PtRealizeWidget((PtWidget_t*)handle);
}

JNIEXPORT void JNICALL NATIVE(setFocus)(JNIEnv *env, jclass that, jint
handle){}


JNIEXPORT void JNICALL NATIVE(computeSize)(JNIEnv *env, jclass that,
jint handle, jintArray result){
jint *result1 = (*env)->GetIntArrayElements(env,result,NULL);
PhDim_t dim;

PtWidgetPreferredSize((PtWidget_t*) handle,&dim);
result1[0] = dim.w;
result1[1] = dim.h;
(*env)->ReleaseIntArrayElements(env,result,result1,0);
}


Sergiy Uvarov wrote:

Hi, All.

I use SWT to build gui applications and added some extra widgets to
SWT as eclipse recommending. In QNX6.2.1 all my applications work well
but in QNX6.3 during any photon call in JNI j9 is stopped by
unhandeled exception.

What have changed that I can’t create widget in JNI?


Sergiy Uvarov

Sorry, I missed the JNI.

Can you check the value of handle in your constructor and make sure it
is not 0 before you pass it to your create control function. If it is
zero, then you need to have a createHandle function in your class. This
is where you could call jni create control. If it is greater than 0,
and you are actually picking up the Composites handle, then try removing
the return from your createControls. After you call releaseElements, I
don’t think you can access the array anymore.

Thanks,
Rodney


Sergiy Uvarov wrote:

Rodney Dowdall wrote:

Sergiy Uvarov wrote:

Rodney Dowdall wrote:

Where does the below code fail?



The problem occurs in native function createControl() when widget is
created

What does the JNI create controls do?



What do you mean?



Can I see the code for the call?

I had added below the java and native code. Is it not enough?


This is the widget class:
package org.eclipse.swt.widgets;

import org.eclipse.swt.internal.;
import org.eclipse.swt.internal.photon.
;
import org.eclipse.swt.;
import org.eclipse.swt.graphics.
;
import org.eclipse.swt.events.*;

/**

  • Wrapper around Photon PtTrend widget
    */
    public class Trend extends Composite {
    int handleTrend;
    private static final int Pt_ARG_TREND_FLAGS = 0x11D2F;
    private static final int Pt_ARG_TREND_GRID_COLOR = 0x11D30;
    private static final int Pt_ARG_TREND_GRID_X = 0x11D29;
    private static final int Pt_ARG_TREND_GRID_Y = 0x11D2A;
    private static final int Pt_ARG_TREND_COUNT = 0x11D2B;
    private static final int Pt_ARG_TREND_COLOR_LIST = 0x11D31;
    private static final int Pt_ARG_TREND_ATTRIBUTES = 0x11D32;
    private static final int Pt_ARG_TREND_DATA = 0x11D28;
    private static final int Pt_ARG_TREND_MAX = 0x11D2C;
    private static final int Pt_ARG_TREND_MIN = 0x11D2D;

private static final int Pt_GRID = 2;
private static final int Pt_GRID_IS_TRANSLUCENT = 0x400;
private static final int Pt_GRID_FORCE = 0x800;
private static final int Pt_RESULT_GRID = (Pt_GRID |
Pt_GRID_IS_TRANSLUCENT | Pt_GRID_FORCE);

private double min = 0,max = 100;
private short trendMin, trendMax;
private int [] handles = new int[2];

static { System.loadLibrary(“jinf”); }

public Trend(Composite parent, int style) {
// create parent composite
super(parent,style);
// create native widget
// PtOSContainer → handles[0]
// PtTrend → handles[1]
createControl(handle,handles);
handleTrend = handles[1];
if(handleTrend==0) SWT.error(SWT.ERROR_NO_HANDLES);
OS.PtSetResource(handleTrend,Pt_ARG_TREND_COUNT,1,0);
addControlListener(new ControlAdapter(){
public void controlResized(ControlEvent e) {
Rectangle rect = getClientArea();
resizeControl(handles[0], rect.x, rect.y, rect.width,
rect.height);
}
});
addFocusListener( new FocusAdapter() {
public void focusGained(FocusEvent e) {
setFocus(handles[0]);
}
});

/* Get min/mx biunds from trend /
int [] args = new int[] {Pt_ARG_TREND_MIN,0,0};
OS.PtGetResources(handleTrend,args.length / 3,args);
trendMin = (short) args[1];
args = new int[] {Pt_ARG_TREND_MAX,0,0};
OS.PtGetResources(handleTrend,args.length / 3,args);
trendMax = (short) args[1];
}


public Point computeSize(int wHint, int hHint, boolean changed) {
checkWidget();
int [] result = new int[2];
computeSize(handles[0], result);
if (wHint != SWT.DEFAULT) result[0] = wHint;
if (hHint != SWT.DEFAULT) result[1] = hHint;
int border = getBorderWidth();
return new Point(result[0] + border
2, result[1] + border*2);
}


/** Enables the graphic widget to draw grid if argument is
code>true</code

  • and disabes it otherwise.
  • @param flag the new grid state /
    public void setGrid(boolean flag) {
    OS.PtSetResource(handleTrend, Pt_ARG_TREND_FLAGS, ((flag) ? -1
    : 0), Pt_RESULT_GRID); }


    /
    *
  • Set grid’s lines color
    /
    public void setGridColor(Color c){
    int color = (c.getRed() & 0xff) << 16 | (c.getGreen() & 0xff)
    8 | (c.getBlue() & 0xff);
    OS.PtSetResource(handleTrend, Pt_ARG_TREND_GRID_COLOR, color,
    0); }


    /
    *
  • Set grid dimensions
    /
    public void setGridSize(int x,int y){
    OS.PtSetResource(handleTrend, Pt_ARG_TREND_GRID_X, x,
    0); OS.PtSetResource(handleTrend, Pt_ARG_TREND_GRID_Y, y,
    0); }


    /
    *
  • Set min/max boundaries for the trend
    /
    public void setMinMaxBounds(double min,double max){
    this.min = min; this.max = max;
    }


    /
    *
  • Set pen’s color
    */
    public void setPenColor(Color c){
    int color = (c.getRed() & 0xff) << 16 | (c.getGreen() & 0xff)
    8 | (c.getBlue() & 0xff);
    int [] jarray = new int[] {color};
    int ptr = OS.malloc(4);
    OS.memmove(ptr,jarray,4);
    OS.PtSetResource(handleTrend, Pt_ARG_TREND_COLOR_LIST, ptr, 1);

jarray[0] = 1; // number of color here
OS.memset(ptr,0,4);
OS.memmove(ptr,jarray,4);
OS.PtSetResource(handleTrend,Pt_ARG_TREND_ATTRIBUTES,ptr,1);
OS.free(ptr);
}


/**

  • Push data at end of trend
    */
    public void pushData(double v){
    if(v>max) v = max;
    if(v<min) v = min;
    short data = (short)(v * (trendMax-trendMin)/(max-min) +
    trendMin);
    int [] jarray = new int[] {data};
    int ptr = OS.malloc(4);
    OS.memmove(ptr,jarray,4);
    OS.PtSetResource(handleTrend, Pt_ARG_TREND_DATA,ptr,1);
    OS.free(ptr);
    }

static final native int createControl(int handleParent,int [] res);
static final native void resizeControl(int handle, int x, int y,
int width, int height);
static final native void setFocus(int handle);
static final native void computeSize(int handle, int [] result);
}

This is the native code:

#include <unistd.h
#include <jni.h
#include <math.h

#include <Ph.h
#include <Pt.h

#define NATIVE(func) Java_org_eclipse_swt_widgets_Trend_##func

/**

  • PtOSContainer → [0]
  • PtTrend → [1]
    */
    JNIEXPORT jint JNICALL NATIVE(createControl)(JNIEnv *env, jclass
    that, jint parent, jintArray handles) {
    jint *result = (*env)->GetIntArrayElements(env, handles, NULL);

result[0] = (jint) PtCreateWidget(PtOSContainer,(PtWidget_t*)
parent,0,NULL);
result[1] = (jint) PtCreateWidget(PtTrend,(PtWidget_t*)
result[0],0,NULL);

PtSetResource((PtWidget_t*) result[1], Pt_ARG_ANCHOR_FLAGS,
Pt_TRUE, Pt_LEFT_ANCHORED_LEFT |
Pt_RIGHT_ANCHORED_RIGHT | Pt_TOP_ANCHORED_TOP |
Pt_BOTTOM_ANCHORED_BOTTOM );
(env)->ReleaseIntArrayElements(env, handles, result, 0);
return result[0];
}


JNIEXPORT void JNICALL NATIVE(resizeControl)(JNIEnv
env,jclass
that,jint handle,jint x,jint y,jint width,jint height){
PhArea_t area;
area.pos.x = x;
area.pos.y = y;
area.size.w = width;
area.size.h = height;
PtSetResource((PtWidget_t*)handle,Pt_ARG_AREA,&area,0);
PtUnrealizeWidget((PtWidget_t*)handle);
PtRealizeWidget((PtWidget_t*)handle);
}

JNIEXPORT void JNICALL NATIVE(setFocus)(JNIEnv *env, jclass that,
jint handle){}


JNIEXPORT void JNICALL NATIVE(computeSize)(JNIEnv *env, jclass
that, jint handle, jintArray result){
jint *result1 = (*env)->GetIntArrayElements(env,result,NULL);
PhDim_t dim;

PtWidgetPreferredSize((PtWidget_t*) handle,&dim);
result1[0] = dim.w;
result1[1] = dim.h;
(*env)->ReleaseIntArrayElements(env,result,result1,0);
}

How can I disable the photon login prompt on QNX 6.3

Thanks,
Shashank

How can I disable the photon login prompt on QNX 6.3

Thanks,
Shashank

How can I disable the photon login prompt on QNX 6.3

Thanks,
Shashank

How can I disable the photon login prompt on QNX 6.3

Thanks,
Shashank

Following the manual for the embedded startup, and working with a
devi-elo touchscreen I am able to get the io-graphics to start quite
happily with the line

io-graphics -di830
vid=8086,did=3582,index=0,photon,xres=800,yres=600,bitpp=15,refresh=60
-pphoton touchscreen &

do the usual on W 10 w /dev/photon and start the window manager.

What I get is this.

I can start from the script, anything… so I start a couple of pterm
apps. I can only use the one on top.

From the pterm I can perform calib and the touchscreen calibrates
nicely.

I can slay Photon and return to my command line and there I see the
problem line above. No capability data.

Searching pwm and qnx docs for an answer and get nothing useful so
far.

Does anybody have an idea what is failing? It would SEEM to be
something to do with the touchscreen-pointer coupling, but calib
handles the touchscreen perfectly.

I get the feeling that there’s something I need to do for elo
capabilities for the screen to be exported to photon. It isn’t
clear what.

So here I am again, scratching my watch and winding my a** :slight_smile:

Any ideas?.. and why isn’t there more documentation of this
somewhere, or is there and I just haven’t found it yet… :slight_smile:

Thanks
BJ

Following the manual for the embedded startup, and working with a
devi-elo touchscreen I am able to get the io-graphics to start quite
happily with the line

io-graphics -di830
vid=8086,did=3582,index=0,photon,xres=800,yres=600,bitpp=15,refresh=60
-pphoton touchscreen &

do the usual on W 10 w /dev/photon and start the window manager.

What I get is this.

I can start from the script, anything… so I start a couple of pterm
apps. I can only use the one on top.

From the pterm I can perform calib and the touchscreen calibrates
nicely.

I can slay Photon and return to my command line and there I see the
problem line above. No capability data.

Searching pwm and qnx docs for an answer and get nothing useful so
far.

Does anybody have an idea what is failing? It would SEEM to be
something to do with the touchscreen-pointer coupling, but calib
handles the touchscreen perfectly.

I get the feeling that there’s something I need to do for elo
capabilities for the screen to be exported to photon. It isn’t
clear what.

So here I am again, scratching my watch and winding my a** :slight_smile:

Any ideas?.. and why isn’t there more documentation of this
somewhere, or is there and I just haven’t found it yet… :slight_smile:

Thanks
BJ

Following the manual for the embedded startup, and working with a
devi-elo touchscreen I am able to get the io-graphics to start quite
happily with the line

io-graphics -di830
vid=8086,did=3582,index=0,photon,xres=800,yres=600,bitpp=15,refresh=60
-pphoton touchscreen &

do the usual on W 10 w /dev/photon and start the window manager.

What I get is this.

I can start from the script, anything… so I start a couple of pterm
apps. I can only use the one on top.

From the pterm I can perform calib and the touchscreen calibrates
nicely.

I can slay Photon and return to my command line and there I see the
problem line above. No capability data.

Searching pwm and qnx docs for an answer and get nothing useful so
far.

Does anybody have an idea what is failing? It would SEEM to be
something to do with the touchscreen-pointer coupling, but calib
handles the touchscreen perfectly.

I get the feeling that there’s something I need to do for elo
capabilities for the screen to be exported to photon. It isn’t
clear what.

So here I am again, scratching my watch and winding my a** :slight_smile:

Any ideas?.. and why isn’t there more documentation of this
somewhere, or is there and I just haven’t found it yet… :slight_smile:

Thanks
BJ

Following the manual for the embedded startup, and working with a
devi-elo touchscreen I am able to get the io-graphics to start quite
happily with the line

io-graphics -di830
vid=8086,did=3582,index=0,photon,xres=800,yres=600,bitpp=15,refresh=60
-pphoton touchscreen &

do the usual on W 10 w /dev/photon and start the window manager.

What I get is this.

I can start from the script, anything… so I start a couple of pterm
apps. I can only use the one on top.

From the pterm I can perform calib and the touchscreen calibrates
nicely.

I can slay Photon and return to my command line and there I see the
problem line above. No capability data.

Searching pwm and qnx docs for an answer and get nothing useful so
far.

Does anybody have an idea what is failing? It would SEEM to be
something to do with the touchscreen-pointer coupling, but calib
handles the touchscreen perfectly.

I get the feeling that there’s something I need to do for elo
capabilities for the screen to be exported to photon. It isn’t
clear what.

So here I am again, scratching my watch and winding my a** :slight_smile:

Any ideas?.. and why isn’t there more documentation of this
somewhere, or is there and I just haven’t found it yet… :slight_smile:

Thanks
BJ

Following the manual for the embedded startup, and working with a
devi-elo touchscreen I am able to get the io-graphics to start quite
happily with the line

io-graphics -di830
vid=8086,did=3582,index=0,photon,xres=800,yres=600,bitpp=15,refresh=60
-pphoton touchscreen &

do the usual on W 10 w /dev/photon and start the window manager.

What I get is this.

I can start from the script, anything… so I start a couple of pterm
apps. I can only use the one on top.

From the pterm I can perform calib and the touchscreen calibrates
nicely.

I can slay Photon and return to my command line and there I see the
problem line above. No capability data.

Searching pwm and qnx docs for an answer and get nothing useful so
far.

Does anybody have an idea what is failing? It would SEEM to be
something to do with the touchscreen-pointer coupling, but calib
handles the touchscreen perfectly.

I get the feeling that there’s something I need to do for elo
capabilities for the screen to be exported to photon. It isn’t
clear what.

So here I am again, scratching my watch and winding my a** :slight_smile:

Any ideas?.. and why isn’t there more documentation of this
somewhere, or is there and I just haven’t found it yet… :slight_smile:

Thanks
BJ

Following the manual for the embedded startup, and working with a
devi-elo touchscreen I am able to get the io-graphics to start quite
happily with the line

io-graphics -di830
vid=8086,did=3582,index=0,photon,xres=800,yres=600,bitpp=15,refresh=60
-pphoton touchscreen &

do the usual on W 10 w /dev/photon and start the window manager.

What I get is this.

I can start from the script, anything… so I start a couple of pterm
apps. I can only use the one on top.

From the pterm I can perform calib and the touchscreen calibrates
nicely.

I can slay Photon and return to my command line and there I see the
problem line above. No capability data.

Searching pwm and qnx docs for an answer and get nothing useful so
far.

Does anybody have an idea what is failing? It would SEEM to be
something to do with the touchscreen-pointer coupling, but calib
handles the touchscreen perfectly.

I get the feeling that there’s something I need to do for elo
capabilities for the screen to be exported to photon. It isn’t
clear what.

So here I am again, scratching my watch and winding my a** :slight_smile:

Any ideas?.. and why isn’t there more documentation of this
somewhere, or is there and I just haven’t found it yet… :slight_smile:

Thanks
BJ

bjchip wrote:

Does anybody have an idea what is failing? It would SEEM to be
something to do with the touchscreen-pointer coupling, but calib
handles the touchscreen perfectly.

It’s a bug in the touchscreen driver code that has already been fixed
(the bug’s designation is PR25607, in case you care). The driver is
trying to find the best display to attach to (in case there’s more than
one), but is making an assumption about the graphics driver’s region
data that is no longer correct; as a result, it’s looking at the wrong
bits in the region data and deciding that something must be wrong and
that you deserve to be warned about it. But as you have noticed, that
doesn’t prevent the driver from correctly figuring out the screen
resolution, at least in the common case where you have only one display.

In short: it’s just a warning and it’s safe to ignore it.

If you don’t want photon to start, you just have to create a file called
“/etc/system/config/nophoton”. Then you can do a console login and start
photon later.

In an emergency, you can do a one-time disable of photon startup at boot
time by using one of the safe modes: press space bar to select boot options,
then F1 then F3.


Max Feil
QNX Software Systems
Stay up-to-date on all the QNX news! Register here to receive our
newsletter:
http://www.qnx.com/news/forms/newsletter.html

“Shashank” <sbalijepalli@precitech.com> wrote in message
news:e1e90o$e4d$7@inn.qnx.com

How can I disable the photon login prompt on QNX 6.3

Thanks,
Shashank
\

Here is the config file for using an AGP radeon + PCI radeon for 4
total displays in the same way. Notice that this time i have 2 radeon
devices, different names, different PCI index, same driver.

[GLOBAL]
devices = radeon pciradeon

[DEVICE.radeon]
dllpath = devg-radeon.so
pci_vendor_id = 0x1002
pci_device_id = 0x5964
pci_index = 0

displays = 2
plugins = photon
photon =

[DEVICE.radeon.0]
xres = 1024
yres = 768
bitpp = 32
refresh = 75
region_x = 0

[DEVICE.radeon.1]
xres = 1024
yres = 768
bitpp = 32
refresh = 75
region_x = 1024

[DEVICE.pciradeon]
dllpath = devg-radeon.so
pci_vendor_id = 0x1002
pci_device_id = 0x5964
pci_index = 1

displays = 2
plugins = photon
photon =

[DEVICE.pciradeon.0]
xres = 1024
yres = 768
bitpp = 32
refresh = 75
region_x = 0

[DEVICE.pciradeon.1]
xres = 1024
yres = 768
bitpp = 32
refresh = 75
region_x = 1024

[PLUGIN.photon]
dllpath = gri-photon.so

Thanks for the update. As I stated, I’m pretty much past the QNX
configuration problem. I have a hardware problem for which I
currently have no solution. If there are two cards in the system,
and I set up a single card configuration, only one of the cards will
function, the one at index=0. The program pci -vv shows a problem,
with the 2nd card having various items disabled.

The thing is - my 2nd card works fine even though PCI shows its memory
disabled…

There are some combinations of cards that just don’t work so you are
probably right (never could get the AGP tnt to work with the PCI
radeon).

However just the fact that the memory shows up as disabled from the
PCI command doesn’t seem to mean that it won’t work.

Here’s my config file and PCI output from my final test which is
onboard video (i830) + PCI radeon. Note that the radeon shows up
with memory disabled.

=========================
[GLOBAL]
devices = i830 pciradeon

[DEVICE.i830]
dllpath = devg-i830.so
pci_vendor_id = 0x8086
pci_device_id = 0x2562
pci_index = 0

displays = 1
plugins = photon
photon =
xres = 1024
yres = 768
bitpp = 32
refresh = 75
region_x = 0

[DEVICE.pciradeon]
dllpath = devg-radeon.so
pci_vendor_id = 0x1002
pci_device_id = 0x5964
pci_index = 0

displays = 2
plugins = photon
photon =

[DEVICE.pciradeon.0]
xres = 1024
yres = 768
bitpp = 32
refresh = 75
region_x = 0

[DEVICE.pciradeon.1]
xres = 1024
yres = 768
bitpp = 32
refresh = 75
region_x = 1024

[PLUGIN.photon]
dllpath = gri-photon.so

========================

PCI version = 2.10

Class = Display (VGA)
Vendor ID = 8086h, Intel Corporation
Device ID = 2562h, 82845G/GL[Brookdale-G]/GE Chipset Integrated
Graphics Device
PCI index = 0h
PCI Mem Address = f0000000h enabled
PCI Mem Address = ffa80000h enabled
PCI Int Pin = INT A
Interrupt line = 11
CPU Interrupt = bh

Class = Mass Storage (IDE)
Vendor ID = 8086h, Intel Corporation
Device ID = 24cbh, 82801DB (ICH4) IDE Controller
PCI index = 0h
PCI IO Address = 0h enabled
PCI IO Address = 0h enabled
PCI IO Address = 0h enabled
PCI IO Address = 0h enabled
PCI IO Address = ffa0h enabled
PCI Mem Address = ffeffc00h enabled
PCI Int Pin = INT A
Interrupt line = no connection

Class = Multimedia (Audio)
Vendor ID = 8086h, Intel Corporation
Device ID = 24c5h, 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC’97
Audio Controller
PCI index = 0h
PCI IO Address = e400h enabled
PCI IO Address = e080h enabled
PCI Mem Address = ffa7f800h enabled
PCI Mem Address = ffa7f400h enabled
PCI Int Pin = INT B
Interrupt line = 3
CPU Interrupt = 3h

Class = Display (VGA)
Vendor ID = 1002h, ATI Technologies Inc
Device ID = 5964h, RV280 [Radeon 9200 SE]
PCI index = 0h
PCI Mem Address = 0h disabled
PCI IO Address = 0h disabled
PCI Mem Address = 0h disabled
PCI Expansion ROM = 0h disabled
PCI Int Pin = INT A
Interrupt line = 6
CPU Interrupt = 6h

Class = Display (Other)
Vendor ID = 1002h, ATI Technologies Inc
Device ID = 5d44h, RV280 [Radeon 9200 SE] (Secondary)
PCI index = 0h
PCI Mem Address = d8000000h enabled
PCI Mem Address = ff8f0000h enabled
PCI Int Pin = NC
Interrupt line = no connection

Class = Network (Ethernet)
Vendor ID = 8086h, Intel Corporation
Device ID = 1039h, 82801DB PRO/100 VE (LOM) Ethernet Controller
PCI index = 0h
PCI Mem Address = ff8ef000h enabled
PCI IO Address = dc00h enabled
PCI Int Pin = INT A
Interrupt line = 11
CPU Interrupt = bh

ncosteswrote:
The thing is - my 2nd card works fine even though PCI shows its

memory disabled…

Yes, I understand that, but that is where my problem differs. I can
set up a config file with pci_index=0 that works with the first card.
Clearly this config file is set up right for a single card because
it works. If change pci_index=1, which is all I should need to,
according to the pci command, the 2nd card does not work.

There’s just a little more to all of this. The motherboard has an
on-board rage-xl chip. With just one Voodoo card installed, it will
not work either. I think the hardware is automatically disabling all
but one VGA card. There’s nothing in the BIOS setup to control this
that I’ve found. BTW, I know that two Voodoo cards will work
together, because they work just fine on another system using QNX 4.
I realize there may (must) be a way to get this to work, but I don’t
think it is a QNX issue.