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