File: ax.h

package info (click to toggle)
spectemu 0.94a-1
  • links: PTS
  • area: contrib
  • in suites: woody
  • size: 1,240 kB
  • ctags: 3,088
  • sloc: ansic: 15,419; asm: 5,160; sh: 2,533; cpp: 377; makefile: 221
file content (114 lines) | stat: -rw-r--r-- 3,233 bytes parent folder | download | duplicates (11)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/* 
 * Copyright (C) 1996-1998 Szeredi Miklos
 * Email: mszeredi@inf.bme.hu
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version. See the file COPYING. 
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 */

/*             ax.h
 *
 *     Header of the AX module
 *
 *     
 *     Created:   94/11/11    Szeredi Miklos
 */


#ifndef _AX_H
#define _AX_H

#include <X11/Xlib.h>
#include <X11/Xresource.h>

/*typedef  XrmOptionDescRec aX_options; */

typedef struct {
    const char	    *option;	    /* Option abbreviation in argv	    */
    const char	    *specifier;     /* Resource specifier		    */
    XrmOptionKind   argKind;	    /* Which style of option it is	    */
    const char      *value;	    /* Value to provide if XrmoptionNoArg   */
} aX_options;


#define  AX_NO_EVENT      LASTEvent
#define  AX_ANY_EVENT     0
#define  AX_LOOK_EVENTS    -1

typedef  struct{
         Display          *disp;
	 int              scr;
	 Screen           *scr_ptr;
         unsigned int     width;
	 unsigned int     height;
	 int              x;
	 int              y;
	 unsigned int     border_width;
	 unsigned long    foreground;
	 unsigned long    background;
	 unsigned long    border_color;
	 const char       *font_name;
	 const char       *fallback_font_name;
	 XFontStruct      *font;
	 long             sflags;
	 const char             *prog_name;
	 const char             *class_name;
	 char             *window_name;
	 char             *icon_name;
       } aX_default_resources;


#ifdef __cplusplus
extern "C" {
#endif


extern   void   aX_open_disp(aX_options *useropt, int useroptlen, 
			     int *argcp, char *argv[],
			     aX_default_resources *defres);
extern   void   aX_open_second_disp(char *display_name,
				    aX_default_resources *defres);
extern   void   aX_wait_event(int eventtype);
extern   void   aX_look_events(void);
extern   char   *aX_get_prog_res(const char *resname, const char* resclass);
extern   char   *aX_get_resource(const char *resname, const char* resclass);

extern   void   aX_add_event_proc(Display *disp,
				  Window win,
				  int eventtype,
				  void (*eventproc)(XEvent *, void *),
				  unsigned long eventmask, 
				  void *ptr);

extern   void   aX_remove_event_proc(Display *disp,
				     Window win,
				     int eventtype,
				     void (*eventproc)(XEvent *, void *));
	     
extern   void   aX_close_one_disp(Display *disp);
extern   void   aX_close_disp(void);
extern   unsigned long aX_get_color(Display *disp, int scr, 
			     unsigned long def_col, const char *color_name);


#ifdef __cplusplus
}
#endif


#endif /* _AX_H */

/*         End of ax.h                 */