| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
#ifndef _DiffWindow_h_ |
| 19 |
# define _DiffWindow_h_ |
| 20 |
# include <FL/Fl.H> |
| 21 |
# include <FL/Fl_Overlay_Window.H> |
| 22 |
# include <FL/Fl_Menu_Bar.H> |
| 23 |
# include <FL/Fl_Preferences.H> |
| 24 |
# include "DiffView.h" |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
class DiffWindow : public Fl_Overlay_Window |
| 32 |
{ |
| 33 |
Fl_Menu_Bar menubar_; |
| 34 |
DiffView view_; |
| 35 |
const char *file1_, |
| 36 |
*file2_; |
| 37 |
DiffWindow *next_; |
| 38 |
int search_line_; |
| 39 |
bool search_right_; |
| 40 |
char search_[1024], |
| 41 |
title_[1024]; |
| 42 |
bool zoom_; |
| 43 |
int zoom_pos_; |
| 44 |
|
| 45 |
static DiffWindow *first_; |
| 46 |
static const char *help_text_; |
| 47 |
static Fl_Preferences prefs_; |
| 48 |
|
| 49 |
void draw_overlay(); |
| 50 |
void load_prefs(); |
| 51 |
void open(const char *f1, const char *f2); |
| 52 |
void save_prefs(); |
| 53 |
|
| 54 |
static void about_cb(Fl_Menu_Bar *m, DiffWindow *dw); |
| 55 |
static void close_cb(Fl_Menu_Bar *m, DiffWindow *dw); |
| 56 |
static void compare_selected_cb(Fl_Menu_Bar *m, DiffWindow *dw); |
| 57 |
static void compare_cb(Fl_Menu_Bar *m, DiffWindow *dw); |
| 58 |
static void copy_cb(Fl_Menu_Bar *m, DiffWindow *dw); |
| 59 |
static void find_cb(Fl_Menu_Bar *m, DiffWindow *dw); |
| 60 |
static void find_next_cb(Fl_Menu_Bar *m, DiffWindow *dw); |
| 61 |
static DiffWindow *find_window(const char *f1, const char *f2); |
| 62 |
static void next_change_cb(Fl_Menu_Bar *m, DiffWindow *dw); |
| 63 |
static void prefs_cb(Fl_Menu_Bar *m, DiffWindow *dw); |
| 64 |
static void prev_change_cb(Fl_Menu_Bar *m, DiffWindow *dw); |
| 65 |
static void quit_cb(Fl_Menu_Bar *m, DiffWindow *dw); |
| 66 |
static void rediff_cb(Fl_Menu_Bar *m, DiffWindow *dw); |
| 67 |
static void select_cb(DiffView *dv, DiffWindow *dw); |
| 68 |
static void select_left_cb(Fl_Menu_Bar *m, DiffWindow *dw); |
| 69 |
static void select_none_cb(Fl_Menu_Bar *m, DiffWindow *dw); |
| 70 |
static void select_right_cb(Fl_Menu_Bar *m, DiffWindow *dw); |
| 71 |
static void using_cb(Fl_Menu_Bar *m, DiffWindow *dw); |
| 72 |
|
| 73 |
public: |
| 74 |
|
| 75 |
DiffWindow(const char *file1, const char *file2); |
| 76 |
~DiffWindow(); |
| 77 |
|
| 78 |
void color(Fl_Color c) { view_.color(c); } |
| •79 |
|
| 80 |
int color() const { return (view_.color()); } |
| 81 |
int handle(int event); |
| 82 |
bool load(const char *file1, const char *file2); |
| 83 |
void resize(int X, int Y, int W, int H); |
| 84 |
void selection_color(Fl_Color c) { view_.selection_color(c); } |
| •85 |
|
| 86 |
int selection_color() const { return (view_.selection_color()); } |
| 87 |
void showlinenum(bool b) { view_.showlinenum(b); } |
| 88 |
bool showlinenum() const { return (view_.showlinenum()); } |
| 89 |
void ignoreblanks(bool b) { view_.ignoreblanks(b); } |
| 90 |
bool ignoreblanks() const { return (view_.ignoreblanks()); } |
| 91 |
void tabwidth(int t) { view_.tabwidth(t); } |
| 92 |
int tabwidth() const { return (view_.tabwidth()); } |
| 93 |
void textcolor(Fl_Color c) { view_.textcolor(c); } |
| •94 |
|
| 95 |
int textcolor() const { return (view_.textcolor()); } |
| 96 |
void textfont(uchar f) { view_.textfont(f); } |
| 97 |
uchar textfont() const { return (view_.textfont()); } |
| 98 |
void textsize(uchar s) { view_.textsize(s); } |
| 99 |
uchar textsize() const { return (view_.textsize()); } |
| 100 |
void zoom(bool b) { zoom_ = b; } |
| 101 |
bool zoom() const { return (zoom_); } |
| 102 |
}; |
| 103 |
|
| 104 |
|
| 105 |
#endif |
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|