ekg2  GIT master
Struktury danych | Definicje | Definicje typów | Wyliczenia | Funkcje | Zmienne
Dokumentacja pliku windows.h
#include "ekg2-config.h"
#include <glib.h>
#include "commands.h"
#include "dynstuff.h"
#include "sessions.h"
#include "themes.h"
Wykres zależności załączania dla windows.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  window_lastlog_t
 
struct  window
 

Definicje

#define window_find_s(s, target)   window_find_sa(s, target, 1) /* XXX, need checking */
 

Definicje typów

typedef struct window window_t
 

Wyliczenia

enum  window_reserved_id_t {
  WINDOW_DEBUG_ID = 0, WINDOW_RESERVED_MIN_ID = 1000, WINDOW_CONTACTS_ID = 1000, WINDOW_LASTLOG_ID = 1001,
  WINDOW_RESERVED_MAX_ID = 1999
}
 
enum  winact_t {
  EKG_WINACT_NONE = 0, EKG_WINACT_JUNK, EKG_WINACT_MSG, EKG_WINACT_IMPORTANT,
  EKG_WINACT_NONE = 0, EKG_WINACT_JUNK, EKG_WINACT_MSG, EKG_WINACT_IMPORTANT
}
 

Funkcje

window_twindow_find (const char *target)
 
window_twindow_find_sa (session_t *session, const char *target, int session_null_means_no_session)
 
window_twindow_find_ptr (window_t *w)
 
window_twindow_new (const char *target, session_t *session, int new_id)
 
void window_kill (window_t *w)
 
void window_switch (int id)
 
window_twindow_exist (int id)
 
void window_print (window_t *w, fstring_t *line)
 
void print_window_w (window_t *w, int activity, const char *theme,...)
 
char * window_target (window_t *window)
 
void window_session_set (window_t *w, session_t *newsession)
 
int window_session_cycle (window_t *w)
 
int window_lock_inc (window_t *w)
 
int window_lock_dec (window_t *w)
 
void windows_destroy (void)
 
int cmd_window (const char *name, const char **params, session_t *session, const char *target, int quiet)
 

Zmienne

window_twindows
 
window_twindow_debug
 
window_twindow_status
 
window_twindow_current
 

Dokumentacja definicji

◆ window_find_s

#define window_find_s (   s,
  target 
)    window_find_sa(s, target, 1) /* XXX, need checking */

Dokumentacja definicji typów

◆ window_t

typedef struct window window_t

Dokumentacja typów wyliczanych

◆ winact_t

enum winact_t
Wartości wyliczeń
EKG_WINACT_NONE 
EKG_WINACT_JUNK 
EKG_WINACT_MSG 
EKG_WINACT_IMPORTANT 
EKG_WINACT_NONE 
EKG_WINACT_JUNK 
EKG_WINACT_MSG 
EKG_WINACT_IMPORTANT 

◆ window_reserved_id_t

Wartości wyliczeń
WINDOW_DEBUG_ID 
WINDOW_RESERVED_MIN_ID 
WINDOW_CONTACTS_ID 
WINDOW_LASTLOG_ID 
WINDOW_RESERVED_MAX_ID 

Dokumentacja funkcji

◆ cmd_window()

int cmd_window ( const char *  name,
const char **  params,
session_t session,
const char *  target,
int  quiet 
)

◆ print_window_w()

void print_window_w ( window_t w,
int  activity,
const char *  theme,
  ... 
)

print_window_w()

Like print_window() but it takes window_t struct instead of target+session.

Nota
The same as in print_window_c(): we don't check if w is valid window ptr. Just be careful. If you are not sure call:
print_window_c(window_find_ptr(w), separate, theme, ...) And in worst case text will be displayed in (__status / or __current) window instead of a usual one.. But ekg2 won't crash.
Parametry
w- window to display,
if NULL than __status or __current will be used. it depends on: config_default_status_window and config_display_crap variables.

◆ window_exist()

window_t* window_exist ( int  id)

window_exist()

check if window with id exist

Parametry
id- id of window.
Zobacz również
window_find() - If you want to search for window target, instead of window id.
window_find_s() - If you want to search for window session && target, instead of window id.
window_find_ptr() - if you want to search for window pointer, instead of window id.
Zwraca
window_t *, with id specified by id, or NULL if such window doesn't exists.

◆ window_find()

window_t* window_find ( const char *  target)

window_find()

Seeks for an window with given target
Wrapper to: window_find_sa(NULL, target, 0);

