1 /*
2 
3     eboard - chess client
4     http://www.bergo.eng.br/eboard
5     https://github.com/fbergo/eboard
6     Copyright (C) 2000-2016 Felipe Bergo
7     fbergo/at/gmail/dot/com
8 
9     This program is free software; you can redistribute it and/or modify
10     it under the terms of the GNU General Public License as published by
11     the Free Software Foundation; either version 2 of the License, or
12     (at your option) any later version.
13 
14     This program is distributed in the hope that it will be useful,
15     but WITHOUT ANY WARRANTY; without even the implied warranty of
16     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17     GNU General Public License for more details.
18 
19     You should have received a copy of the GNU General Public License
20     along with this program; if not, write to the Free Software
21     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
22 
23 */
24 
25 #ifndef EBOARD_PREFS
26 #define EBOARD_PREFS
27 
28 #include "eboard.h"
29 #include "sound.h"
30 #include "widgetproxy.h"
31 
32 class PreferencesDialog : public ModalDialog,
33                           public SoundEventChangeListener
34 {
35  public:
36   PreferencesDialog();
37   virtual ~PreferencesDialog();
38 
39   void SoundEventChanged();
40 
41  private:
42   GtkWidget *tabposb[4],*efont[NFONTS],*fontdlg,*plainb,
43     *showratb, *autologb, *showts, *sbacke, *special[4], /* *allob[2], */
44     *asp, *aso, *afn, *sgb, *hsb, *chsb, *coct, *dhsb, *aqbar, *lowtime,
45     *msecth, *msecdig, *wget, *smoothb, *xfont[NFONTS],
46     *sndon[N_SOUND_EVENTS],*sndtest[N_SOUND_EVENTS],*sndedit[N_SOUND_EVENTS],
47     *sndd[N_SOUND_EVENTS], *jcl, *jctl, *jmode, *jspeed;
48   BoxedLabel *fm[NFONTS];
49   SoundEvent sndcopy[N_SOUND_EVENTS];
50   ColorButton *lsq, *dsq, *textcb[11];
51   TextPreview *preview;
52   int FontBeingEdited;
53   int jsval[5], jstate;
54 
55   static const char *FontSample[NFONTS];
56 
57   void Apply();
58   void ApplyCheckBox(GtkWidget *cb,int *curval,int *ch1, int *ch2);
59   void ApplyEntry(GtkWidget *entry,char *curval,int sz, int *ch1, int *ch2);
60   void ApplyColorButton(ColorButton *cb,int *curval,int *ch1, int *ch2);
61 
62   friend void prefs_ok(GtkWidget *w,gpointer data);
63   friend void prefs_apply(GtkWidget *w,gpointer data);
64 
65   friend void prefs_frevert(GtkWidget *w,gpointer data);
66   friend void prefs_cfont(GtkWidget *w,gpointer data);
67   friend void prefs_fok(GtkWidget *w,gpointer data);
68   friend void prefs_fcancel(GtkWidget *w,gpointer data);
69 
70   friend void prefs_sndtest(GtkWidget *w,gpointer data);
71   friend void prefs_sndedit(GtkWidget *w,gpointer data);
72 
73   friend void prefs_defcolor(GtkWidget *w,gpointer data);
74 };
75 
76 void prefs_ok(GtkWidget *w,gpointer data);
77 void prefs_apply(GtkWidget *w,gpointer data);
78 
79 void prefs_frevert(GtkWidget *w,gpointer data);
80 void prefs_cfont(GtkWidget *w,gpointer data);
81 void prefs_fok(GtkWidget *w,gpointer data);
82 void prefs_fcancel(GtkWidget *w,gpointer data);
83 
84 void prefs_sndtest(GtkWidget *w,gpointer data);
85 void prefs_sndedit(GtkWidget *w,gpointer data);
86 
87 void prefs_defcolor(GtkWidget *w,gpointer data);
88 
89 #endif
90