Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Member Functions | Protected Attributes
MRJFrame Class Reference

#include <MRJFrame.h>

Inheritance diagram for MRJFrame:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 MRJFrame (JMFrameRef frameRef)
virtual ~MRJFrame ()
virtual void setSize (const Rect *newSize)
 Methods used to implement the JMFrame callback protocol.
virtual void invalRect (const Rect *invalidRect)
virtual void showHide (Boolean visible)
virtual void setTitle (const StringPtr title)
virtual void checkUpdate ()
virtual void reorder (ReorderRequest request)
virtual void setResizeable (Boolean resizeable)
virtual Boolean handleEvent (const EventRecord *event)
 Methods to handle various events.
virtual void idle (SInt16 modifiers)
virtual void update ()
virtual void activate (Boolean active)
virtual void resume (Boolean inFront)
virtual void click (const EventRecord *event)
virtual void click (const EventRecord *event, Point localWhere)
virtual void keyPress (UInt32 message, SInt16 modifiers)
virtual void keyRelease (UInt32 message, SInt16 modifiers)
virtual void focusEvent (Boolean gotFocus)
virtual void menuSelected (UInt32 message, SInt16 modifiers)
virtual void print (GrafPtr printingPort, Point frameOrigin)
 MRJFrame (JMFrameRef frameRef)
virtual ~MRJFrame ()
virtual void setSize (const Rect *newSize)
 Methods used to implement the JMFrame callback protocol.
virtual void invalRect (const Rect *invalidRect)
virtual void showHide (Boolean visible)
virtual void setTitle (const StringPtr title)
virtual void checkUpdate ()
virtual void reorder (ReorderRequest request)
virtual void setResizeable (Boolean resizeable)
virtual Boolean handleEvent (const EventRecord *event)
 Methods to handle various events.
virtual void idle (SInt16 modifiers)
virtual void update ()
virtual void activate (Boolean active)
virtual void resume (Boolean inFront)
virtual void click (const EventRecord *event)
virtual void click (const EventRecord *event, Point localWhere)
virtual void keyPress (UInt32 message, SInt16 modifiers)
virtual void keyRelease (UInt32 message, SInt16 modifiers)
virtual void focusEvent (Boolean gotFocus)
virtual void menuSelected (UInt32 message, SInt16 modifiers)
virtual void print (GrafPtr printingPort, Point frameOrigin)

Protected Member Functions

virtual GrafPtr getPort ()=0
virtual GrafPtr getPort ()=0

Protected Attributes

JMFrameRef mFrameRef
Boolean mActive
Boolean mFocused

Detailed Description

Definition at line 57 of file MRJFrame.h.


Constructor & Destructor Documentation

MRJFrame::MRJFrame ( JMFrameRef  frameRef)

Definition at line 49 of file MRJFrame.cpp.

       :      mFrameRef(frameRef), mActive(false), mFocused(false)
{
}
MRJFrame::~MRJFrame ( ) [virtual]

Definition at line 54 of file MRJFrame.cpp.

{
}
MRJFrame::MRJFrame ( JMFrameRef  frameRef)
virtual MRJFrame::~MRJFrame ( ) [virtual]

Member Function Documentation

void MRJFrame::activate ( Boolean  active) [virtual]

Reimplemented in EmbeddedFrame, EmbeddedFrame, TopLevelFrame, and TopLevelFrame.

Definition at line 131 of file MRJFrame.cpp.

{
       if (mActive != active) {
              mActive = active;
              ::JMFrameActivate(mFrameRef, active);
       }
}

Here is the caller graph for this function:

virtual void MRJFrame::activate ( Boolean  active) [virtual]
void MRJFrame::checkUpdate ( ) [virtual]

Reimplemented in EmbeddedFrame, EmbeddedFrame, TopLevelFrame, and TopLevelFrame.

Definition at line 63 of file MRJFrame.cpp.

{}
virtual void MRJFrame::checkUpdate ( ) [virtual]
void MRJFrame::click ( const EventRecord *  event) [virtual]

Reimplemented in EmbeddedFrame, EmbeddedFrame, TopLevelFrame, and TopLevelFrame.

Definition at line 166 of file MRJFrame.cpp.

