Import Geant4 10.7.0 source tree
This commit is contained in:
@@ -77,7 +77,7 @@ OpenGLAreaClassRec openGLAreaClassRec = {
|
||||
XtInheritAcceptFocus, /* assign input focus to widget */
|
||||
XtVersion, /* version of intrinsics used */
|
||||
NULL, /* list of callback offsets */
|
||||
XtInheritTranslations, /* translations */
|
||||
XtInheritTranslations, /* translations */
|
||||
XtInheritQueryGeometry, /* return preferred geometry */
|
||||
XtInheritDisplayAccelerator, /* display your accelerator */
|
||||
NULL /* pointer to extension record */
|
||||
@@ -92,9 +92,9 @@ OpenGLAreaClassRec openGLAreaClassRec = {
|
||||
},
|
||||
/* OpenGLArea */
|
||||
{
|
||||
NULL
|
||||
NULL
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
WidgetClass openGLAreaWidgetClass = (WidgetClass) &openGLAreaClassRec;
|
||||
@@ -112,7 +112,7 @@ static void InitializeWidget(Widget a_request,Widget This,ArgList a_args,Cardina
|
||||
athis.visual = CopyFromParent;
|
||||
athis.installColormap = False;
|
||||
athis.glContext = NULL;
|
||||
|
||||
|
||||
{Display* display;
|
||||
Screen* screen;
|
||||
int iscreen;
|
||||
@@ -120,7 +120,7 @@ static void InitializeWidget(Widget a_request,Widget This,ArgList a_args,Cardina
|
||||
display = XtDisplay(This);
|
||||
screen = XtScreen(This);
|
||||
iscreen = XScreenNumberOfScreen(screen);
|
||||
|
||||
|
||||
{int error,event;
|
||||
if(glXQueryExtension(display,&error,&event)==0) {
|
||||
CWarn ("X server does not have OpenGL extensions.\n");
|
||||
@@ -171,8 +171,8 @@ static void InitializeWidget(Widget a_request,Widget This,ArgList a_args,Cardina
|
||||
None
|
||||
};
|
||||
vinfo = glXChooseVisual (display,iscreen,atbs);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(vinfo==NULL) {
|
||||
CWarn ("Can't choose a visual.\n");
|
||||
@@ -185,7 +185,7 @@ static void InitializeWidget(Widget a_request,Widget This,ArgList a_args,Cardina
|
||||
athis.installColormap = False;
|
||||
} else {
|
||||
This->core.colormap =
|
||||
XCreateColormap (display,XRootWindow(display,iscreen),vinfo->visual, AllocNone);
|
||||
XCreateColormap (display,XRootWindow(display,iscreen),vinfo->visual, AllocNone);
|
||||
athis.installColormap = True;
|
||||
}
|
||||
if(This->core.colormap==0L) {
|
||||
@@ -250,9 +250,9 @@ static void DestroyWidget(Widget This) {
|
||||
#define IFMOD(a_field) if(athis.a_field != acur.a_field)
|
||||
static Boolean SetValues(Widget a_current,Widget a_request,Widget This,ArgList a_args,Cardinal* a_argn) {
|
||||
IFMOD(doubleBufferOn) {
|
||||
/* Can't change buffering here if X window is created.
|
||||
/* Can't change buffering here if X window is created.
|
||||
With OpenGL, buffering fix parameter of the X window.
|
||||
Buffering must be choosen before the execution of the
|
||||
Buffering must be choosen before the execution of the
|
||||
Realize method that create the window. */
|
||||
if(XtIsRealized(This) && (athis.installColormap==True)) {
|
||||
CWarn("Can't change buffering after \"realization\" of the widget.\n");
|
||||
@@ -279,7 +279,7 @@ static void ChangeWidgetSize(Widget This) {
|
||||
printf("debug : OpenGLArea : ChangeWidgetSize : end\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static void DrawWidget(Widget This,XEvent* a_event,Region a_region) {
|
||||
#ifdef DEBUG
|
||||
printf("debug : OpenGLArea : DrawWidget : %s\n",XtName(This));
|
||||
@@ -354,28 +354,28 @@ int OpenGLAreaWrite_gl2ps(Widget This,const char* aFileName,const char* opts) {
|
||||
|
||||
inlib_c_gl2ps_set_gl_funcs(&s_OpenGL_funcs);
|
||||
|
||||
options = TOOLS_GL2PS_OCCLUSION_CULL
|
||||
| TOOLS_GL2PS_BEST_ROOT
|
||||
options = TOOLS_GL2PS_OCCLUSION_CULL
|
||||
| TOOLS_GL2PS_BEST_ROOT
|
||||
| TOOLS_GL2PS_SILENT
|
||||
| TOOLS_GL2PS_DRAW_BACKGROUND;
|
||||
sort = TOOLS_GL2PS_BSP_SORT;
|
||||
//sort = TOOLS_GL2PS_SIMPLE_SORT;
|
||||
|
||||
|
||||
vp[0] = 0;
|
||||
vp[1] = 0;
|
||||
vp[2] = This->core.width;
|
||||
vp[3] = This->core.height;
|
||||
|
||||
inlib_c_gl2psBeginPage("title","exlib_Xt_OpenGLArea",
|
||||
vp,TOOLS_GL2PS_EPS,sort,options,
|
||||
TOOLS_GL_RGBA,0, NULL,0,0,0,bufsize,
|
||||
inlib_c_gl2psBeginPage("title","exlib_Xt_OpenGLArea",
|
||||
vp,TOOLS_GL2PS_EPS,sort,options,
|
||||
TOOLS_GL_RGBA,0, NULL,0,0,0,bufsize,
|
||||
file,aFileName);
|
||||
|
||||
|
||||
{XoAnyCallbackStruct value;
|
||||
value.reason = XoCR_PAINT;
|
||||
value.event = 0;
|
||||
XtCallCallbacks(This,XoNpaintCallback,(XtPointer)&value);}
|
||||
|
||||
|
||||
inlib_c_gl2psEndPage();
|
||||
|
||||
inlib_c_gl2ps_reset_gl_funcs();
|
||||
@@ -417,7 +417,7 @@ static void EventHandler(Widget This,XtPointer a_tag,XEvent* a_event ,Boolean* a
|
||||
/*------------------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------------------*/
|
||||
static void XWidgetInstallColormap(Widget This) {
|
||||
/*
|
||||
/*
|
||||
From Mesa/widgets/GLwDrawingArea.c/post_colormap routine.
|
||||
Could use also XtSetWMColormapWindows.
|
||||
*/
|
||||
@@ -458,7 +458,7 @@ static void XWidgetInstallColormap(Widget This) {
|
||||
if(ws!=NULL) XFree(ws);
|
||||
ws = (Window*)malloc ( 2 * sizeof(Window));
|
||||
} else {
|
||||
ws = (Window*)realloc (ws,(wn + 2) * sizeof(Window));
|
||||
ws = (Window*)realloc (ws,(wn + 2) * sizeof(Window));
|
||||
}
|
||||
if(ws==NULL) return;
|
||||
if(found==-1) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef tools_Xt_OpenGLAreaP_h
|
||||
#define tools_Xt_OpenGLAreaP_h
|
||||
#define tools_Xt_OpenGLAreaP_h
|
||||
|
||||
#include "OpenGLArea.h"
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ inline Pixel XWidgetGetPixelResource(Widget aWidget,const std::string& aName){
|
||||
|
||||
inline Pixel XWidgetConvertStringToPixel(Widget aWidget,const std::string& aString){
|
||||
if(aString.empty()) return 0L;
|
||||
if( (aString=="None") || (aString=="none") )
|
||||
if( (aString=="None") || (aString=="none") )
|
||||
return XWidgetGetPixelResource(aWidget,std::string(XtNbackground));
|
||||
XrmValue from,to;
|
||||
from.size = aString.size()+1;
|
||||
@@ -74,7 +74,7 @@ inline bool XWidgetSendMessage(Widget aWidget,long a_1,long a_2) {
|
||||
event.data.l[2] = 0L;
|
||||
event.data.l[3] = 0L;
|
||||
event.data.l[4] = 0L;
|
||||
if(XSendEvent(event.display,event.window,False,0L,(XEvent*)&event)==0)
|
||||
if(XSendEvent(event.display,event.window,False,0L,(XEvent*)&event)==0)
|
||||
return false;
|
||||
XFlush(event.display);
|
||||
return true;
|
||||
@@ -86,7 +86,7 @@ inline void XClassGetName(WidgetClass aClass,std::string& a_value){
|
||||
a_value = std::string((char*)aClass->core_class.class_name);
|
||||
}
|
||||
inline Boolean XClassIsSubclass(WidgetClass aClass,WidgetClass aParent){
|
||||
for (WidgetClass wc = aClass; wc != NULL; wc = wc->core_class.superclass)
|
||||
for (WidgetClass wc = aClass; wc != NULL; wc = wc->core_class.superclass)
|
||||
if (wc == aParent) return True;
|
||||
return False;
|
||||
}
|
||||
@@ -128,7 +128,7 @@ inline void XWidgetGetChildren(Widget aWidget,std::vector<Widget>& aList){
|
||||
aList.clear();
|
||||
if(!XtIsComposite(aWidget)) return;
|
||||
CompositePart* cwp = &(((CompositeWidget)aWidget)->composite);
|
||||
for (unsigned int count=0;count<cwp->num_children;count++)
|
||||
for (unsigned int count=0;count<cwp->num_children;count++)
|
||||
aList.push_back(cwp->children[count]);
|
||||
}
|
||||
inline void XWidgetGetPopupChildren(Widget aWidget,std::vector<Widget>& aList){
|
||||
@@ -142,7 +142,7 @@ inline Widget XWidgetFindChild(Widget aWidget,const std::string& aName){
|
||||
if(!XtIsComposite(aWidget)) return 0;
|
||||
CompositePart* cwp = &(((CompositeWidget)aWidget)->composite);
|
||||
for (unsigned int count=0;count<cwp->num_children;count++) {
|
||||
if(aName==std::string(XtName(cwp->children[count])))
|
||||
if(aName==std::string(XtName(cwp->children[count])))
|
||||
return cwp->children[count];
|
||||
}
|
||||
return 0;
|
||||
@@ -151,7 +151,7 @@ inline Widget XWidgetFindChild(Widget aWidget,const std::string& aName){
|
||||
#include <ostream>
|
||||
|
||||
inline void XWidgetPrintChildren(Widget aWidget,std::ostream& a_out){
|
||||
int number = XWidgetGetChildrenNumber(aWidget);
|
||||
int number = XWidgetGetChildrenNumber(aWidget);
|
||||
a_out << "XWidgetPrintChildren :"
|
||||
<< " " << (unsigned long)aWidget
|
||||
<< " number " << number
|
||||
|
||||
Reference in New Issue
Block a user