ekg2
ekg/themes.h
Idź do dokumentacji tego pliku.
00001 /* $Id$ */
00002 
00003 /*
00004  *  (C) Copyright 2001-2003 Wojtek Kaniewski <wojtekka@irc.pl>
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License Version 2 as
00008  *  published by the Free Software Foundation.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018  */
00019 
00020 #ifndef __EKG_THEMES_H
00021 #define __EKG_THEMES_H
00022 
00023 #include "strings.h"
00024 
00025 #include "gettext.h" 
00026 #define _(a) gettext(a)
00027 #define N_(a) gettext_noop(a)
00028 
00029 #include "dynstuff.h"
00030 #include "sessions.h"
00031 
00032 #ifdef __cplusplus
00033 extern "C" {
00034 #endif
00035 
00036 typedef struct {
00037         union {
00038                 char    *b;                     /* possibly multibyte string */
00039                 CHAR_T  *w;                     /* wide char string */
00040         } str;          /* A \0-terminated string of characters. Before the
00041         fstring_t is added to history, should be referred to using 'str->b'.
00042         Adding to history recodes it to CHAR_T, so afterwards it should be
00043         referred to by 'str->w'. */
00044 
00045         short           *attr;                  /* atrybuty, ciąg o długości strlen(str) */
00046         time_t          ts;                     /* timestamp */
00047 
00048         int             prompt_len;             /* długość promptu, który będzie powtarzany przy
00049                                                    przejściu do kolejnej linii. */
00050         unsigned int    prompt_empty    : 1;    /* prompt przy przenoszeniu będzie pusty */
00051         int             margin_left;            /* where the margin is set (on what char) */
00052         void            *priv_data;             /* can be helpfull */
00053 } fstring_t;
00054 
00055 #define print(x...)             print_window_w(NULL, EKG_WINACT_JUNK, x) 
00056 #define print_status(x...)      print_window_w(window_status, EKG_WINACT_JUNK, x)
00057 
00058 #ifndef EKG2_WIN32_NOFUNCTION
00059 
00060 void print_window(const char *target, session_t *session, int activity, int separate, const char *theme, ...);
00061 
00062 void print_info(const char *target, session_t *session, const char *theme, ...);
00063 void print_warning(const char *target, session_t *session, const char *theme, ...);
00064 
00065 void format_add(const char *name, const char *value, int replace);
00066 const char *format_find(const char *name);
00067 #define format_ok(format_find_result)   (format_find_result[0])
00068 #define format_exists(format)           (format_ok(format_find(format)))
00069 char *format_string(const char *format, ...);
00070 
00071 void theme_init();
00072 void theme_plugins_init();
00073 void theme_enumerate(int (*enumerator)(const char *theme, const char *value));
00074 int theme_read(const char *filename, int replace);
00075 int theme_write(const char *filename);
00076 void theme_cache_reset();
00077 void theme_free();
00078 
00079 fstring_t *fstring_new(const char *str);
00080 fstring_t *fstring_new_format(const char *format, ...);
00081 void fstring_free(fstring_t *str);
00082 
00083 #endif
00084 
00085 /*
00086  * makro udające isalpha() z LC_CTYPE="pl_PL". niestety ncurses coś psuje
00087  * i źle wykrywa płeć.
00088  */
00089 #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 == 'Ź')
00090 
00091 typedef enum {
00092         FSTR_FOREA              = 1,
00093         FSTR_FOREB              = 2,
00094         FSTR_FOREC              = 4,
00095         FSTR_FOREMASK           = (FSTR_FOREA|FSTR_FOREB|FSTR_FOREC),
00096         FSTR_BACKA              = 8,
00097         FSTR_BACKB              = 16,
00098         FSTR_BACKC              = 32,
00099         FSTR_BACKMASK           = (FSTR_BACKA|FSTR_BACKB|FSTR_BACKC),
00100         FSTR_BOLD               = 64,
00101         FSTR_NORMAL             = 128,
00102         FSTR_BLINK              = 256,
00103         FSTR_UNDERLINE          = 512,
00104         FSTR_REVERSE            = 1024,
00105         FSTR_ALTCHARSET         = 2048
00106 } fstr_t;
00107 
00108 #ifdef __cplusplus
00109 }
00110 #endif
00111 
00112 #endif /* __EKG_THEMES_H */
00113 
00114 /*
00115  * Local Variables:
00116  * mode: c
00117  * c-file-style: "k&r"
00118  * c-basic-offset: 8
00119  * indent-tabs-mode: t
00120  * End:
00121  */
 All Struktury Danych Pliki Funkcje Zmienne Definicje typów Wyliczenia Wartości wyliczeń Definicje