Actual source code: drawregall.c

  1: #include <petsc/private/drawimpl.h>

  3: PETSC_EXTERN PetscErrorCode PetscDrawCreate_Image(PetscDraw);
  4: PETSC_EXTERN PetscErrorCode PetscDrawCreate_TikZ(PetscDraw);
  5: #if defined(PETSC_HAVE_X)
  6: PETSC_EXTERN PetscErrorCode PetscDrawCreate_X(PetscDraw);
  7: #endif
  8: PETSC_EXTERN PetscErrorCode PetscDrawCreate_Null(PetscDraw);
  9: #if defined(PETSC_USE_WINDOWS_GRAPHICS)
 10: PETSC_EXTERN PetscErrorCode PetscDrawCreate_Win32(PetscDraw);
 11: #endif

 13: PetscBool PetscDrawRegisterAllCalled = PETSC_FALSE;

 15: /*@C
 16:   PetscDrawRegisterAll - Registers all of the graphics methods in the `PetscDraw` package.

 18:   Not Collective

 20:   Level: developer

 22: .seealso: `PetscDraw`, `PetscDrawType`, `PetscDrawRegisterDestroy()`
 23: @*/
 24: PetscErrorCode PetscDrawRegisterAll(void)
 25: {
 26:   PetscFunctionBegin;
 27:   if (PetscDrawRegisterAllCalled) PetscFunctionReturn(PETSC_SUCCESS);
 28:   PetscDrawRegisterAllCalled = PETSC_TRUE;

 30:   PetscCall(PetscDrawRegister(PETSC_DRAW_IMAGE, PetscDrawCreate_Image));
 31:   PetscCall(PetscDrawRegister(PETSC_DRAW_TIKZ, PetscDrawCreate_TikZ));
 32: #if defined(PETSC_HAVE_X)
 33:   PetscCall(PetscDrawRegister(PETSC_DRAW_X, PetscDrawCreate_X));
 34: #elif defined(PETSC_USE_WINDOWS_GRAPHICS)
 35:   PetscCall(PetscDrawRegister(PETSC_DRAW_WIN32, PetscDrawCreate_Win32));
 36: #endif
 37:   PetscCall(PetscDrawRegister(PETSC_DRAW_NULL, PetscDrawCreate_Null));
 38:   PetscFunctionReturn(PETSC_SUCCESS);
 39: }