Nota
It's really slow, and you should avoid using it. You'll never know if you found good window... so use window_find_s()
Parametry
target- window target
Zobacz również
window_find_s() - If you know session.
Zwraca
pointer to window_t struct if window was founded, else NULL

◆ window_find_ptr()

window_t* window_find_ptr ( window_t w)

window_find_ptr()

it's search over window list and checks if param w is still on that list.

Nota
It's possible to find another window with the same address as old one.. it's rather not possible.. however, It's better if you use other functions...
Zobacz również
window_find() - If you want to search for window target, instead of window ptr.
window_find_s() - If you want to search for window session && target, instead of window ptr.
window_exist - If you want to search for window id, instead of window ptr.
Parametry
w- window to look for.
Zwraca
It returns w if window was found, otherwise NULL.

◆ window_find_sa()

window_t* window_find_sa ( session_t session,
const char *  target,
int  session_null_means_no_session 
)

window_find_sa()

Search for an window with given target and session

Parametry
session- window session to search [See also @ session_null_means_no_session]
target- window target to search
session_null_means_no_session- if you know that this window must belong to given session [NULL, or whatever] so this should be 1. else NULL @ session will mean that you don't know which session should it be. And it'll search/check all sessions
Zobacz również
window_find_ptr() - If you want to search for given window ptr.
window_find_s() - macro to window_find_sa(session, target, 1)
window_find() - wrapper to window_find_sa(NULL, target, 0)
Zwraca
pointer to window_t struct if window was founded, else NULL

◆ window_kill()

void window_kill ( window_t w)

window_kill()

Remove given window.
If it's __status window, and w->target than display nice message about closing talk, else display message about no possibility to close status window

Nota
You cannot remove here __status and __debug windows.
You must do it by hand like in ekg_exit() but if you want do it.
Set window_debug and window_status for proper values.
ekg2 core need them.
Błąd:
Possible bug with sort_windows. Can anyone who wrote it look at it?
Parametry
w- given window.

◆ window_lock_dec()

int window_lock_dec ( window_t w)

◆ window_lock_inc()

int window_lock_inc ( window_t w)

◆ window_new()

window_t* window_new ( const char *  target,
session_t session,
int  new_id 
)

window_new()

Create new window_t, with given new_id (if new_id != 0)

Nota
If target == "$" than it return current window. [POSSIBLE BUG] If window with such target [it can also be u->uid/u->nickname combination] exists. than it'll return it.
You shouldn't pass new_id here. Because it can break UI stuff. don't ask. it's wrong. Just don't use it. It'll be possible removed... In case you really need it, you can talk to the devs, and ask for an id from class: 1000 to 1999
Do zrobienia:
See XXX's
Parametry
target- name of window
session- session of this window
new_id- if different than 0, than window will take this id.
Zwraca
window_t struct

◆ window_print()

void window_print ( window_t w,
fstring_t line 
)

window_print()

Print fstring_t line to window

Parametry
w- window
line- line

◆ window_session_cycle()

int window_session_cycle ( window_t w)

window_session_cycle()

Change session of given window to next good one (based on config_window_session_allow value)

Nota
behaviour of window_session_cycle() based on values of config_window_session_allow: 0 - change session only if w->target == NULL 1 - like 0 + if w->target is set than new session must accept that uid [default && other values] 2 - change to any next session 4 - jump to status window before cycling.
If w->session was changed than UI_WINDOW_TARGET_CHANGED will be emited. If w == window_current than SESSION_CHANGED will be emited also.
Do zrobienia:
Gdy config_window_session_allow == 2, to najpierw sprobowac znalezc dobra sesje a potem jesli nie to nastepna?
Parametry
w- window
Zwraca
0 - if session of window was changed -1 - if not

◆ window_session_set()

void window_session_set ( window_t w,
session_t newsession 
)

◆ window_switch()

void window_switch ( int  id)

◆ window_target()

char* window_target ( window_t window)

window_target()

Parametry
window- window
Do zrobienia:
Make it const?
Zwraca
Never NULL pointer [to don't care about it] look below for more details: if window->target is not NULL return it
else:
  • __current if window is NULL
  • __status if window->id == 1
  • __debug if window->id == 0
    else return ""

◆ windows_destroy()

void windows_destroy ( void  )

Dokumentacja zmiennych

◆ window_current

window_t* window_current

◆ window_debug

window_t* window_debug

◆ window_status

window_t* window_status

◆ windows

window_t* windows