1 /****************************************************************************
3 * $Id: rmawin.h 7 2003-05-30 02:18:02Z gabest $
5 * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved.
7 * http://www.real.com/devzone
9 * This program contains proprietary
10 * information of Progressive Networks, Inc, and is licensed
11 * subject to restrictions on use and distribution.
14 * RealMedia Architecture Simple Window Interfaces.
22 * Forward declarations of some interfaces defined or used here-in.
24 typedef _INTERFACE IRMASite IRMASite
;
25 typedef _INTERFACE IRMASiteUser IRMASiteUser
;
26 typedef _INTERFACE IRMASiteWindowed IRMASiteWindowed
;
27 typedef _INTERFACE IRMASiteEventHandler IRMASiteEventHandler
;
28 typedef _INTERFACE IRMASiteWindowless IRMASiteWindowless
;
29 typedef _INTERFACE IRMASiteWatcher IRMASiteWatcher
;
30 typedef _INTERFACE IRMAValues IRMAValues
;
31 typedef _INTERFACE IRMASiteFullScreen IRMASiteFullScreen
;
32 typedef _INTERFACE IRMALayoutSiteGroupManager IRMALayoutSiteGroupManager
;
33 typedef _INTERFACE IRMAEventHook IRMAEventHook
;
35 typedef struct _PNxWindow PNxWindow
;
36 typedef struct _PNxSize PNxSize
;
37 typedef struct _PNxPoint PNxPoint
;
38 typedef struct _PNxRect PNxRect
;
39 typedef void* PNxRegion
;
42 /****************************************************************************
50 * Interface for IRMASite objects which are associated with platform
51 * specific window objects on Microsoft Windows and X-Windows.
53 * IID_IRMASiteWindowed:
55 * {00000D01-0901-11d1-8B06-00A024406D59}
58 DEFINE_GUID(IID_IRMASiteWindowed
, 0x00000D01, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
59 0xa0, 0x24, 0x40, 0x6d, 0x59);
61 #define CLSID_IRMASiteWindowed IID_IRMASiteWindowed
65 #define INTERFACE IRMASiteWindowed
67 DECLARE_INTERFACE_(IRMASiteWindowed
, IUnknown
)
72 STDMETHOD(QueryInterface
) (THIS_
76 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
78 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
81 * IRMASiteWindowed methods called by site suppliers
82 * when they want the site associated with a
83 * previously created (and externally managed) window.
84 * This method will "sub-class" that window (Win32).
85 * On Unix, the site supplier must pass events from
86 * the externally managed window to the core via
87 * IRMAClientEngine::EventOccurred(). Please note that
88 * The PNxWindow ptr must remain in scope for the life
92 STDMETHOD(AttachWindow
) (THIS_
93 PNxWindow
* /*IN*/ pWindow
) PURE
;
95 STDMETHOD(DetachWindow
) (THIS
) PURE
;
98 * IRMASiteWindowed methods called by Owners of the site
99 * in the event that want a default top level window created
102 STDMETHOD(Create
) (THIS_
106 STDMETHOD(Destroy
) (THIS
) PURE
;
109 * IRMASiteWindowed method. Returns actual window of the site.
111 STDMETHOD_(PNxWindow
*,GetWindow
)(THIS
) PURE
;
116 /****************************************************************************
124 * Interface for IRMASite objects which are "windowless" or not
125 * associated with platform specific window objects.
127 * IID_IRMASiteWindowless:
129 * {00000D02-0901-11d1-8B06-00A024406D59}
132 DEFINE_GUID(IID_IRMASiteWindowless
, 0x00000D02, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
133 0xa0, 0x24, 0x40, 0x6d, 0x59);
136 #define INTERFACE IRMASiteWindowless
138 #define CLSID_IRMASiteWindowless IID_IRMASiteWindowless
140 DECLARE_INTERFACE_(IRMASiteWindowless
, IUnknown
)
145 STDMETHOD(QueryInterface
) (THIS_
149 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
151 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
154 * IRMASiteWindowless methods called by owners of the site.
156 STDMETHOD(EventOccurred
) (THIS_
157 PNxEvent
* /*IN*/ pEvent
) PURE
;
160 * IRMASiteWindowless method. Returns some parent window that
161 * owns the windowless site. Useful for right-click menus and
164 STDMETHOD_(PNxWindow
*,GetParentWindow
)(THIS
) PURE
;
168 /****************************************************************************
176 * Interface for IRMASite objects.
180 * {00000D03-0901-11d1-8B06-00A024406D59}
183 DEFINE_GUID(IID_IRMASite
, 0x00000D03, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
184 0xa0, 0x24, 0x40, 0x6d, 0x59);
187 #define INTERFACE IRMASite
189 DECLARE_INTERFACE_(IRMASite
, IUnknown
)
194 STDMETHOD(QueryInterface
) (THIS_
198 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
200 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
203 * IRMASite methods usually called by the "context" to
204 * associate users with the site, and to create child sites
207 STDMETHOD(AttachUser
) (THIS_
208 IRMASiteUser
* /*IN*/ pUser
) PURE
;
210 STDMETHOD(DetachUser
) (THIS
) PURE
;
213 STDMETHOD(GetUser
) (THIS_
214 REF(IRMASiteUser
*) /*OUT*/ pUser
) PURE
;
216 STDMETHOD(CreateChild
) (THIS_
217 REF(IRMASite
*) /*OUT*/ pChildSite
) PURE
;
219 STDMETHOD(DestroyChild
) (THIS_
220 IRMASite
* /*IN*/ pChildSite
) PURE
;
223 * IRMASite methods called by the the "context" in which the site
224 * is displayed in order to manage its position. Site users should
225 * not generally call these methods.
227 STDMETHOD(AttachWatcher
) (THIS_
228 IRMASiteWatcher
* /*IN*/ pWatcher
) PURE
;
230 STDMETHOD(DetachWatcher
) (THIS
) PURE
;
232 STDMETHOD(SetPosition
) (THIS_
233 PNxPoint position
) PURE
;
235 STDMETHOD(GetPosition
) (THIS_
236 REF(PNxPoint
) position
) PURE
;
239 * IRMASite methods called by the user of the site to get
240 * information about the site, and to manipulate the site.
242 STDMETHOD(SetSize
) (THIS_
245 STDMETHOD(GetSize
) (THIS_
246 REF(PNxSize
) size
) PURE
;
248 STDMETHOD(DamageRect
) (THIS_
251 STDMETHOD(DamageRegion
) (THIS_
252 PNxRegion region
) PURE
;
254 STDMETHOD(ForceRedraw
) (THIS
) PURE
;
258 /****************************************************************************
266 * Interface for the user of the IRMASite objects.
270 * {00000D04-0901-11d1-8B06-00A024406D59}
273 DEFINE_GUID(IID_IRMASiteUser
, 0x00000D04, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
274 0xa0, 0x24, 0x40, 0x6d, 0x59);
277 #define INTERFACE IRMASiteUser
279 DECLARE_INTERFACE_(IRMASiteUser
, IUnknown
)
284 STDMETHOD(QueryInterface
) (THIS_
288 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
290 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
293 * IRMASiteUser methods usually called by the "context" to
294 * associate users with the site.
296 STDMETHOD(AttachSite
) (THIS_
297 IRMASite
* /*IN*/ pSite
) PURE
;
299 STDMETHOD(DetachSite
) (THIS
) PURE
;
302 * IRMASiteUser methods called to inform user of an event.
304 STDMETHOD(HandleEvent
) (THIS_
305 PNxEvent
* /*IN*/ pEvent
) PURE
;
307 STDMETHOD_(BOOL
,NeedsWindowedSites
) (THIS
) PURE
;
310 /****************************************************************************
318 * Interface for IRMASiteWatcher objects.
322 * {00000D05-0901-11d1-8B06-00A024406D59}
325 DEFINE_GUID(IID_IRMASiteWatcher
, 0x00000D05, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
326 0xa0, 0x24, 0x40, 0x6d, 0x59);
329 #define INTERFACE IRMASiteWatcher
331 DECLARE_INTERFACE_(IRMASiteWatcher
, IUnknown
)
336 STDMETHOD(QueryInterface
) (THIS_
340 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
342 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
345 * IRMASiteWatcher methods called by the site when a watcher
346 * is attached to or detached from it.
348 STDMETHOD(AttachSite
) (THIS_
349 IRMASite
* /*IN*/ pSite
) PURE
;
351 STDMETHOD(DetachSite
) (THIS
) PURE
;
354 * IRMASiteWatcher methods called by the site an attempt is
355 * made to change it's position or size. The site watcher must
356 * return PNR_OK for the change to occur. If the site watcher
357 * returns any value other than PNR_OK then the size or position
358 * will not change. The site watcher can also modify the new
361 STDMETHOD(ChangingPosition
) (THIS_
363 REF(PNxPoint
)/*IN-OUT*/ posNew
) PURE
;
365 STDMETHOD(ChangingSize
) (THIS_
367 REF(PNxSize
) /*IN-OUT*/ sizeNew
) PURE
;
370 /****************************************************************************
374 * IRMASiteUserSupplier
378 * Interface implemented by renderers and objects with provide layouts to
379 * the client core. This interface is called by the core when it needs a
380 * new IRMASiteUser, or when it is done using an IRMASiteUser.
382 * IID_IRMASiteUserSupplier:
384 * {00000D06-0901-11d1-8B06-00A024406D59}
387 DEFINE_GUID(IID_IRMASiteUserSupplier
, 0x00000D06, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
388 0xa0, 0x24, 0x40, 0x6d, 0x59);
391 #define INTERFACE IRMASiteUserSupplier
393 DECLARE_INTERFACE_(IRMASiteUserSupplier
, IUnknown
)
398 STDMETHOD(QueryInterface
) (THIS_
402 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
404 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
407 * IRMASiteUserSupplier methods usually called by the
408 * "context" to ask for additional or to release previously
409 * created site users.
411 STDMETHOD(CreateSiteUser
) (THIS_
412 REF(IRMASiteUser
*)/*OUT*/ pSiteUser
) PURE
;
414 STDMETHOD(DestroySiteUser
) (THIS_
415 IRMASiteUser
* /*IN*/ pSiteUser
) PURE
;
417 STDMETHOD_(BOOL
,NeedsWindowedSites
) (THIS
) PURE
;
421 /****************************************************************************
429 * Interface implemented by users of the client core. This interface is
430 * called by the core when it needs a new IRMASite, or when it is done
433 * IID_IRMASiteSupplier:
435 * {00000D07-0901-11d1-8B06-00A024406D59}
438 DEFINE_GUID(IID_IRMASiteSupplier
, 0x00000D07, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
439 0xa0, 0x24, 0x40, 0x6d, 0x59);
442 #define INTERFACE IRMASiteSupplier
444 DECLARE_INTERFACE_(IRMASiteSupplier
, IUnknown
)
449 STDMETHOD(QueryInterface
) (THIS_
453 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
455 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
458 * IRMASiteSupplier methods
461 /************************************************************************
463 * IRMASiteSupplier::SitesNeeded
465 * Called to inform the site supplier that a site with a particular
466 * set of characteristics is needed. If the site supplier can
467 * fulfill the request it should call the site manager and add one
469 * Note that the request for sites is associated with a Request ID
470 * the client core will inform the site supplier when this requested
471 * site is no longer needed.
473 STDMETHOD(SitesNeeded
) (THIS_
475 IRMAValues
* pSiteProps
) PURE
;
477 /************************************************************************
479 * IRMASiteSupplier::SitesNotNeeded
481 * Called to inform the site supplier that all sites from a previos
482 * site request are no longer needed. If the site supplier had
483 * previously created non-persistant sites (like popup windows)
484 * to fulfill a request for sites it should call the site manager
485 * and remove those sites.
487 STDMETHOD(SitesNotNeeded
) (THIS_
488 UINT32 uReqestID
) PURE
;
491 /************************************************************************
493 * IRMASiteSupplier::BeginChangeLayout
495 * Called to inform the site supplier a layout change has beginning
496 * it can expect to recieve SitesNeeded() and SitesNotNeeded() calls
497 * while a layout change is in progress,
499 STDMETHOD(BeginChangeLayout
) (THIS
) PURE
;
501 /************************************************************************
503 * IRMASiteSupplier::DoneChangeLayout
505 * Called to inform the site supplier the layout change has been
508 STDMETHOD(DoneChangeLayout
) (THIS
) PURE
;
513 /****************************************************************************
521 * Interface implemented by the client core. This interface is called
522 * by users of the client core to inform it of IRMASite's which are
523 * available for layout of renderers
525 * IID_IRMASiteManager:
527 * {00000D08-0901-11d1-8B06-00A024406D59}
530 DEFINE_GUID(IID_IRMASiteManager
, 0x00000D08, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
531 0xa0, 0x24, 0x40, 0x6d, 0x59);
534 #define INTERFACE IRMASiteManager
536 DECLARE_INTERFACE_(IRMASiteManager
, IUnknown
)
541 STDMETHOD(QueryInterface
) (THIS_
545 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
547 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
550 * IRMASiteManager methods
553 /************************************************************************
555 * IRMASiteManager::AddSite
557 * Called to inform the site manager of the existance of a site.
559 STDMETHOD(AddSite
) (THIS_
560 IRMASite
* pSite
) PURE
;
562 /************************************************************************
564 * IRMASiteManager::RemoveSite
566 * Called to inform the site manager that a site is no longer
569 STDMETHOD(RemoveSite
) (THIS_
570 IRMASite
* pSite
) PURE
;
574 /****************************************************************************
578 * IRMAMultiInstanceSiteUserSupplier
582 * This is the interface for a special default object which is available
583 * from the common class factory. This object will act as a site user
584 * supplier for any renderer (or other site user object) that wants
585 * default support for multiple instances. The site user must work as
586 * a windowless site for this default implementation to work. The
587 * default object also implements the IRMASite interfave to allow
588 * the site user object to control all the sites through a single
589 * interface instance.
591 * IID_IRMAMultiInstanceSiteUserSupplier:
593 * {00000D09-0901-11d1-8B06-00A024406D59}
596 DEFINE_GUID(IID_IRMAMultiInstanceSiteUserSupplier
, 0x00000D09, 0x901,
597 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);
599 #define CLSID_IRMAMultiInstanceSiteUserSupplier \
600 IID_IRMAMultiInstanceSiteUserSupplier
603 #define INTERFACE IRMAMultiInstanceSiteUserSupplier
605 DECLARE_INTERFACE_(IRMAMultiInstanceSiteUserSupplier
, IUnknown
)
610 STDMETHOD(QueryInterface
) (THIS_
614 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
616 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
619 * IRMAMultiInstanceSiteUserSupplier methods called by site users.
621 STDMETHOD(SetSingleSiteUser
) (THIS_
622 IUnknown
* pUnknown
) PURE
;
624 STDMETHOD(ReleaseSingleSiteUser
) (THIS
) PURE
;
628 /****************************************************************************
635 * This is the interface for turning on/off the full screen mode
637 * IID_IRMASiteFullScreen:
639 * {00000D0B-0901-11d1-8B06-00A024406D59}
642 DEFINE_GUID(IID_IRMASiteFullScreen
, 0x00000D0B, 0x901,
643 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);
646 #define INTERFACE IRMASiteFullScreen
648 DECLARE_INTERFACE_(IRMASiteFullScreen
, IUnknown
)
653 STDMETHOD(QueryInterface
) (THIS_
657 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
659 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
662 * IRMASiteFullScreen methods
664 STDMETHOD(EnterFullScreen
) (THIS
) PURE
;
666 STDMETHOD(ExitFullScreen
) (THIS
) PURE
;
668 STDMETHOD(TestFullScreen
) (THIS_
669 void* hTestBitmap
,const char* pszStatusText
) PURE
;
671 STDMETHOD_(BOOL
, IsFullScreen
) (THIS
) PURE
;
677 /****************************************************************************
684 * Add ability to hook events from a named region
686 * IID_IRMAEventHookMgr:
688 * {00000D0D-0901-11d1-8B06-00A024406D59}
691 DEFINE_GUID(IID_IRMAEventHookMgr
, 0x00000D0D, 0x901,
692 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);
695 #define INTERFACE IRMAEventHookMgr
697 DECLARE_INTERFACE_(IRMAEventHookMgr
, IUnknown
)
702 STDMETHOD(QueryInterface
) (THIS_
706 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
708 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
711 * IRMAEventHookMgr methods
713 STDMETHOD(AddHook
) (THIS_
714 IRMAEventHook
* pHook
,
715 const char* pRegionName
,
718 STDMETHOD(RemoveHook
) (THIS_
719 IRMAEventHook
* pHook
,
720 const char* pRegionName
,
724 /****************************************************************************
731 * Object that gets hooked events sent by IRMAEventHookMgr
733 * IID_IRMAEventHookMgr:
735 * {00000D0E-0901-11d1-8B06-00A024406D59}
738 DEFINE_GUID(IID_IRMAEventHook
, 0x00000D0E, 0x901,
739 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);
742 #define INTERFACE IRMAEventHook
744 DECLARE_INTERFACE_(IRMAEventHook
, IUnknown
)
749 STDMETHOD(QueryInterface
) (THIS_
753 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
755 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
758 * IRMAEventHook methods
760 STDMETHOD(SiteAdded
) (THIS_
761 IRMASite
* pSite
) PURE
;
762 STDMETHOD(HandleEvent
) (THIS_
764 PNxEvent
* pEvent
) PURE
;
765 STDMETHOD(SiteRemoved
) (THIS_
766 IRMASite
* pSite
) PURE
;
770 /****************************************************************************
777 * This is the interface for setting the status text.
779 * IID_IRMAStatusMessage:
781 * {00000D10-0901-11d1-8B06-00A024406D59}
784 DEFINE_GUID(IID_IRMAStatusMessage
, 0x00000D10, 0x901,
785 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);
788 #define INTERFACE IRMAStatusMessage
790 DECLARE_INTERFACE_(IRMAStatusMessage
, IUnknown
)
795 STDMETHOD(QueryInterface
) (THIS_
799 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
801 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
804 * IRMAStatusMessage methods
807 STDMETHOD(SetStatus
) (THIS_
const char* pText
) PURE
;
811 #endif /* _RMAWIN_H_ */