{
       // make the frame's port current, and move its origin to (0, 0).
       // this is needed to transform the mouse click location to frame coordinates.
       LocalPort port(getPort());
       port.Enter();

       Point localWhere = event->where;
       ::GlobalToLocal(&localWhere);
       click(event, localWhere);
       
       // restore the plugin port's origin, and restore the current port.
       port.Exit();
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void MRJFrame::click ( const EventRecord *  event) [virtual]
void MRJFrame::click ( const EventRecord *  event,
Point  localWhere 
) [virtual]

Definition at line 181 of file MRJFrame.cpp.

{
       if (&::JMFrameClickWithEventRecord != NULL)
              ::JMFrameClickWithEventRecord(mFrameRef, localWhere, event);
       else
              ::JMFrameClick(mFrameRef, localWhere, event->modifiers);
}
virtual void MRJFrame::click ( const EventRecord *  event,
Point  localWhere 
) [virtual]
void MRJFrame::focusEvent ( Boolean  gotFocus) [virtual]

Definition at line 139 of file MRJFrame.cpp.

{
       if (&::JMFrameFocus != NULL) {
              if (gotFocus != mFocused) {
                     if (gotFocus) {
                            // HACK, until focus really works.
                            if (mActive != gotFocus) {
                                   mActive = gotFocus;
                                   ::JMFrameActivate(mFrameRef, gotFocus);
                            }
                     }
                     mFocused = gotFocus;
                     ::JMFrameFocus(mFrameRef, gotFocus);
              }
       } else {
              if (mActive != gotFocus) {
                     mActive = gotFocus;
                     ::JMFrameActivate(mFrameRef, gotFocus);
              }
       }
}

Here is the caller graph for this function:

virtual void MRJFrame::focusEvent ( Boolean  gotFocus) [virtual]
virtual GrafPtr MRJFrame::getPort ( ) [protected, pure virtual]

Implemented in EmbeddedFrame, EmbeddedFrame, TopLevelFrame, and TopLevelFrame.

Here is the caller graph for this function:

virtual GrafPtr MRJFrame::getPort ( ) [protected, pure virtual]
Boolean MRJFrame::handleEvent ( const EventRecord *  event) [virtual]

Methods to handle various events.

Definition at line 67 of file MRJFrame.cpp.

{
       Boolean eventHandled = true;

       switch (event->what) {
       case nsPluginEventType_AdjustCursorEvent:
              idle(event->modifiers);
              break;
       
       case ::mouseDown:
              click(event);
              break;
       
       case keyDown:
       case autoKey:
              keyPress(event->message, event->modifiers);
              break;
       
       case keyUp:
              keyRelease(event->message, event->modifiers);
              break;

       case updateEvt:
              update();
              break;
       
       case activateEvt:
              activate((event->modifiers & activeFlag) != 0);
              break;

#if 0
       case osEvt:
              resume((event->message & resumeFlag) != 0);
              eventHandled = false;
              break;
#endif
       
       default:
              eventHandled = false;
              break;
       }
              
       return eventHandled;
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual Boolean MRJFrame::handleEvent ( const EventRecord *  event) [virtual]

Methods to handle various events.

void MRJFrame::idle ( SInt16  modifiers) [virtual]

Definition at line 112 of file MRJFrame.cpp.

{
       LocalPort port(getPort());
       port.Enter();
       
       Point pt;
       ::GetMouse(&pt);
       ::JMFrameMouseOver(mFrameRef, pt, modifiers);
       
       port.Exit();
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void MRJFrame::idle ( SInt16  modifiers) [virtual]
void MRJFrame::invalRect ( const Rect *  invalidRect) [virtual]

Reimplemented in EmbeddedFrame, EmbeddedFrame, TopLevelFrame, and TopLevelFrame.

Definition at line 60 of file MRJFrame.cpp.

{}
virtual void MRJFrame::invalRect ( const Rect *  invalidRect) [virtual]
void MRJFrame::keyPress ( UInt32  message,
SInt16  modifiers 
) [virtual]

Definition at line 189 of file MRJFrame.cpp.

{
       ::JMFrameKey(mFrameRef, message & charCodeMask, (message & keyCodeMask) >> 8, modifiers);
}

Here is the caller graph for this function:

virtual void MRJFrame::keyPress ( UInt32  message,
SInt16  modifiers 
) [virtual]
void MRJFrame::keyRelease ( UInt32  message,
SInt16  modifiers 
) [virtual]

Definition at line 194 of file MRJFrame.cpp.

{
       ::JMFrameKeyRelease(mFrameRef, message & charCodeMask, (message & keyCodeMask) >> 8, modifiers);
}

Here is the caller graph for this function:

virtual void MRJFrame::keyRelease ( UInt32  message,
SInt16  modifiers 
) [virtual]
void MRJFrame::menuSelected ( UInt32  message,
SInt16  modifiers 
) [virtual]

Definition at line 199 of file MRJFrame.cpp.

{
       MenuHandle menu = ::GetMenuHandle(short(message >> 16));
       if (menu != NULL) {
              short item = short(message);
              if (&::JMMenuSelectedWithModifiers != NULL)
                     ::JMMenuSelectedWithModifiers(::JMGetFrameContext(mFrameRef), menu, item, modifiers);
              else
                     ::JMMenuSelected(::JMGetFrameContext(mFrameRef), menu, item);
       }
}

Here is the caller graph for this function:

virtual void MRJFrame::menuSelected ( UInt32  message,
SInt16  modifiers 
) [virtual]
void MRJFrame::print ( GrafPtr  printingPort,
Point  frameOrigin 
) [virtual]

Definition at line 211 of file MRJFrame.cpp.

{
#if 0
       // this doesn't work, as Apple hasn't implemented it yet.
       OSStatus status = JMDrawFrameInPort(mFrameRef, printingPort, frameOrigin, printingPort->clipRgn, false);
       if (status != noErr) {
              ::MoveTo(10, 12);
              ::TextFont(0);
              ::TextSize(12);
              ::DrawString("\pMRJPlugin:  printing failed.");
       }
#endif
}

Here is the call graph for this function:

virtual void MRJFrame::print ( GrafPtr  printingPort,
Point  frameOrigin 
) [virtual]
void MRJFrame::reorder ( ReorderRequest  request) [virtual]

Reimplemented in EmbeddedFrame, EmbeddedFrame, TopLevelFrame, and TopLevelFrame.

Definition at line 64 of file MRJFrame.cpp.

{}
virtual void MRJFrame::reorder ( ReorderRequest  request) [virtual]
void MRJFrame::resume ( Boolean  inFront) [virtual]

Definition at line 161 of file MRJFrame.cpp.

{
       ::JMFrameResume(mFrameRef, inFront);
}

Here is the caller graph for this function:

virtual void MRJFrame::resume ( Boolean  inFront) [virtual]
void MRJFrame::setResizeable ( Boolean  resizeable) [virtual]

Reimplemented in EmbeddedFrame, EmbeddedFrame, TopLevelFrame, and TopLevelFrame.

Definition at line 65 of file MRJFrame.cpp.

{}
virtual void MRJFrame::setResizeable ( Boolean  resizeable) [virtual]
void MRJFrame::setSize ( const Rect *  newSize) [virtual]

Methods used to implement the JMFrame callback protocol.

Reimplemented in EmbeddedFrame, EmbeddedFrame, TopLevelFrame, and TopLevelFrame.

Definition at line 59 of file MRJFrame.cpp.

{}
virtual void MRJFrame::setSize ( const Rect *  newSize) [virtual]

Methods used to implement the JMFrame callback protocol.

Reimplemented in EmbeddedFrame, EmbeddedFrame, TopLevelFrame, and TopLevelFrame.

void MRJFrame::setTitle ( const StringPtr  title) [virtual]

Reimplemented in EmbeddedFrame, EmbeddedFrame, TopLevelFrame, and TopLevelFrame.

Definition at line 62 of file MRJFrame.cpp.

{}
virtual void MRJFrame::setTitle ( const StringPtr  title) [virtual]
void MRJFrame::showHide ( Boolean  visible) [virtual]

Reimplemented in EmbeddedFrame, EmbeddedFrame, TopLevelFrame, and TopLevelFrame.

Definition at line 61 of file MRJFrame.cpp.

{}
virtual void MRJFrame::showHide ( Boolean  visible) [virtual]
void MRJFrame::update ( ) [virtual]

Definition at line 124 of file MRJFrame.cpp.

{
       GrafPtr framePort = getPort();
       if (framePort != NULL)
              ::JMFrameUpdate(mFrameRef, framePort->clipRgn);
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void MRJFrame::update ( ) [virtual]

Member Data Documentation

Definition at line 93 of file MRJFrame.h.

Definition at line 94 of file MRJFrame.h.

JMFrameRef MRJFrame::mFrameRef [protected]

Definition at line 92 of file MRJFrame.h.


The documentation for this class was generated from the following files: