xref: /petsc/src/sys/classes/draw/interface/drawregall.c (revision af0996ce37bc06907c37d8d91773840993d61e62)
15c6c1daeSBarry Smith 
25c6c1daeSBarry Smith /*
35c6c1daeSBarry Smith        Provides the calling sequences for all the basic PetscDraw routines.
45c6c1daeSBarry Smith */
5*af0996ceSBarry Smith #include <petsc/private/drawimpl.h>  /*I "petscdraw.h" I*/
65c6c1daeSBarry Smith 
78cc058d9SJed Brown PETSC_EXTERN PetscErrorCode PetscDrawCreate_TikZ(PetscDraw);
85c6c1daeSBarry Smith #if defined(PETSC_HAVE_X)
98cc058d9SJed Brown PETSC_EXTERN PetscErrorCode PetscDrawCreate_X(PetscDraw);
105c6c1daeSBarry Smith #endif
115c6c1daeSBarry Smith #if defined(PETSC_HAVE_GLUT)
128cc058d9SJed Brown PETSC_EXTERN PetscErrorCode PetscDrawCreate_GLUT(PetscDraw);
135c6c1daeSBarry Smith #endif
145c6c1daeSBarry Smith #if defined(PETSC_HAVE_OPENGLES)
158cc058d9SJed Brown PETSC_EXTERN PetscErrorCode PetscDrawCreate_OpenGLES(PetscDraw);
165c6c1daeSBarry Smith #endif
178cc058d9SJed Brown PETSC_EXTERN PetscErrorCode PetscDrawCreate_Null(PetscDraw);
185c6c1daeSBarry Smith #if defined(PETSC_USE_WINDOWS_GRAPHICS)
198cc058d9SJed Brown PETSC_EXTERN PetscErrorCode PetscDrawCreate_Win32(PetscDraw);
205c6c1daeSBarry Smith #endif
215c6c1daeSBarry Smith 
220f51fdf8SToby Isaac PetscBool PetscDrawRegisterAllCalled;
230f51fdf8SToby Isaac 
245c6c1daeSBarry Smith #undef __FUNCT__
255c6c1daeSBarry Smith #define __FUNCT__ "PetscDrawRegisterAll"
265c6c1daeSBarry Smith /*@C
275c6c1daeSBarry Smith   PetscDrawRegisterAll - Registers all of the graphics methods in the PetscDraw package.
285c6c1daeSBarry Smith 
295c6c1daeSBarry Smith   Not Collective
305c6c1daeSBarry Smith 
315c6c1daeSBarry Smith   Level: developer
325c6c1daeSBarry Smith 
335c6c1daeSBarry Smith .seealso:  PetscDrawRegisterDestroy()
345c6c1daeSBarry Smith @*/
35607a6623SBarry Smith PetscErrorCode  PetscDrawRegisterAll(void)
365c6c1daeSBarry Smith {
375c6c1daeSBarry Smith   PetscErrorCode ierr;
385c6c1daeSBarry Smith 
395c6c1daeSBarry Smith   PetscFunctionBegin;
400f51fdf8SToby Isaac   if (PetscDrawRegisterAllCalled) PetscFunctionReturn(0);
410f51fdf8SToby Isaac   PetscDrawRegisterAllCalled = PETSC_TRUE;
420f51fdf8SToby Isaac 
43bdf89e91SBarry Smith   ierr = PetscDrawRegister(PETSC_DRAW_TIKZ,     PetscDrawCreate_TikZ);CHKERRQ(ierr);
445c6c1daeSBarry Smith #if defined(PETSC_HAVE_OPENGLES)
45bdf89e91SBarry Smith   ierr = PetscDrawRegister(PETSC_DRAW_OPENGLES, PetscDrawCreate_OpenGLES);CHKERRQ(ierr);
465c6c1daeSBarry Smith #endif
475c6c1daeSBarry Smith #if defined(PETSC_HAVE_GLUT)
48bdf89e91SBarry Smith   ierr = PetscDrawRegister(PETSC_DRAW_GLUT,     PetscDrawCreate_GLUT);CHKERRQ(ierr);
495c6c1daeSBarry Smith #endif
505c6c1daeSBarry Smith #if defined(PETSC_HAVE_X)
51bdf89e91SBarry Smith   ierr = PetscDrawRegister(PETSC_DRAW_X,        PetscDrawCreate_X);CHKERRQ(ierr);
525c6c1daeSBarry Smith #elif defined(PETSC_USE_WINDOWS_GRAPHICS)
53bdf89e91SBarry Smith   ierr = PetscDrawRegister(PETSC_DRAW_WIN32,    PetscDrawCreate_Win32);CHKERRQ(ierr);
545c6c1daeSBarry Smith #endif
55bdf89e91SBarry Smith   ierr = PetscDrawRegister(PETSC_DRAW_NULL,     PetscDrawCreate_Null);CHKERRQ(ierr);
565c6c1daeSBarry Smith   PetscFunctionReturn(0);
575c6c1daeSBarry Smith }
585c6c1daeSBarry Smith 
59