ekg2  GIT master
Struktury danych | Definicje | Definicje typów | Wyliczenia | Funkcje
Dokumentacja pliku themes.h
#include "gettext.h"
#include "dynstuff.h"
#include "sessions.h"
Wykres zależności załączania dla themes.h:
Ten wykres pokazuje, które pliki bezpośrednio lub pośrednio załączają ten plik:

Idź do kodu źródłowego tego pliku.

Struktury danych

struct  fstring_t
 

Definicje

#define _(a)   gettext(a)
 
#define N_(a)   gettext_noop(a)
 
#define print(x...)   print_window_w(NULL, EKG_WINACT_JUNK, x)
 
#define print_status(x...)   print_window_w(window_status, EKG_WINACT_JUNK, x)
 
#define format_ok(format_find_result)   (format_find_result[0])
 
#define format_exists(format)   (format_ok(format_find(format)))
 
#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 == 'Ź')
 

Definicje typów

typedef guint16 fstr_attr_t
 

Wyliczenia

enum  fstr_t {
  FSTR_FOREA = 1, FSTR_FOREB = 2, FSTR_FOREC = 4, FSTR_FOREMASK = (FSTR_FOREA|FSTR_FOREB|FSTR_FOREC),
  FSTR_BACKA = 8, FSTR_BACKB = 16, FSTR_BACKC = 32, FSTR_BACKMASK = (FSTR_BACKA|FSTR_BACKB|FSTR_BACKC),
  FSTR_BOLD = 64, FSTR_NORMAL = 128, FSTR_BLINK = 256, FSTR_UNDERLINE = 512,
  FSTR_REVERSE = 1024, FSTR_ALTCHARSET = 2048, FSTR_LINEBREAK = 4096, FSTR_FOREA = 1,
  FSTR_FOREB = 2, FSTR_FOREC = 4, FSTR_FOREMASK = (FSTR_FOREA|FSTR_FOREB|FSTR_FOREC), FSTR_BACKA = 8,
  FSTR_BACKB = 16, FSTR_BACKC = 32, FSTR_BACKMASK = (FSTR_BACKA|FSTR_BACKB|FSTR_BACKC), FSTR_BOLD = 64,
  FSTR_NORMAL = 128, FSTR_BLINK = 256, FSTR_UNDERLINE = 512, FSTR_REVERSE = 1024,
  FSTR_ALTCHARSET = 2048
}
 

Funkcje

void print_window (const char *target, session_t *session, int activity, int separate, const char *theme,...)
 
void print_info (const char *target, session_t *session, const char *theme,...)
 
void print_warning (const char *target, session_t *session, const char *theme,...)
 
void format_add (const char *name, const char *value, int replace)
 
const char * format_find (const char *name)
 
char * format_string (const char *format,...)
 
void theme_init ()
 
void theme_plugins_init ()
 
void theme_enumerate (int(*enumerator)(const char *theme, const char *value))
 
int theme_read (const char *filename, int replace)
 
int theme_write (const char *filename)
 
void theme_cache_reset ()
 
void theme_free ()
 
fstring_tfstring_dup (const fstring_t *str)
 
fstring_tfstring_new (const char *str)
 
fstring_tfstring_new_format (const char *format,...)
 
void fstring_free (fstring_t *str)
 
void fstring_iter (const fstring_t *s, gchar **text, fstr_attr_t **attr, gssize *len)
 
gboolean fstring_next (gchar **text, fstr_attr_t **attr, gssize *len, fstr_attr_t *change)
 

Dokumentacja definicji

◆ _

#define _ (   a)    gettext(a)

◆ format_exists

#define format_exists (   format)    (format_ok(format_find(format)))

◆ format_ok

#define format_ok (   format_find_result)    (format_find_result[0])

◆ isalpha_pl_PL

#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 == 'Ź')

◆ N_

#define N_ (   a)    gettext_noop(a)

◆ print

#define print (   x...)    print_window_w(NULL, EKG_WINACT_JUNK, x)

◆ print_status

#define print_status (   x...)    print_window_w(window_status, EKG_WINACT_JUNK, x)

Dokumentacja definicji typów

◆ fstr_attr_t

typedef guint16 fstr_attr_t

Dokumentacja typów wyliczanych

◆ fstr_t

enum fstr_t
Wartości wyliczeń
FSTR_FOREA 
FSTR_FOREB 
FSTR_FOREC 
FSTR_FOREMASK 
FSTR_BACKA 
FSTR_BACKB 
FSTR_BACKC 
FSTR_BACKMASK 
FSTR_BOLD 
FSTR_NORMAL 
FSTR_BLINK 
FSTR_UNDERLINE 
FSTR_REVERSE 
FSTR_ALTCHARSET 
FSTR_LINEBREAK 
FSTR_FOREA 
FSTR_FOREB 
FSTR_FOREC 
FSTR_FOREMASK 
FSTR_BACKA 
FSTR_BACKB 
FSTR_BACKC 
FSTR_BACKMASK 
FSTR_BOLD 
FSTR_NORMAL 
FSTR_BLINK 
FSTR_UNDERLINE 
FSTR_REVERSE 
FSTR_ALTCHARSET 

