xref: /petsc/src/sys/classes/draw/impls/x/drawopenx.c (revision 9895aa37ac365bac650f6bd8bf977519f7222510)
1 
2 /*
3     Defines the operations for the X PetscDraw implementation.
4 */
5 
6 #include <../src/sys/classes/draw/impls/x/ximpl.h>         /*I  "petscsys.h" I*/
7 
8 #undef __FUNCT__
9 #define __FUNCT__ "PetscDrawOpenX"
10 /*@C
11    PetscDrawOpenX - Opens an X-window for use with the PetscDraw routines.
12 
13    Collective on MPI_Comm
14 
15    Input Parameters:
16 +  comm - the communicator that will share X-window
17 .  display - the X display on which to open,or null for the local machine
18 .  title - the title to put in the title bar,or null for no title
19 .  x,y - the screen coordinates of the upper left corner of window
20           may use PETSC_DECIDE for these two arguments, then PETSc places the
21           window
22 -  w, h - the screen width and height in pixels,  or PETSC_DRAW_HALF_SIZE, PETSC_DRAW_FULL_SIZE,
23           or PETSC_DRAW_THIRD_SIZE or PETSC_DRAW_QUARTER_SIZE
24 
25    Output Parameters:
26 .  draw - the drawing context.
27 
28    Options Database Keys:
29 +  -nox - Disables all x-windows output
30 .  -display <name> - Sets name of machine for the X display
31 .  -draw_pause <pause> - Sets time (in seconds) that the
32        program pauses after PetscDrawPause() has been called
33        (0 is default, -1 implies until user input).
34 .  -draw_x_shared_colormap - Causes PETSc to use a shared
35        colormap. By default PETSc creates a separate color
36        for its windows, you must put the mouse into the graphics
37        window to see  the correct colors. This options forces
38        PETSc to use the default colormap which will usually result
39        in bad contour plots.
40 .  -draw_fast - does not create colormap for countour plots
41 .  -draw_double_buffer - Uses double buffering for smooth animation.
42 -  -geometry - Indicates location and size of window
43 
44    Level: beginner
45 
46    Note:
47    When finished with the drawing context, it should be destroyed
48    with PetscDrawDestroy().
49 
50    Note for Fortran Programmers:
51    Whenever indicating null character data in a Fortran code,
52    PETSC_NULL_CHARACTER must be employed; using NULL is not
53    correct for character data!  Thus, PETSC_NULL_CHARACTER can be
54    used for the display and title input parameters.
55 
56    Concepts: X windows^drawing to
57 
58 .seealso: PetscDrawSynchronizedFlush(), PetscDrawDestroy(), PetscDrawCreate(), PetscDrawOpnOpenGL()
59 @*/
60 PetscErrorCode  PetscDrawOpenX(MPI_Comm comm,const char display[],const char title[],int x,int y,int w,int h,PetscDraw *draw)
61 {
62   PetscErrorCode ierr;
63 
64   PetscFunctionBegin;
65   ierr = PetscDrawCreate(comm,display,title,x,y,w,h,draw);CHKERRQ(ierr);
66   ierr = PetscDrawSetType(*draw,PETSC_DRAW_X);CHKERRQ(ierr);
67   PetscFunctionReturn(0);
68 }
69 
70 
71 
72 
73 
74 
75 
76 
77 
78