iceWing
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Data Structures | Macros | Typedefs | Enumerations | Functions
Gpreview.h File Reference
#include <stdio.h>
#include <gtk/gtk.h>
#include "Gcolor.h"
#include "Gimage.h"
#include "Gdata.h"

Go to the source code of this file.

Data Structures

struct  prevEventAny
struct  prevEventButton
struct  prevEventMotion
struct  prevEventKey
union  prevEventData
struct  prevGC
struct  _prevBuffer
struct  prevVectorSave

Macros

#define prev_set_render_size(b, width, height)

Typedefs

typedef struct _prevSettings prevSettings
typedef struct _prevBuffer prevBuffer
typedef struct prevEventAny prevEventAny
typedef struct prevEventButton prevEventButton
typedef struct prevEventMotion prevEventMotion
typedef struct prevEventKey prevEventKey
typedef union prevEventData prevEventData
typedef void(* prevButtonFunc )(prevBuffer *b, prevEvent signal, int x, int y, void *data)
typedef void(* prevSignalFunc )(prevBuffer *b, prevEventData *event, void *data)
typedef void(* renderDbOptsFunc )(prevBuffer *b)
typedef void(* renderDbFreeFunc )(void *data)
typedef void *(* renderDbCopyFunc )(const void *data)
typedef void(* renderDbRenderFunc )(prevBuffer *b, const void *data, int disp_mode)
typedef char *(* renderDbInfoFunc )(prevBuffer *b, const void *data, int disp_mode, int x, int y, int radius)
typedef iwImgStatus(* renderDbVectorFunc )(prevBuffer *b, prevVectorSave *save, const void *data, int disp_mode)

Enumerations

enum  prevType {
  PREV_IMAGE, PREV_TEXT, PREV_LINE, PREV_RECT,
  PREV_FRECT, PREV_REGION, PREV_POLYGON, PREV_FPOLYGON,
  PREV_CIRCLE, PREV_FCIRCLE, PREV_ELLIPSE, PREV_COMINFO,
  PREV_LINE_F, PREV_RECT_F, PREV_FRECT_F, PREV_POLYGON_F,
  PREV_FPOLYGON_F, PREV_CIRCLE_F, PREV_FCIRCLE_F, PREV_ELLIPSE_F,
  PREV_NEW = 100
}
enum  prevEvent {
  PREV_BUTTON_PRESS = 1 << 0, PREV_BUTTON_RELEASE = 1 << 1, PREV_BUTTON_MOTION = 1 << 2, PREV_KEY_PRESS = 1 << 3,
  PREV_KEY_RELEASE = 1 << 4
}
enum  prevSave {
  SAVE_NONE, SAVE_RENDER, SAVE_ORIG, SAVE_SEQ,
  SAVE_ORIGSEQ
}

Functions

void prev_buffer_lock (void)
void prev_buffer_unlock (void)
prevType prev_renderdb_register (prevType type, renderDbOptsFunc o_fkt, renderDbFreeFunc f_fkt, renderDbCopyFunc c_fkt, renderDbRenderFunc r_fkt)
void prev_renderdb_register_info (prevType type, renderDbInfoFunc i_fkt)
void prev_renderdb_register_vector (prevType type, renderDbVectorFunc v_fkt)
void ** prev_opts_store (prevBuffer *b, prevType type, void *data, gboolean free_data)
void ** prev_opts_get (prevBuffer *b, prevType type)
void prev_opts_append (prevBuffer *b, prevType type,...)
float prev_get_zoom (prevBuffer *b)
void prev_chk_save (prevBuffer *b, const iwImage *img)
void prev_draw_buffer (prevBuffer *b)
void prev_pan_zoom (prevBuffer *b, int x, int y, float zoom)
void prev_signal_connect (prevBuffer *b, prevEvent sigset, prevButtonFunc cback, void *data)
void prev_signal_connect2 (prevBuffer *b, prevEvent sigset, prevSignalFunc cback, void *data)
int prev_get_page (prevBuffer *b)
void prev_free_window (prevBuffer *b)
prevBufferprev_new_window (const char *title, int width, int height, gboolean gray, gboolean show)
iwImageprev_copy_to_image (prevBuffer *b, gboolean save_full)

Macro Definition Documentation

#define prev_set_render_size (   b,
  width,
  height 
)
Value:
G_STMT_START { \
if ((width) >= 0) (b)->gc.width = (width); \
if ((height) >= 0) (b)->gc.height = (height); \
} G_STMT_END

prev_set_render_size(prevBuffer *b, int width, int height) Update render_{width|height} in buffer b.


Typedef Documentation

typedef struct _prevSettings prevSettings
typedef struct _prevBuffer prevBuffer
typedef struct prevEventAny prevEventAny
typedef struct prevEventKey prevEventKey
typedef void(* prevButtonFunc)(prevBuffer *b, prevEvent signal, int x, int y, void *data)
typedef void(* prevSignalFunc)(prevBuffer *b, prevEventData *event, void *data)
typedef void(* renderDbOptsFunc)(prevBuffer *b)
typedef void(* renderDbFreeFunc)(void *data)
typedef void*(* renderDbCopyFunc)(const void *data)
typedef void(* renderDbRenderFunc)(prevBuffer *b, const void *data, int disp_mode)
typedef char*(* renderDbInfoFunc)(prevBuffer *b, const void *data, int disp_mode, int x, int y, int radius)
typedef iwImgStatus(* renderDbVectorFunc)(prevBuffer *b, prevVectorSave *save, const void *data, int disp_mode)

