On 9 Jan 2001 16:24:17 GMT, Norbert Black <nblack@qnx.com> wrote:
William M. Derby Jr. <> derbyw@derbtronics.com> > wrote:
On 8 Jan 2001 21:02:27 GMT, Norbert Black <> nblack@qnx.com> > wrote:
Hi Bill!
…snip…
The only problem with this is that I’m not trying to filter ALL events
- and all the context information for filtering would be in the app in
the photon event space.
Shouldn’t be a problem. You can set the filter cb on the region
to only be sensitive to certain types of events, and ignore the
rest. No need to reemit. You could have the region owned by the
app. in Photon, so there’d be no need to mirror the data
elsewhere.
OK - my application is not actually a standard Photon (PHAB/widgets)
application but is based on using regions directly and implementing my
own “graphics library” which deals with the regions and child regions
directly. This region sits in front of the window manager (and all
other windows). the code that creates the base region is as follows:
----- code snippet begins
memset(®ion, 0, sizeof(region));
region.events_sense = Ph_EV_PTR_MOTION_BUTTON |
Ph_EV_BUT_PRESS |
Ph_EV_BUT_RELEASE |
Ph_EV_BOUNDARY |
Ph_EV_EXPOSE |
Ph_EV_KEY;
region.events_opaque = Ph_EV_PTR_ALL |
Ph_EV_DRAW |
Ph_EV_BOUNDARY |
Ph_EV_KEY |
Ph_EV_EXPOSE;
rect.ul.x = Generic_Grf.min.x;
rect.ul.y = Generic_Grf.min.y;
rect.lr.x = Generic_Grf.max.x;
rect.lr.y = Generic_Grf.max.y;
region.parent = Ph_ROOT_RID;
region.origin.x = 0;
region.origin.y = 0;
rid = PhRegionOpen(Ph_REGION_PARENT |
Ph_REGION_EV_SENSE |
Ph_REGION_EV_OPAQUE |
Ph_REGION_ORIGIN |
Ph_REGION_RECT,
®ion, &rect, NULL);
…etc…
and then assuming the base_event structure is allocated…
PhEventArm();
loop {
status = PhEventRead(pid, Generic_Grf.base_event,
sizeof(PhEvent_t) + 1000);
.. process event…
}
-------- code ends
Now are you saying that if find the RID for phrelay, create another
region like that above and set phrelay as the region parent that I
will get messages from both regions (with the emitter set
appropriately in the case of the phrelay region) from the PhEventRead
in my app? - this would be great!
Is there and easy way to find phrelays’s RID --i.e. programmatically
The other response by Karsten Hoffmann suggested searching the parent
tree up to proc to see if phrelay were running. This is functionally
the same as the PhSysInfo_t approach outlined in the QDN stuff in
that it sort of solves the problem in that you know the prelay is
running - but you still don’t know whether the command was local or
remote - just that it could be remote…
As I said before, if you know phrelay is running, you can find
out what its RID is, and then screen for that in your filter cb,
because all events have an emitter field which tags where the
event came from.
There was an event logging program by Randy Martin on QUICS in
/usr/free (called “precord” if memory serves?). It was for 1.1x,
and was hard coded for virtual console 1, but it would give you a
start if you’ve not done work with regions and raw events before
this.
Actually my app runs in virtual console 1 anyway so that is not a
problem.
I’ll check it out – but isn’t the QNX4 usr/free area down for
repairs?
—Bill
Norbert Black
QSSL Training Services