Dokumentacja funkcji

◆ format_add()

void format_add ( const char *  name,
const char *  value,
int  replace 
)

format_add()

Add format with name and value.
If replace set to 1, than if format with the same name exists. than format value will be replaced.

Do zrobienia:
What about creating global variable: formats_unique_here.. and if set to 1, don't search if this format already exists? It should speedup theme_init() a little.
Parametry
name- name of format
value- value of format
replace- if this format exists and is set to 1 than format value will be replaced with new one. else do nothing.

◆ format_find()

const char* format_find ( const char *  name)

◆ format_string()

char* format_string ( const char *  format,
  ... 
)

◆ fstring_dup()

fstring_t* fstring_dup ( const fstring_t str)

fstring_dup()

Return a duplicated copy of a fstring_t with all internal data duplicated.

Parametry
str- string
Zwraca
A newly-allocated fstring_t.
Nota
Please note that private data is not duplicated.

◆ fstring_free()

void fstring_free ( fstring_t str)

fstring_free()

Free memory allocated by str

Do zrobienia:
XXX Think about freeing str->priv_data
Parametry
str- fstring_t * to free.

◆ fstring_iter()

void fstring_iter ( const fstring_t s,
gchar **  text,
fstr_attr_t **  attr,
gssize *  len 
)

fstring_iter()

Initiate iteration over fstring_t. Set pointers to the initial values.

Parametry
s- the iterated fstring_t.
text- location to store the current text segment pointer.
attr- location to store the current attr segment pointer.
len- location to store the length of the current segment.
Nota
This function just initializes the vars, use fstring_next() to get the first segment.

◆ fstring_new()

fstring_t* fstring_new ( const char *  str)

fstring_new()

Change formatted ansi string (str) to Nowy-i-Lepszy (tm) [New-and-Better].

Parametry
str- string
Zobacz również
format_string() - Function to format strings.
fstring_free() - Function to free fstring_t.
Zwraca
Allocated fstring_t.

◆ fstring_new_format()

fstring_t* fstring_new_format ( const char *  format,
  ... 
)

fstring_new_format()

char *tmp = format_string("format", .....); fstr = fstring_new(tmp); xfree(tmp);

◆ fstring_next()

gboolean fstring_next ( gchar **  text,
fstr_attr_t **  attr,
gssize *  len,
fstr_attr_t change 
)

fstring_next()

Iterate over fragments of fstring_t with unchanged attributes.

Parametry
text- location to store the current text segment pointer.
attr- location to store the current attr segment pointer.
len- location to store the length of the current segment.
change- location to store changed attribute map or NULL.
Zwraca
TRUE if next segment was found, FALSE on end of string.
Nota
This function relies on the values stored by previous calls, please do not modify them. The variables need to be initialized by fstring_iter().
gchar *s;
gssize len;
fstr_attr_t change;
fstring_iter(fstr, &s, &a, &len);
while (fstring_next(&s, &a, &len, NULL)) {
my_setattr(*a);
my_printn(s, len);
}

◆ print_info()

void print_info ( const char *  target,
session_t session,
const char *  theme,
  ... 
)

◆ print_warning()

void print_warning ( const char *  target,
session_t session,
const char *  theme,
  ... 
)

◆ print_window()

void print_window ( const char *  target,
session_t session,
int  activity,
int  separate,
const char *  theme,
  ... 
)

print_window()

Print given text in given window [target+ session]

Do zrobienia:
We have no policy for displaying messages by e.g. jabber resources.
For now we do: [only jabber]
  • If target has '/' inside. We put there NUL char.
  • After it we search for window with stripped '/'
  • If founded, than done.
    If not, we look for user in userlist.. And if not found, than we'll create new window with stripped '/' [only jabber]
Parametry
target- target to look for.
session- session to look for.
activity- how important is text?
separate- if essence of text is important to create new window
theme- Name of format to format_string() with ... Text will be be built.
...

◆ theme_cache_reset()

void theme_cache_reset ( )

theme_cache_reset()

Remove cached: prompt_cache, prompt2_cache, error_cache and timestamp_cache
These values are used by va_format_string() to don't call format_find() on:
["prompt" "%>", "prompt2" "%)", "errror" "%!", "timestamp" "%#"]

◆ theme_enumerate()

void theme_enumerate ( int(*)(const char *theme, const char *value)  enumerator)

◆ theme_free()

void theme_free ( )

◆ theme_init()

void theme_init ( )

◆ theme_plugins_init()

void theme_plugins_init ( )

◆ theme_read()

int theme_read ( const char *  filename,
int  replace 
)

◆ theme_write()

int theme_write ( const char *  filename)