18 #ifndef __H2D_VIEW_SUPPORT_H
19 #define __H2D_VIEW_SUPPORT_H
53 inline void enter() { pthread_mutex_lock(&mutex); };
55 inline void leave() { pthread_mutex_unlock(&mutex); };
59 inline void wait_keypress() { pthread_cond_wait(&cond_keypress, &mutex); };
61 inline void signal_close() { pthread_cond_broadcast(&cond_close); };
63 inline void wait_close() { pthread_cond_wait(&cond_close, &mutex); };
88 int add_view(View* view,
int x,
int y,
int width,
int height,
const char* title);
103 extern void on_display_stub(
void);
104 extern void on_reshape_stub(
int width,
int height);
105 extern void on_mouse_move_stub(
int x,
int y);
106 extern void on_key_down_stub(
unsigned char key,
int x,
int y);
107 extern void on_special_key_stub(
int key,
int x,
int y);
108 extern void on_entry_stub(
int state);
109 extern void on_mouse_click_stub(
int button,
int state,
int x,
int y);
110 extern void on_close_stub();
void refresh_view(int view_id)
Forces redisplay of a view.
void remove_view(int view_id)
Removes a view.
pthread_cond_t cond_drawing_finished
Condition used to signal that drawing has finished.
pthread_mutex_t mutex
Mutex that protects monitor.
void signal_drawing_finished()
signals drawing finished inside a protected section
void signal_close()
signals close inside a protected section
void leave()
leaves protected section
void wait_close()
waits for close inside a protected section
void enter()
enters protected section
ViewMonitor view_sync
synchronization between all views. Used to access OpenGL and signal a window close event and a keypre...
void wait_drawing_fisnihed()
waits for drawing finished inside a protected section
int add_view(View *view, int x, int y, int width, int height, const char *title)
Adds a view.
void wait_for_any_key(const char *text)
Waits for a keypress which is not processed.
void wait_keypress()
waits for keypress inside a protected section
pthread_cond_t cond_cross_thread_call
Condition used to signal a cross-thread call.
void signal_keypress()
signals keypress inside a protected section
void wait_cross_thread_call()
waits for finishing of a cross-thread call
void signal_cross_thread_call()
signals that cross-thread-call finished
HERMES_API bool init_glut()
Initialize GLUT.
pthread_cond_t cond_close
Condition used to signal close of a window.
< A monitor used to synchronize thread in views.
void wait_for_all_views_close(const char *text)
Forces view thread to shutdown.
pthread_cond_t cond_keypress
Condition used to signal a keypress.
void set_view_title(int view_id, const char *title)
Sets title of a view.
pthread_mutexattr_t mutex_attr
Mutext attributes.
HERMES_API bool shutdown_glut()
Shutdown GLUT.