xref: /petsc/src/sys/classes/draw/interface/drawregall.c (revision f97672e55eacc8688507b9471cd7ec2664d7f203)
1 
2 /*
3        Provides the calling sequences for all the basic PetscDraw routines.
4 */
5 #include <petsc/private/drawimpl.h>  /*I "petscdraw.h" I*/
6 
7 PETSC_EXTERN PetscErrorCode PetscDrawCreate_Image(PetscDraw);
8 PETSC_EXTERN PetscErrorCode PetscDrawCreate_TikZ(PetscDraw);
9 #if defined(PETSC_HAVE_X)
10 PETSC_EXTERN PetscErrorCode PetscDrawCreate_X(PetscDraw);
11 #endif
12 PETSC_EXTERN PetscErrorCode PetscDrawCreate_Null(PetscDraw);
13 #if defined(PETSC_USE_WINDOWS_GRAPHICS)
14 PETSC_EXTERN PetscErrorCode PetscDrawCreate_Win32(PetscDraw);
15 #endif
16 
17 PetscBool PetscDrawRegisterAllCalled = PETSC_FALSE;
18 
19 /*@C
20   PetscDrawRegisterAll - Registers all of the graphics methods in the PetscDraw package.
21 
22   Not Collective
23 
24   Level: developer
25 
26 .seealso: `PetscDrawRegisterDestroy()`
27 @*/
28 PetscErrorCode  PetscDrawRegisterAll(void)
29 {
30   PetscFunctionBegin;
31   if (PetscDrawRegisterAllCalled) PetscFunctionReturn(0);
32   PetscDrawRegisterAllCalled = PETSC_TRUE;
33 
34   PetscCall(PetscDrawRegister(PETSC_DRAW_IMAGE,    PetscDrawCreate_Image));
35   PetscCall(PetscDrawRegister(PETSC_DRAW_TIKZ,     PetscDrawCreate_TikZ));
36 #if defined(PETSC_HAVE_X)
37   PetscCall(PetscDrawRegister(PETSC_DRAW_X,        PetscDrawCreate_X));
38 #elif defined(PETSC_USE_WINDOWS_GRAPHICS)
39   PetscCall(PetscDrawRegister(PETSC_DRAW_WIN32,    PetscDrawCreate_Win32));
40 #endif
41   PetscCall(PetscDrawRegister(PETSC_DRAW_NULL,     PetscDrawCreate_Null));
42   PetscFunctionReturn(0);
43 }
44