ekg2
 All Struktury Danych Pliki Funkcje Zmienne Definicje typów Wyliczenia Wartości wyliczeń Definicje Grupay Strony
themes.h
Idź do dokumentacji tego pliku.
1 /* $Id$ */
2 
3 /*
4  * (C) Copyright 2001-2003 Wojtek Kaniewski <wojtekka@irc.pl>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License Version 2 as
8  * published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */
19 
20 #ifndef __EKG_THEMES_H
21 #define __EKG_THEMES_H
22 
23 #include "strings.h"
24 
25 #include "gettext.h"
26 #define _(a) gettext(a)
27 #define N_(a) gettext_noop(a)
28 
29 #include "dynstuff.h"
30 #include "sessions.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 typedef struct {
37  union {
38  char *b; /* possibly multibyte string */
39  CHAR_T *w; /* wide char string */
40  } str; /* A \0-terminated string of characters. Before the
41  fstring_t is added to history, should be referred to using 'str->b'.
42  Adding to history recodes it to CHAR_T, so afterwards it should be
43  referred to by 'str->w'. */
44 
45  short *attr; /* atrybuty, ciąg o długości strlen(str) */
46  time_t ts; /* timestamp */
47 
48  int prompt_len; /* długość promptu, który będzie powtarzany przy
49  przejściu do kolejnej linii. */
50  unsigned int prompt_empty : 1; /* prompt przy przenoszeniu będzie pusty */
51  int margin_left; /* where the margin is set (on what char) */
52  void *priv_data; /* can be helpfull */
53 } fstring_t;
54 
55 #define print(x...) print_window_w(NULL, EKG_WINACT_JUNK, x)
56 #define print_status(x...) print_window_w(window_status, EKG_WINACT_JUNK, x)
57 
58 #ifndef EKG2_WIN32_NOFUNCTION
59 
60 void print_window(const char *target, session_t *session, int activity, int separate, const char *theme, ...);
61 
62 void print_info(const char *target, session_t *session, const char *theme, ...);
63 void print_warning(const char *target, session_t *session, const char *theme, ...);
64 
65 void format_add(const char *name, const char *value, int replace);
66 const char *format_find(const char *name);
67 #define format_ok(format_find_result) (format_find_result[0])
68 #define format_exists(format) (format_ok(format_find(format)))
69 char *format_string(const char *format, ...);
70 
71 void theme_init();
72 void theme_plugins_init();
73 void theme_enumerate(int (*enumerator)(const char *theme, const char *value));
74 int theme_read(const char *filename, int replace);
75 int theme_write(const char *filename);
76 void theme_cache_reset();
77 void theme_free();
78 
79 fstring_t *fstring_new(const char *str);
80 fstring_t *fstring_new_format(const char *format, ...);
81 void fstring_free(fstring_t *str);
82 
83 #endif
84 
85 /*
86  * makro udające isalpha() z LC_CTYPE="pl_PL". niestety ncurses coś psuje
87  * i źle wykrywa płeć.
88  */
89 #define isalpha_pl_PL(x) ((x >= 'a' && x <= 'z') || (x >= 'A' && x <= 'Z') || x == 'ą' || x == 'ć' || x == 'ę' || x == 'ł' || x == 'ń' || x == 'ó' || x == 'ś' || x == 'ż' || x == 'ź' || x == 'Ą' || x == 'Ć' || x == 'Ę' || x == 'Ł' || x == 'Ń' || x == 'Ó' || x == 'Ś' || x == 'Ż' || x == 'Ź')
90 
91 typedef enum {
97  FSTR_BACKB = 16,
98  FSTR_BACKC = 32,
100  FSTR_BOLD = 64,
101  FSTR_NORMAL = 128,
102  FSTR_BLINK = 256,
104  FSTR_REVERSE = 1024,
106 } fstr_t;
107 
108 #ifdef __cplusplus
109 }
110 #endif
111 
112 #endif /* __EKG_THEMES_H */
113 
114 /*
115  * Local Variables:
116  * mode: c
117  * c-file-style: "k&r"
118  * c-basic-offset: 8
119  * indent-tabs-mode: t
120  * End:
121  */