source: branches/stable/CORE/arb_handlers.h

Last change on this file was 17262, checked in by westram, 6 years ago
File size: 1.9 KB
Line 
1// ================================================================ //
2//                                                                  //
3//   File      : arb_handlers.h                                     //
4//   Purpose   :                                                    //
5//                                                                  //
6//   Coded by Ralf Westram (coder@reallysoft.de) in November 2010   //
7//   Institute of Microbiology (Technical University Munich)        //
8//   http://www.arb-home.de/                                        //
9//                                                                  //
10// ================================================================ //
11
12#ifndef ARB_HANDLERS_H
13#define ARB_HANDLERS_H
14
15#ifndef ARB_CORE_H
16#include <arb_core.h>
17#endif
18#ifndef ATTRIBUTES_H
19#include <attributes.h>
20#endif
21
22enum arb_status_type {
23    AST_FORWARD, // gauge may only increment (not decrement)
24    AST_RANDOM,  // random gauge allowed
25};
26
27struct arb_status_implementation {
28    arb_status_type type;
29    void (*openstatus)(const char *title);   // opens the status window and sets title
30    void (*closestatus)();                   // close the status window
31    void (*set_title)(const char *title);    // set the title
32    void (*set_subtitle)(const char *title); // set the subtitle
33    void (*set_gauge)(double gauge);         // set the gauge (=percent)
34    bool (*user_abort)();                    // return true on user abort
35};
36
37struct arb_handlers {
38    gb_error_handler_type     show_error;
39    gb_warning_func_type      show_warning;
40    gb_information_func_type  show_message;
41    arb_status_implementation status;
42};
43
44extern arb_handlers *active_arb_handlers;
45
46void ARB_install_handlers(arb_handlers& handlers);
47void ARB_redirect_handlers_to(FILE *use_as_stderr, FILE *use_as_stdout);
48
49#else
50#error arb_handlers.h included twice
51#endif // ARB_HANDLERS_H
Note: See TracBrowser for help on using the repository browser.