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