File: widget_utils.h

package info (click to toggle)
aca 0.1.6
  • links: PTS
  • area: main
  • in suites: woody
  • size: 492 kB
  • ctags: 569
  • sloc: ansic: 4,254; sh: 2,237; makefile: 256
file content (49 lines) | stat: -rw-r--r-- 1,772 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49

/*
 * $Id: widget_utils.h,v 1.2 2001/01/02 14:16:15 zakkr Exp $
 */

#ifndef __WIDGET_UTILS_H
#define __WIDGET_UTILS_H

extern int 	get_astr_size(Widget *w);
extern int	init_str_list(char **list, int num, int flag, char *text_domain);
extern void 	W_mvaddastr (Widget *w, int m, int n, char *astr, int c, int c2);
extern int 	is_mouse_in_menu(SessW *s, Widget *w, Wmenu *m); 
extern int	is_mouse_in_widget(Widget *w, SessW *s); 
extern int 	widget_keys(int key, Widget *w, SessW *s);

#if DEBUG==1
#define DEBUG_WIDGET(_w, _s) {									\
	fprintf(stderr, "WIDGET:\n\tID: %d\n", (_w)->id);					\
	if ((_w)->id == (_s)->actual)								\
		fprintf(stderr, "\tI'M ACTUAL WIDGET !\n");					\
	if ( (_w)->hotkey) { 									\
		char		*_key;								\
		_key = (char *) keyname((_w)->hotkey);						\
		if (key)	fprintf(stderr, "\tHotkey: %s\n", _key);			\
		else		fprintf(stderr, "\tHotkey: %c\n", (_w)->hotkey);		\
	}											\
	if ((_w)->flag) {									\
		fprintf(stderr, "\tFlag: ");							\
		if ((_w)->flag & Wf_DEFAULT) 		fprintf(stderr, "DEFAULT ");		\
		if ((_w)->flag & Wf_NOTVISIBLE) 	fprintf(stderr, "NOTVISIBLE ");		\
		if ((_w)->flag & Wf_NOTUSE_ASTR)	fprintf(stderr, "NOTUSE_ASTR ");	\
		fprintf(stderr, "\n");								\
	}											\
	fprintf(stderr, "\tActual widget: %d\n", (_s)->actual);					\
	fprintf(stderr, "\tSession lock: %s\n", (_s)->lock==0 ? "UNLOCK"    : 			\
						(_s)->lock==1 ? "SOFT_LOCK" : 			\
						"HOTKEY_LOCK");					\
	if ( (_s)->key) { 									\
		char		*_key;								\
		_key = (char *) keyname((_s)->key);						\
		if (key)	fprintf(stderr, "\tSession key: %s\n", _key);			\
		else		fprintf(stderr, "\tSession key: %c\n", (_s)->key);		\
	}											\
}                 										
#else 
	#define DEBUG_WIDGET(_w,_s)	
#endif

#endif