#ifndef XEVENTS_H_INCLUDED #define XEVENTS_H_INCLUDED /* $Id: xevents.h,v 1.3 1997/10/21 22:44:35 mb Exp mb $ * * Copyright (c) 1994-97 Martin Buck * Read COPYING for more information */ #include #include #include #include #include #include #include #include "vtxdecode.h" #define NO_UPDATE 0 /* Don't change these defines !!! */ #define HDR_UPDATE 1 #define SCR_UPDATE 2 /* Execute CCT-function `cmd' & check status; if operation failed, display function-name * `func_str' & ask whether to retry or cancel the operation; if user selects cancel, close * device & execute command `fail' */ #define CCTCHK(cmd, func_str, fail) \ do { \ int cctretval = 0; \ do { \ if (cctretval < 0 && report_cct_error(cctretval, func_str)) { \ cct_close(); \ hotlist_set_current(0); \ vtx_dev_open = FALSE; \ fail; \ } \ } while ((cctretval = cmd) < 0); \ } while (0) typedef struct selection_s { int sel_x[2], sel_y[2], last_x, last_y; int disp_x[2], disp_y[2]; int rect, expand, drag, show, init; } selection_t; typedef struct vtxpgwin_s { Window winid; GC gc; Canvas canvas, canvas_bg; vtxpage_t *page, *curr_disp; selection_t sel; int pgnum, subpgnum, font, hidden, flash_state, stopped, update; } vtxpgwin_t; extern vtxpgwin_t vtxwin; extern byte_t vtx_buffer[]; extern int keep_closed, do_dither, tuner_dev_open; extern XComposeStatus compose_status; void xquit(void); void xabort(void); int report_cct_error(int err, const char *err_func_str); void report_tuner_error(int err, const char *err_func_str); Notify_value signal_handler(Notify_client client, int signum, Notify_signal_mode when); void frame_proc(Xv_window window, const Event *event); void font_menu_proc(Menu menu, Menu_item menu_item); void update_menu_proc(Menu menu, Menu_item menu_item); void checkbox_proc(void); void intv_reveal_proc(void); int new_station(int station, int full_reset); void reset_proc(void); void get_index_page(void); void open_device(void); void close_device(void); void pginc_proc(void); void pgdec_proc(void); void subpginc_proc(void); void subpgdec_proc(void); void subpgroll_proc(void); Panel_setting pgnum_proc(void); Panel_setting pgnum_bg_proc(void); void update_pagenumdisp(int page, int subpage, int numsubpages, int cachecount); Notify_value update_proc(void); void canvas_repaint(Canvas canvas, Xv_window window, const Rectlist *area); void canvas_proc(Xv_window window, const Event *event); Notify_value check_hotkeys_meta(Panel panel, const Event *event, Notify_arg arg, Notify_event_type type); Notify_value check_hotkeys_nometa(Panel panel, const Event *event, Notify_arg arg, Notify_event_type type); void x_main_loop(void); int x_extract_pgnum(const vtxpgwin_t *vtxwin, int x, int y); int x_vtx_redraw(const vtxpgwin_t *vtxwin, int x1, int y1, int x2, int y2, int expose); #endif /* XEVENTS_H_INCLUDED */