Return correct attributes in ParseDisplayName.
[wine] / server / user.h
1 /*
2  * Wine server USER definitions
3  *
4  * Copyright (C) 2001 Alexandre Julliard
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #ifndef __WINE_SERVER_USER_H
22 #define __WINE_SERVER_USER_H
23
24 #include "wine/server_protocol.h"
25
26 struct thread;
27 struct region;
28 struct window;
29 struct msg_queue;
30 struct hook_table;
31 struct window_class;
32 struct clipboard;
33
34 enum user_object
35 {
36     USER_WINDOW = 1,
37     USER_HOOK
38 };
39
40 /* user handles functions */
41
42 extern user_handle_t alloc_user_handle( void *ptr, enum user_object type );
43 extern void *get_user_object( user_handle_t handle, enum user_object type );
44 extern void *get_user_object_handle( user_handle_t *handle, enum user_object type );
45 extern user_handle_t get_user_full_handle( user_handle_t handle );
46 extern void *free_user_handle( user_handle_t handle );
47 extern void *next_user_handle( user_handle_t *handle, enum user_object type );
48
49 /* clipboard functions */
50
51 extern void cleanup_clipboard_thread( struct thread *thread );
52
53 /* hook functions */
54
55 extern void close_global_hooks(void);
56 extern void remove_thread_hooks( struct thread *thread );
57 extern unsigned int get_active_hooks(void);
58
59 /* queue functions */
60
61 extern void free_msg_queue( struct thread *thread );
62 extern struct hook_table *get_queue_hooks( struct thread *thread );
63 extern void set_queue_hooks( struct thread *thread, struct hook_table *hooks );
64 extern void inc_queue_paint_count( struct thread *thread, int incr );
65 extern void queue_cleanup_window( struct thread *thread, user_handle_t win );
66 extern int init_thread_queue( struct thread *thread );
67 extern int attach_thread_input( struct thread *thread_from, struct thread *thread_to );
68 extern void post_message( user_handle_t win, unsigned int message,
69                           unsigned int wparam, unsigned int lparam );
70 extern void post_win_event( struct thread *thread, unsigned int event,
71                             user_handle_t win, unsigned int object_id,
72                             unsigned int child_id, void *proc,
73                             const WCHAR *module, size_t module_size,
74                             user_handle_t handle );
75
76 /* region functions */
77
78 extern struct region *create_empty_region(void);
79 extern struct region *create_region_from_req_data( const void *data, size_t size );
80 extern void free_region( struct region *region );
81 extern void set_region_rect( struct region *region, const rectangle_t *rect );
82 extern rectangle_t *get_region_data( const struct region *region, size_t max_size,
83                                      size_t *total_size );
84 extern rectangle_t *get_region_data_and_free( struct region *region, size_t max_size,
85                                               size_t *total_size );
86 extern int is_region_empty( const struct region *region );
87 extern void get_region_extents( const struct region *region, rectangle_t *rect );
88 extern void offset_region( struct region *region, int x, int y );
89 extern struct region *copy_region( struct region *dst, const struct region *src );
90 extern struct region *intersect_region( struct region *dst, const struct region *src1,
91                                         const struct region *src2 );
92 extern struct region *subtract_region( struct region *dst, const struct region *src1,
93                                        const struct region *src2 );
94 extern struct region *union_region( struct region *dst, const struct region *src1,
95                                     const struct region *src2 );
96 extern struct region *xor_region( struct region *dst, const struct region *src1,
97                                   const struct region *src2 );
98 extern int point_in_region( struct region *region, int x, int y );
99 extern int rect_in_region( struct region *region, const rectangle_t *rect );
100
101 /* window functions */
102
103 extern void destroy_thread_windows( struct thread *thread );
104 extern int is_child_window( user_handle_t parent, user_handle_t child );
105 extern int is_top_level_window( user_handle_t window );
106 extern int is_window_visible( user_handle_t window );
107 extern int make_window_active( user_handle_t window );
108 extern struct thread *get_window_thread( user_handle_t handle );
109 extern user_handle_t window_from_point( int x, int y );
110 extern user_handle_t find_window_to_repaint( user_handle_t parent, struct thread *thread );
111 extern struct window_class *get_window_class( user_handle_t window );
112
113 /* window class functions */
114
115 extern void destroy_process_classes( struct process *process );
116 extern struct window_class *grab_class( struct process *process, atom_t atom,
117                                         void *instance, int *extra_bytes );
118 extern void release_class( struct window_class *class );
119 extern atom_t get_class_atom( struct window_class *class );
120 extern void *get_class_client_ptr( struct window_class *class );
121
122 /* windows station functions */
123
124 extern struct winstation *get_process_winstation( struct process *process, unsigned int access );
125 extern void set_winstation_clipboard( struct winstation *winstation, struct clipboard *clipboard );
126 extern struct clipboard *get_winstation_clipboard( struct winstation *winstation );
127 extern void connect_process_winstation( struct process *process, const WCHAR *name, size_t len );
128 extern void connect_process_desktop( struct process *process, const WCHAR *name, size_t len );
129 extern void close_thread_desktop( struct thread *thread );
130
131 #endif  /* __WINE_SERVER_USER_H */