Thank you, Peter
I have thought of this way, but never try it.
Because there is no kbd and mouse in my embeded system.
It only have a touchscreen which is connected to a COM port.
I don’t know how to handle touch event in my program.
I think this is the same way you handle mouse events or better
REGION_INPUTs.
I have no experience dealing with regions but the snippet may is a framework
to start:
I don’t remember where it comes from >
main(bla bla) {
int inp_grp = 0;
PhRid_t rid;
PhRegion_t region;
…
setprio(0,4);
PtInit(NULL);
PhEventArm();
in = atoi(getenv(“PHIG”));
PhQueryRids( 0, 0, in, Ph_INPUTGROUP_REGION, 0, 0, 0, &rid, 1 );
PhRegionQuery( rid, ®ion, &rect, NULL, 0 );
in = region.input_group;
PhWindowQueryVisible( Ph_QUERY_INPUT_GROUP | Ph_QUERY_EXACT, 0, inp_grp,
&rect );
area.pos.x = rect.ul.x;
area.pos.y = rect.ul.y;
area.size.w = rect.lr.x - rect.ul.x +1;
area.size.h = rect.lr.y - rect.ul.y+1;
PtSetArg(&arg[0], Pt_ARG_AREA, &area, 0);
PtSetArg(&arg[1], Pt_ARG_REGION_PARENT, 0, 0);
PtSetArg(&arg[2], Pt_ARG_REGION_HANDLE, 0 ,0);
PtSetArg(&arg[3], Pt_ARG_REGION_OWNER, 0, 0);
#define SAVER_FIELDS Ph_REGION_ORIGIN | Ph_REGION_RECT | Ph_REGION_EV_SENSE
|
Ph_REGION_FLAGS | Ph_REGION_HANDLE | Ph_REGION_PARENT |
Ph_REGION_EV_OPAQUE | Ph_REGION_INPUT_GROUP | Ph_REGION_IN_FRONT
PtSetArg(&arg[4], Pt_ARG_REGION_FIELDS, SAVER_FIELDS, SAVER_FIELDS);
PtSetArg(&arg[5], Pt_ARG_REGION_FLAGS, Ph_FOLLOW_IG_SIZE|Ph_FORCE_FRONT,
Ph_FORCE_FRONT|Ph_FOLLOW_IG_SIZE );
PtSetArg(&arg[6], Pt_ARG_REGION_CURSOR, Ph_CURSOR_NONE, 0);
PtSetArg(&arg[7], Pt_ARG_REGION_CURSOR_COLOR, Pg_BLACK, 0);
PtSetArg(&arg[8], Pt_ARG_REGION_SENSE, Ph_EV_WIN_SENSE | Ph_EV_PTR_MOTION,
Ph_EV_WIN_SENSE |Ph_EV_PTR_MOTION );
PtSetArg(&arg[9], Pt_ARG_REGION_OPAQUE,
Ph_EV_DRAW|Ph_EV_EXPOSE,Ph_EV_DRAW|Ph_EV_EXPOSE );
PtSetArg(&arg[10], Pt_ARG_FILL_COLOR, Pg_BLACK, 0 );
PtSetArg(&arg[11], Pt_ARG_COLOR, Pg_WHITE, 0 );
PtSetArg(&arg[12], Pt_ARG_REGION_INFRONT, Ph_DEV_RID, 0 );
PtSetArg(&arg[13], Pt_ARG_REGION_INPUT_GROUP, in, 0 );
window = PtCreateWidget( PtRegion, NULL, 14, arg );
PtRealizeWidget(window);
// Now you have a region in front of your appl.
// create a timer and register an event to get kicked later in timerfunc()
PtAppAddInput( NULL, pulse, timerfunc, NULL );
PtMainLoop();
cheers, Peter
“Peter Weber” <> pw@dolphin.de> > wrote in message
news:aim2hs$ndj$> 1@inn.qnx.com> …
If you have an embedded appl. it is may the best way to create a small
Photon appl.
which creates a region sesitive to kdb and mouse events and then force
it
to
the front
of all other appl.
If an timer elapsed the region becomes sensitive to events (kbd and
mouse),
if an event
occures the timer gets started and the region becomes unsensitive to any
events.
just an idea, cheers, Peter
“Flying” <> flying75@sina.com> > schrieb im Newsbeitrag
news:ail7m0$3g1$> 1@inn.qnx.com> …
Hi,all
I make an OS image, start my embeded system into Photon and then
run
a
Photon application.I also need to run "black screen " screen saver.
Though
it is really easy to config a screen saver in a desktop environment,I
don’t
know how to do it in my embeded enviroment.
I need your help!
flying.
\