Enumeration Type Documentation

enum prevType

Identifies data for rendering, e.g. in prev_render_data(), prev_render_list(), and prev_render_set()

Enumerator:
PREV_IMAGE 

Types containing the data: prevDataImage

PREV_TEXT 

prevDataText

PREV_LINE 

prevDataLine

PREV_RECT 

prevDataRect

PREV_FRECT 

prevDataRect (filled rectangle)

PREV_REGION 

iwRegion

PREV_POLYGON 

prevDataPoly

PREV_FPOLYGON 

prevDataPoly (filled polygon)

PREV_CIRCLE 

prevDataCircle

PREV_FCIRCLE 

prevDataCircle (filled circle)

PREV_ELLIPSE 

prevDataEllipse

PREV_COMINFO 

iwRegCOMinfo

PREV_LINE_F 

prevDataLineF

PREV_RECT_F 

prevDataRectF

PREV_FRECT_F 

prevDataRectF (filled rectangle)

PREV_POLYGON_F 

prevDataPolyF

PREV_FPOLYGON_F 

prevDataPolyF (filled polygon)

PREV_CIRCLE_F 

prevDataCircleF

PREV_FCIRCLE_F 

prevDataCircleF (filled circle)

PREV_ELLIPSE_F 

prevDataEllipseF

PREV_NEW 

For prev_renderdb_register() to add a new type, (100 to have some free values before to add new PREV_...)

enum prevEvent

User event in a preview window, see prev_signal_connect() and prev_signal_connect2()

Enumerator:
PREV_BUTTON_PRESS 
PREV_BUTTON_RELEASE 
PREV_BUTTON_MOTION 
PREV_KEY_PRESS 
PREV_KEY_RELEASE 
enum prevSave
Enumerator:
SAVE_NONE 
SAVE_RENDER 
SAVE_ORIG 
SAVE_SEQ 
SAVE_ORIGSEQ 

Function Documentation

void prev_buffer_lock ( void  )

  Must be called on access of a prevBuffer->buffer.
  Attention: gdk-/X11-mutex must not be locked before locking this
            mutex.

void prev_buffer_unlock ( void  )
prevType prev_renderdb_register ( prevType  type,
renderDbOptsFunc  o_fkt,
renderDbFreeFunc  f_fkt,
renderDbCopyFunc  c_fkt,
renderDbRenderFunc  r_fkt 
)

  Register a new render type 'type'.
  If 'type' == PREV_NEW use the first unused value and return it.

void prev_renderdb_register_info ( prevType  type,
renderDbInfoFunc  i_fkt 
)

  Register a function which is called for the "Info Window".

void prev_renderdb_register_vector ( prevType  type,
renderDbVectorFunc  v_fkt 
)

  Register a function for saving in a vector format.

void** prev_opts_store ( prevBuffer b,
prevType  type,
void *  data,
gboolean  free_data 
)

  Store a value associated to type and return its address.
  free_data==TRUE: If the window b is freed, data is freed by calling
                  free().
  Used in renderDbOptsFunc() to store the value of the menu entry.

void** prev_opts_get ( prevBuffer b,
prevType  type 
)

  Get the value associated to type stored with prev_opts_store().

void prev_opts_append ( prevBuffer b,
prevType  type,
  ... 
)

  Append option widgets to the window specific menu according to
  the given types. Last argument must be '-1'.

float prev_get_zoom ( prevBuffer b)

  Return zoom factor to get something of size
  b->gc.width x b->gc.height into buffer b.

void prev_chk_save ( prevBuffer b,
const iwImage img 
)

  If b->save!=SAVE_NONE:
      img!=NULL: Save image img.
      img==NULL: Save image b->buffer (size: b->width x b->height).
  Attention: prev_buffer_(un)lock is called.

void prev_draw_buffer ( prevBuffer b)

  If b->window is open, display b->buffer.

void prev_pan_zoom ( prevBuffer b,
int  x,
int  y,
float  zoom 
)

  If zoom >= 0, change zoom level of the preview.
  If x >= 0 or y >= 0 pan the preview to that position.

void prev_signal_connect ( prevBuffer b,
prevEvent  sigset,
prevButtonFunc  cback,
void *  data 
)

  Call cback with data as last argument if one of the signals
  specified with sigset occured.

void prev_signal_connect2 ( prevBuffer b,
prevEvent  sigset,
prevSignalFunc  cback,
void *  data 
)
int prev_get_page ( prevBuffer b)

  Return the page number for the preview settings window. Allows to
  create any widgets with the help of the opts_() functions.

void prev_free_window ( prevBuffer b)

  Close preview window b (if necessary), remove it from the CList and
  free its memory.

prevBuffer* prev_new_window ( const char *  title,
int  width,
int  height,
gboolean  gray,
gboolean  show 
)

  Initialise a new preview window (Title: title, size: width x height,
  depth: 24bit (gray==FALSE) or 8 Bit (gray==TRUE)).
  show == TRUE: The window is shown immediately.
  width, heigth < 0 : Default width, height is used.
  title contains '.' (a'.'b): Window is shown in the list of windows
                              under node a with entry b.

iwImage* prev_copy_to_image ( prevBuffer b,
gboolean  save_full 
)

  Copy the content of a preview window into an iceWing image. The
  preview window needs to be open (buffer->window != NULL), otherwise
  NULL is returned. If save_full the full visible preview window size
  is used, otherwise the size of the displayed data is used.