xref: /petsc/src/sys/classes/draw/interface/drawregall.c (revision 811af0c4b09a35de4306c442f88bd09fdc09897d)
15c6c1daeSBarry Smith 
25c6c1daeSBarry Smith /*
35c6c1daeSBarry Smith        Provides the calling sequences for all the basic PetscDraw routines.
45c6c1daeSBarry Smith */
5af0996ceSBarry Smith #include <petsc/private/drawimpl.h> /*I "petscdraw.h" I*/
65c6c1daeSBarry Smith 
72b8d69caSLisandro Dalcin PETSC_EXTERN PetscErrorCode PetscDrawCreate_Image(PetscDraw);
88cc058d9SJed Brown PETSC_EXTERN PetscErrorCode PetscDrawCreate_TikZ(PetscDraw);
95c6c1daeSBarry Smith #if defined(PETSC_HAVE_X)
108cc058d9SJed Brown PETSC_EXTERN PetscErrorCode PetscDrawCreate_X(PetscDraw);
115c6c1daeSBarry Smith #endif
128cc058d9SJed Brown PETSC_EXTERN PetscErrorCode PetscDrawCreate_Null(PetscDraw);
135c6c1daeSBarry Smith #if defined(PETSC_USE_WINDOWS_GRAPHICS)
148cc058d9SJed Brown PETSC_EXTERN PetscErrorCode PetscDrawCreate_Win32(PetscDraw);
155c6c1daeSBarry Smith #endif
165c6c1daeSBarry Smith 
17e118a51fSLisandro Dalcin PetscBool PetscDrawRegisterAllCalled = PETSC_FALSE;
180f51fdf8SToby Isaac 
195c6c1daeSBarry Smith /*@C
20*811af0c4SBarry Smith   PetscDrawRegisterAll - Registers all of the graphics methods in the `PetscDraw` package.
215c6c1daeSBarry Smith 
225c6c1daeSBarry Smith   Not Collective
235c6c1daeSBarry Smith 
245c6c1daeSBarry Smith   Level: developer
255c6c1daeSBarry Smith 
26*811af0c4SBarry Smith .seealso: `PetscDraw`, `PetscDrawType`, `PetscDrawRegisterDestroy()`
275c6c1daeSBarry Smith @*/
289371c9d4SSatish Balay PetscErrorCode PetscDrawRegisterAll(void) {
295c6c1daeSBarry Smith   PetscFunctionBegin;
300f51fdf8SToby Isaac   if (PetscDrawRegisterAllCalled) PetscFunctionReturn(0);
310f51fdf8SToby Isaac   PetscDrawRegisterAllCalled = PETSC_TRUE;
320f51fdf8SToby Isaac 
339566063dSJacob Faibussowitsch   PetscCall(PetscDrawRegister(PETSC_DRAW_IMAGE, PetscDrawCreate_Image));
349566063dSJacob Faibussowitsch   PetscCall(PetscDrawRegister(PETSC_DRAW_TIKZ, PetscDrawCreate_TikZ));
355c6c1daeSBarry Smith #if defined(PETSC_HAVE_X)
369566063dSJacob Faibussowitsch   PetscCall(PetscDrawRegister(PETSC_DRAW_X, PetscDrawCreate_X));
375c6c1daeSBarry Smith #elif defined(PETSC_USE_WINDOWS_GRAPHICS)
389566063dSJacob Faibussowitsch   PetscCall(PetscDrawRegister(PETSC_DRAW_WIN32, PetscDrawCreate_Win32));
395c6c1daeSBarry Smith #endif
409566063dSJacob Faibussowitsch   PetscCall(PetscDrawRegister(PETSC_DRAW_NULL, PetscDrawCreate_Null));
415c6c1daeSBarry Smith   PetscFunctionReturn(0);
425c6c1daeSBarry Smith }
43