2001-08-28 11:44:52 -07:00
|
|
|
/*
|
|
|
|
* Wine server USER definitions
|
|
|
|
*
|
|
|
|
* Copyright (C) 2001 Alexandre Julliard
|
2002-03-09 16:29:33 -07:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library 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
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 05:49:52 -07:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2001-08-28 11:44:52 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __WINE_SERVER_USER_H
|
|
|
|
#define __WINE_SERVER_USER_H
|
|
|
|
|
|
|
|
#include "wine/server_protocol.h"
|
|
|
|
|
|
|
|
struct thread;
|
2004-06-23 13:44:58 -07:00
|
|
|
struct region;
|
2001-08-28 11:44:52 -07:00
|
|
|
struct window;
|
2001-11-13 15:23:48 -07:00
|
|
|
struct msg_queue;
|
2003-07-03 11:16:48 -07:00
|
|
|
struct hook_table;
|
2003-12-09 21:08:06 -07:00
|
|
|
struct window_class;
|
2005-07-07 04:29:23 -07:00
|
|
|
struct atom_table;
|
2005-06-29 13:13:36 -07:00
|
|
|
struct clipboard;
|
2001-08-28 11:44:52 -07:00
|
|
|
|
|
|
|
enum user_object
|
|
|
|
{
|
2002-10-28 17:41:42 -07:00
|
|
|
USER_WINDOW = 1,
|
2009-10-12 05:25:01 -07:00
|
|
|
USER_HOOK,
|
|
|
|
USER_CLIENT /* arbitrary client handle */
|
2001-08-28 11:44:52 -07:00
|
|
|
};
|
|
|
|
|
2005-07-08 04:37:40 -07:00
|
|
|
#define DESKTOP_ATOM ((atom_t)32769)
|
|
|
|
|
2005-07-11 03:55:53 -07:00
|
|
|
struct winstation
|
|
|
|
{
|
|
|
|
struct object obj; /* object header */
|
|
|
|
unsigned int flags; /* winstation flags */
|
|
|
|
struct list entry; /* entry in global winstation list */
|
|
|
|
struct list desktops; /* list of desktops of this winstation */
|
|
|
|
struct clipboard *clipboard; /* clipboard information */
|
|
|
|
struct atom_table *atom_table; /* global atom table */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct desktop
|
|
|
|
{
|
2006-03-06 13:02:24 -07:00
|
|
|
struct object obj; /* object header */
|
|
|
|
unsigned int flags; /* desktop flags */
|
|
|
|
struct winstation *winstation; /* winstation this desktop belongs to */
|
|
|
|
struct list entry; /* entry in winstation list of desktops */
|
|
|
|
struct window *top_window; /* desktop window for this desktop */
|
2008-06-25 05:43:39 -07:00
|
|
|
struct window *msg_window; /* HWND_MESSAGE top window */
|
2006-03-06 13:02:24 -07:00
|
|
|
struct hook_table *global_hooks; /* table of global hooks on this desktop */
|
|
|
|
struct timeout_user *close_timeout; /* timeout before closing the desktop */
|
|
|
|
unsigned int users; /* processes and threads using this desktop */
|
2005-07-11 03:55:53 -07:00
|
|
|
};
|
|
|
|
|
2001-08-28 11:44:52 -07:00
|
|
|
/* user handles functions */
|
|
|
|
|
|
|
|
extern user_handle_t alloc_user_handle( void *ptr, enum user_object type );
|
|
|
|
extern void *get_user_object( user_handle_t handle, enum user_object type );
|
|
|
|
extern void *get_user_object_handle( user_handle_t *handle, enum user_object type );
|
2001-09-12 10:09:24 -07:00
|
|
|
extern user_handle_t get_user_full_handle( user_handle_t handle );
|
2001-08-28 11:44:52 -07:00
|
|
|
extern void *free_user_handle( user_handle_t handle );
|
|
|
|
extern void *next_user_handle( user_handle_t *handle, enum user_object type );
|
2009-10-15 08:56:04 -07:00
|
|
|
extern void free_process_user_handles( struct process *process );
|
2001-08-28 11:44:52 -07:00
|
|
|
|
2003-06-23 16:02:02 -07:00
|
|
|
/* clipboard functions */
|
|
|
|
|
|
|
|
extern void cleanup_clipboard_thread( struct thread *thread );
|
|
|
|
|
2002-11-20 12:54:32 -07:00
|
|
|
/* hook functions */
|
|
|
|
|
2003-07-11 14:55:58 -07:00
|
|
|
extern void remove_thread_hooks( struct thread *thread );
|
2005-05-11 06:03:15 -07:00
|
|
|
extern unsigned int get_active_hooks(void);
|
2002-11-20 12:54:32 -07:00
|
|
|
|
2001-08-28 11:44:52 -07:00
|
|
|
/* queue functions */
|
|
|
|
|
2002-08-16 16:30:41 -07:00
|
|
|
extern void free_msg_queue( struct thread *thread );
|
2003-07-03 11:16:48 -07:00
|
|
|
extern struct hook_table *get_queue_hooks( struct thread *thread );
|
|
|
|
extern void set_queue_hooks( struct thread *thread, struct hook_table *hooks );
|
2001-11-13 15:23:48 -07:00
|
|
|
extern void inc_queue_paint_count( struct thread *thread, int incr );
|
2001-08-28 11:44:52 -07:00
|
|
|
extern void queue_cleanup_window( struct thread *thread, user_handle_t win );
|
2005-04-26 07:31:33 -07:00
|
|
|
extern int init_thread_queue( struct thread *thread );
|
2002-10-11 11:50:15 -07:00
|
|
|
extern int attach_thread_input( struct thread *thread_from, struct thread *thread_to );
|
2005-07-11 06:30:23 -07:00
|
|
|
extern void detach_thread_input( struct thread *thread_from );
|
2002-03-23 13:43:52 -07:00
|
|
|
extern void post_message( user_handle_t win, unsigned int message,
|
2008-12-10 08:01:50 -07:00
|
|
|
lparam_t wparam, lparam_t lparam );
|
2005-02-03 09:40:20 -07:00
|
|
|
extern void post_win_event( struct thread *thread, unsigned int event,
|
|
|
|
user_handle_t win, unsigned int object_id,
|
2008-12-29 09:35:35 -07:00
|
|
|
unsigned int child_id, client_ptr_t proc,
|
2006-07-26 01:43:25 -07:00
|
|
|
const WCHAR *module, data_size_t module_size,
|
2005-02-03 09:40:20 -07:00
|
|
|
user_handle_t handle );
|
2001-08-28 11:44:52 -07:00
|
|
|
|
2004-06-23 13:44:58 -07:00
|
|
|
/* region functions */
|
|
|
|
|
2005-02-22 12:42:35 -07:00
|
|
|
extern struct region *create_empty_region(void);
|
2006-07-26 01:43:25 -07:00
|
|
|
extern struct region *create_region_from_req_data( const void *data, data_size_t size );
|
2004-06-23 13:44:58 -07:00
|
|
|
extern void free_region( struct region *region );
|
|
|
|
extern void set_region_rect( struct region *region, const rectangle_t *rect );
|
2006-07-26 01:43:25 -07:00
|
|
|
extern rectangle_t *get_region_data( const struct region *region, data_size_t max_size,
|
|
|
|
data_size_t *total_size );
|
|
|
|
extern rectangle_t *get_region_data_and_free( struct region *region, data_size_t max_size,
|
|
|
|
data_size_t *total_size );
|
2004-06-23 13:44:58 -07:00
|
|
|
extern int is_region_empty( const struct region *region );
|
|
|
|
extern void get_region_extents( const struct region *region, rectangle_t *rect );
|
|
|
|
extern void offset_region( struct region *region, int x, int y );
|
|
|
|
extern struct region *copy_region( struct region *dst, const struct region *src );
|
|
|
|
extern struct region *intersect_region( struct region *dst, const struct region *src1,
|
|
|
|
const struct region *src2 );
|
|
|
|
extern struct region *subtract_region( struct region *dst, const struct region *src1,
|
|
|
|
const struct region *src2 );
|
|
|
|
extern struct region *union_region( struct region *dst, const struct region *src1,
|
|
|
|
const struct region *src2 );
|
2004-09-07 18:34:22 -07:00
|
|
|
extern struct region *xor_region( struct region *dst, const struct region *src1,
|
|
|
|
const struct region *src2 );
|
2004-07-20 15:17:38 -07:00
|
|
|
extern int point_in_region( struct region *region, int x, int y );
|
2004-09-01 15:49:14 -07:00
|
|
|
extern int rect_in_region( struct region *region, const rectangle_t *rect );
|
2004-06-23 13:44:58 -07:00
|
|
|
|
2001-08-28 11:44:52 -07:00
|
|
|
/* window functions */
|
|
|
|
|
2006-03-06 13:02:24 -07:00
|
|
|
extern struct process *get_top_window_owner( struct desktop *desktop );
|
|
|
|
extern void close_desktop_window( struct desktop *desktop );
|
2005-07-11 06:30:23 -07:00
|
|
|
extern void destroy_window( struct window *win );
|
2001-08-28 11:44:52 -07:00
|
|
|
extern void destroy_thread_windows( struct thread *thread );
|
2001-09-21 14:08:40 -07:00
|
|
|
extern int is_child_window( user_handle_t parent, user_handle_t child );
|
2002-10-11 16:41:06 -07:00
|
|
|
extern int is_top_level_window( user_handle_t window );
|
2004-10-27 14:54:41 -07:00
|
|
|
extern int is_window_visible( user_handle_t window );
|
2010-06-11 03:20:41 -07:00
|
|
|
extern int is_window_transparent( user_handle_t window );
|
2002-10-11 16:41:06 -07:00
|
|
|
extern int make_window_active( user_handle_t window );
|
2002-03-23 13:43:52 -07:00
|
|
|
extern struct thread *get_window_thread( user_handle_t handle );
|
2005-07-11 06:30:23 -07:00
|
|
|
extern user_handle_t window_from_point( struct desktop *desktop, int x, int y );
|
2001-11-14 14:28:36 -07:00
|
|
|
extern user_handle_t find_window_to_repaint( user_handle_t parent, struct thread *thread );
|
2003-12-09 21:08:06 -07:00
|
|
|
extern struct window_class *get_window_class( user_handle_t window );
|
|
|
|
|
|
|
|
/* window class functions */
|
|
|
|
|
|
|
|
extern void destroy_process_classes( struct process *process );
|
2003-12-10 22:34:53 -07:00
|
|
|
extern struct window_class *grab_class( struct process *process, atom_t atom,
|
2008-12-29 08:41:44 -07:00
|
|
|
mod_handle_t instance, int *extra_bytes );
|
2003-12-09 21:08:06 -07:00
|
|
|
extern void release_class( struct window_class *class );
|
2006-03-06 12:37:52 -07:00
|
|
|
extern int is_desktop_class( struct window_class *class );
|
2008-06-25 05:43:39 -07:00
|
|
|
extern int is_hwnd_message_class( struct window_class *class );
|
2003-12-09 21:08:06 -07:00
|
|
|
extern atom_t get_class_atom( struct window_class *class );
|
2008-12-29 09:24:33 -07:00
|
|
|
extern client_ptr_t get_class_client_ptr( struct window_class *class );
|
2001-08-28 11:44:52 -07:00
|
|
|
|
2005-06-08 11:44:50 -07:00
|
|
|
/* windows station functions */
|
|
|
|
|
2008-03-18 07:17:40 -07:00
|
|
|
extern struct desktop *get_desktop_obj( struct process *process, obj_handle_t handle, unsigned int access );
|
2005-06-29 13:13:36 -07:00
|
|
|
extern struct winstation *get_process_winstation( struct process *process, unsigned int access );
|
2005-07-11 03:55:53 -07:00
|
|
|
extern struct desktop *get_thread_desktop( struct thread *thread, unsigned int access );
|
2006-03-27 03:57:17 -07:00
|
|
|
extern void connect_process_winstation( struct process *process, struct thread *parent );
|
|
|
|
extern void set_process_default_desktop( struct process *process, struct desktop *desktop,
|
|
|
|
obj_handle_t handle );
|
2006-03-06 13:02:24 -07:00
|
|
|
extern void close_process_desktop( struct process *process );
|
2005-06-08 11:44:50 -07:00
|
|
|
extern void close_thread_desktop( struct thread *thread );
|
|
|
|
|
2001-08-28 11:44:52 -07:00
|
|
|
#endif /* __WINE_SERVER_USER_H */
|