diff options
Diffstat (limited to 'src/imagedisplay.h')
-rw-r--r-- | src/imagedisplay.h | 59 |
1 files changed, 43 insertions, 16 deletions
diff --git a/src/imagedisplay.h b/src/imagedisplay.h index 94e6c13..5cff4b0 100644 --- a/src/imagedisplay.h +++ b/src/imagedisplay.h @@ -19,29 +19,56 @@ #include <stdint.h> #include <gtk/gtk.h> +#include "control.h" + +typedef enum { + IMAGEDISPLAY_NONE = 0, + IMAGEDISPLAY_SHOW_CENTRE = 1<<1, + IMAGEDISPLAY_SHOW_TILT_AXIS = 1<<2, + IMAGEDISPLAY_QUIT_IF_CLOSED = 1<<3 +} ImageDisplayFlags; + +typedef enum { + IMAGEDISPLAY_MARK_CIRCLE +} ImageDisplayMarkType; + +typedef struct struct_imagedisplaymark { + double x; + double y; + ImageDisplayMarkType type; + struct struct_imagedisplaymark *next; +} ImageDisplayMark; + typedef struct struct_imagedisplay { - unsigned int width; - unsigned int height; /* Of underlying image */ - char *title; - - guchar *data; + ImageRecord imagerecord; + ImageDisplayFlags flags; + ImageDisplayMark *marks; + const char *title; + const char *message; + guchar *data; - GtkWidget *window; - GdkPixbuf *pixbuf; - GdkPixbuf *pixbuf_scaled; - GtkWidget *image; + GtkWidget *window; + GdkPixbuf *pixbuf; + GdkPixbuf *pixbuf_scaled; + GtkWidget *drawingarea; + GtkWidget *vbox; + GCallback mouse_click_func; + GdkGC *gc_centre; + GdkGC *gc_tiltaxis; + GdkGC *gc_marks; - unsigned int view_width; - unsigned int view_height; /* Of window */ + unsigned int drawingarea_width; + unsigned int drawingarea_height; /* Size of the drawing area */ + unsigned int view_width; + unsigned int view_height; /* Size of the picture inside the drawing area */ } ImageDisplay; -extern ImageDisplay *imagedisplay_open(uint16_t *image, unsigned int width, unsigned int height, const char *title); -extern void imagedisplay_mark_point(ImageDisplay *imagedisplay, unsigned int x, unsigned int y); -extern void imagedisplay_mark_circle(ImageDisplay *imagedisplay, unsigned int x, unsigned int y); -#include "control.h" -extern void imagedisplay_add_tilt_axis(ImageDisplay *imagedisplay, double xc, double yc, double omega); +extern ImageDisplay *imagedisplay_open(ImageRecord image, const char *title, ImageDisplayFlags flags); +extern ImageDisplay *imagedisplay_open_with_message(ImageRecord image, const char *title, const char *message, + ImageDisplayFlags flags, GCallback mouse_click_func); +extern void imagedisplay_mark_circle(ImageDisplay *imagedisplay, double x, double y); #endif /* IMAGEDISPLAY_H */ |