WM_WINDOWPOSCHANGED should always contain a final window position.
[wine.git] / server / user.h
blobf6b960df871d0e1b062f1be2c51d594ffbd9ef48
1 /*
2 * Wine server USER definitions
4 * Copyright (C) 2001 Alexandre Julliard
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.
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.
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
21 #ifndef __WINE_SERVER_USER_H
22 #define __WINE_SERVER_USER_H
24 #include "wine/server_protocol.h"
26 struct thread;
27 struct region;
28 struct window;
29 struct msg_queue;
30 struct hook_table;
31 struct window_class;
33 enum user_object
35 USER_WINDOW = 1,
36 USER_HOOK
39 /* user handles functions */
41 extern user_handle_t alloc_user_handle( void *ptr, enum user_object type );
42 extern void *get_user_object( user_handle_t handle, enum user_object type );
43 extern void *get_user_object_handle( user_handle_t *handle, enum user_object type );
44 extern user_handle_t get_user_full_handle( user_handle_t handle );
45 extern void *free_user_handle( user_handle_t handle );
46 extern void *next_user_handle( user_handle_t *handle, enum user_object type );
48 /* clipboard functions */
50 extern void cleanup_clipboard_thread( struct thread *thread );
52 /* hook functions */
54 extern void close_global_hooks(void);
55 extern void remove_thread_hooks( struct thread *thread );
57 /* queue functions */
59 extern void free_msg_queue( struct thread *thread );
60 extern struct hook_table *get_queue_hooks( struct thread *thread );
61 extern void set_queue_hooks( struct thread *thread, struct hook_table *hooks );
62 extern void inc_queue_paint_count( struct thread *thread, int incr );
63 extern void queue_cleanup_window( struct thread *thread, user_handle_t win );
64 extern int attach_thread_input( struct thread *thread_from, struct thread *thread_to );
65 extern void post_message( user_handle_t win, unsigned int message,
66 unsigned int wparam, unsigned int lparam );
68 /* region functions */
70 extern struct region *create_region( const rectangle_t *rects, unsigned int nb_rects );
71 extern void free_region( struct region *region );
72 extern void set_region_rect( struct region *region, const rectangle_t *rect );
73 extern rectangle_t *get_region_data( const struct region *region, size_t *total_size );
74 extern rectangle_t *get_region_data_and_free( struct region *region, size_t *total_size );
75 extern int is_region_empty( const struct region *region );
76 extern void get_region_extents( const struct region *region, rectangle_t *rect );
77 extern void offset_region( struct region *region, int x, int y );
78 extern struct region *copy_region( struct region *dst, const struct region *src );
79 extern struct region *intersect_region( struct region *dst, const struct region *src1,
80 const struct region *src2 );
81 extern struct region *subtract_region( struct region *dst, const struct region *src1,
82 const struct region *src2 );
83 extern struct region *union_region( struct region *dst, const struct region *src1,
84 const struct region *src2 );
85 static inline struct region *create_empty_region(void) { return create_region( NULL, 0 ); }
87 /* window functions */
89 extern void destroy_thread_windows( struct thread *thread );
90 extern int is_child_window( user_handle_t parent, user_handle_t child );
91 extern int is_top_level_window( user_handle_t window );
92 extern int make_window_active( user_handle_t window );
93 extern struct thread *get_window_thread( user_handle_t handle );
94 extern user_handle_t window_from_point( int x, int y );
95 extern user_handle_t find_window_to_repaint( user_handle_t parent, struct thread *thread );
96 extern struct window_class *get_window_class( user_handle_t window );
98 /* window class functions */
100 extern void destroy_process_classes( struct process *process );
101 extern struct window_class *grab_class( struct process *process, atom_t atom,
102 void *instance, int *extra_bytes );
103 extern void release_class( struct window_class *class );
104 extern atom_t get_class_atom( struct window_class *class );
105 extern void *get_class_client_ptr( struct window_class *class );
107 #endif /* __WINE_SERVER_USER_H */