/*
***  the graphical operations are declared here
 */

#include "Event.h"
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <Xm/Xm.h>

// the data-struct used through all graphics operations
typedef struct{
  int ncolors;
  GC gc;                       // graphics context
  Dimension width, height;     // the size of displaying window
  Event event;                 // currently display event
  int CT;                      // which to be displayed, C(charge) or T(time)?
} image_data;


// reading data into an Event object and returning it
Event input_data();

// dealing with window-resizing
void resize(Widget w, image_data* data, caddr_t call_data );

// dealing with window-re-exposure
void redisplay(Widget w, image_data* data, XmDrawingAreaCallbackStruct *a);

// handling quit request
void quit(Widget w, Widget t, XEvent* event, char* c);

// initializing image_data
void init_data(Widget w, image_data* data);

// creating and displaying the image
void create_image(Widget w, image_data* data);

// rotating view-angle to get better picture of the event
void rotate_it(Widget w, image_data* data, XEvent* event, char* c);

// switching the displaying status between C(charge) and T(time)
void toggle_CT(Widget w, image_data* data, XEvent* event, char* c);

// fading the color to find the hottest PMTs which are entry- or exit-points
void fade_color(Widget w, image_data* data, XEvent* event, char* c);

// recovering the faded color
void increase_color(Widget w, image_data* data, XEvent* event, char* c);

// going to the next event
void next_event(Widget w, image_data* data, XEvent* event, char* c);

// clearing the screen before a new image is posted
void clear_screen(Widget w, image_data* data);
