Can I run screen saver in an embeded environment?

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.

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.

To do it on an embedded environment:

  • Configure the saver on your development system
  • copy [CURRENT_USER]/.ph/wm/saver.cfg to your target
  • copy /usr/photon/bin/saver to your desktop
  • make sure you have all libs also
  • start saver…

Make sure you have enough resources :wink:
That’s all.

Freddy

“Flying” <flying75@sina.com> wrote in message
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.

You need a wm for this approach, correct Freddy?
“fmartens-2000” <fmartens-2000@planet.nl> schrieb im Newsbeitrag
news:aim535$plb$1@inn.qnx.com

To do it on an embedded environment:

  • Configure the saver on your development system
  • copy [CURRENT_USER]/.ph/wm/saver.cfg to your target
  • copy /usr/photon/bin/saver to your desktop
  • make sure you have all libs also
  • start saver…

Make sure you have enough resources > :wink:
That’s all.

Freddy

“Flying” <> flying75@sina.com> > wrote in message
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.
\

Nope, I tested it. It works without ‘pwm’


“Peter Weber” <pw@dolphin.de> wrote in message
news:aimjb7$6od$1@inn.qnx.com

You need a wm for this approach, correct Freddy?
“fmartens-2000” <> fmartens-2000@planet.nl> > schrieb im Newsbeitrag
news:aim535$plb$> 1@inn.qnx.com> …
To do it on an embedded environment:

  • Configure the saver on your development system
  • copy [CURRENT_USER]/.ph/wm/saver.cfg to your target
  • copy /usr/photon/bin/saver to your desktop
  • make sure you have all libs also
  • start saver…

Make sure you have enough resources > :wink:
That’s all.

Freddy

“Flying” <> flying75@sina.com> > wrote in message
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.

\

Hi, Freddy
Thank you for your help!
And I still don’t know which directoty I should put the saver.cfg into
since there is no any user in my embeded environment.
I try the following:

  • build /root/.ph/wm directory
  • copy saver.cfg into /root/.ph/wm
  • start saver

But it doesn’t work. Where does saver seach for saver.cfg if there is no
any logined user?
How to solve this problem?

“fmartens-2000” <fmartens-2000@planet.nl> wrote in message
news:aim535$plb$1@inn.qnx.com

To do it on an embedded environment:

  • Configure the saver on your development system
  • copy [CURRENT_USER]/.ph/wm/saver.cfg to your target
  • copy /usr/photon/bin/saver to your desktop
  • make sure you have all libs also
  • start saver…

Make sure you have enough resources > :wink:
That’s all.

Freddy

“Flying” <> flying75@sina.com> > wrote in message
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.
\

export HOME=/root

:wink:


“Flying” <flying75@sina.com> wrote in message
news:ainfco$pg4$1@inn.qnx.com

Hi, Freddy
Thank you for your help!
And I still don’t know which directoty I should put the saver.cfg into
since there is no any user in my embeded environment.
I try the following:

  • build /root/.ph/wm directory
  • copy saver.cfg into /root/.ph/wm
  • start saver

But it doesn’t work. Where does saver seach for saver.cfg if there is
no
any logined user?
How to solve this problem?

“fmartens-2000” <> fmartens-2000@planet.nl> > wrote in message
news:aim535$plb$> 1@inn.qnx.com> …
To do it on an embedded environment:

  • Configure the saver on your development system
  • copy [CURRENT_USER]/.ph/wm/saver.cfg to your target
  • copy /usr/photon/bin/saver to your desktop
  • make sure you have all libs also
  • start saver…

Make sure you have enough resources > :wink:
That’s all.

Freddy

“Flying” <> flying75@sina.com> > wrote in message
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.


\

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.

“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.

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 :frowning:

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, &region, &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.

\

Peter Weber wrote:

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 > :frowning:

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, &region, &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.


\

oh gawd, that’s way to advanced for this simple task :stuck_out_tongue:
PtRegion is kinda unecessary and way unecessary complex.

Look at the docs in the helpviewer for PhRegionOpen()
There you find a working (great) example, that one is for drawing, but
you should be able to simply change that for sensing key/mouse events
instead, and arm timers as necessary.
I did a similiar thing for the eQip, re-armed a timer when getting a
mouse/key event, and after 10 seconds of no activity, i lowerd the
brightness on the screen. I unfortunatly lost the sourcecode of this.

/Johan