adeb3cdc835139a46ef64a41e1fa27b0905257ac
[occt.git] / src / Aspect / Aspect_GraphicCallbackProc.hxx
1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14 #ifndef _Aspect_GraphicCallbackProc_HeaderFile
15 #define _Aspect_GraphicCallbackProc_HeaderFile
16
17 #include <Aspect_Display.hxx>
18 #include <Aspect_Drawable.hxx>
19 #include <Aspect_RenderingContext.hxx>
20 #include <Standard_Transient.hxx>
21
22 // The flags below provide additional information to define the moment when
23 // callback was invoked in redraw procedure. These flags are bitwise OR'ed
24 // with the "reason" value of callback:
25 // 1) OCC_PRE_REDRAW  - callback was invoked before redrawing underlayer
26 //                      ( at the beginning of redraw procedure );
27 // 2) OCC_PRE_OVERLAY - callback was invoked before redrawing overlayer;
28 // Otherwise, if no flags added to the "reason" value, the callback was
29 // invoked at the end of redraw ( after the overlayer is redrawn )
30 #define OCC_PRE_REDRAW  0x4000
31 #define OCC_PRE_OVERLAY 0x8000
32
33 // mask for all additional callbacks that invoked in process of redrawing
34 #define OCC_REDRAW_ADDITIONAL_CALLBACKS ( OCC_PRE_REDRAW | OCC_PRE_OVERLAY )
35
36 typedef struct
37 {
38   int reason;
39   int wsID;
40   int viewID;
41   Handle(Standard_Transient) glContext;
42 } Aspect_GraphicCallbackStruct;
43
44 // Prototype for callback function to perform custom drawing within the same window and GL context.
45 typedef int (*Aspect_GraphicCallbackProc) (Aspect_Drawable               theWindowID,
46                                            void*                         theUserData,
47                                            Aspect_GraphicCallbackStruct* theCallData);
48
49 class Handle(Standard_Type);
50 const Handle(Standard_Type)& STANDARD_TYPE(Aspect_GraphicCallbackProc);
51
52 #endif /* _Aspect_GraphicCallbackProc_HeaderFile */