user.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. #ifndef __WINE_SERVER_USER_H
  21. #define __WINE_SERVER_USER_H
  22. #include "wine/server_protocol.h"
  23. struct thread;
  24. struct region;
  25. struct window;
  26. struct msg_queue;
  27. struct hook_table;
  28. struct window_class;
  29. enum user_object
  30. {
  31. USER_WINDOW = 1,
  32. USER_HOOK
  33. };
  34. /* user handles functions */
  35. extern user_handle_t alloc_user_handle( void *ptr, enum user_object type );
  36. extern void *get_user_object( user_handle_t handle, enum user_object type );
  37. extern void *get_user_object_handle( user_handle_t *handle, enum user_object type );
  38. extern user_handle_t get_user_full_handle( user_handle_t handle );
  39. extern void *free_user_handle( user_handle_t handle );
  40. extern void *next_user_handle( user_handle_t *handle, enum user_object type );
  41. /* clipboard functions */
  42. extern void cleanup_clipboard_thread( struct thread *thread );
  43. /* hook functions */
  44. extern void close_global_hooks(void);
  45. extern void remove_thread_hooks( struct thread *thread );
  46. /* queue functions */
  47. extern void free_msg_queue( struct thread *thread );
  48. extern struct hook_table *get_queue_hooks( struct thread *thread );
  49. extern void set_queue_hooks( struct thread *thread, struct hook_table *hooks );
  50. extern void inc_queue_paint_count( struct thread *thread, int incr );
  51. extern void queue_cleanup_window( struct thread *thread, user_handle_t win );
  52. extern int attach_thread_input( struct thread *thread_from, struct thread *thread_to );
  53. extern void post_message( user_handle_t win, unsigned int message,
  54. unsigned int wparam, unsigned int lparam );
  55. extern void post_win_event( struct thread *thread, unsigned int event,
  56. user_handle_t win, unsigned int object_id,
  57. unsigned int child_id, void *proc,
  58. const WCHAR *module, size_t module_size,
  59. user_handle_t handle );
  60. /* region functions */
  61. extern struct region *create_region( const rectangle_t *rects, unsigned int nb_rects );
  62. extern struct region *create_region_from_req_data( const void *data, size_t size );
  63. extern void free_region( struct region *region );
  64. extern void set_region_rect( struct region *region, const rectangle_t *rect );
  65. extern rectangle_t *get_region_data( const struct region *region, size_t max_size,
  66. size_t *total_size );
  67. extern rectangle_t *get_region_data_and_free( struct region *region, size_t max_size,
  68. size_t *total_size );
  69. extern int is_region_empty( const struct region *region );
  70. extern void get_region_extents( const struct region *region, rectangle_t *rect );
  71. extern void offset_region( struct region *region, int x, int y );
  72. extern struct region *copy_region( struct region *dst, const struct region *src );
  73. extern struct region *intersect_region( struct region *dst, const struct region *src1,
  74. const struct region *src2 );
  75. extern struct region *subtract_region( struct region *dst, const struct region *src1,
  76. const struct region *src2 );
  77. extern struct region *union_region( struct region *dst, const struct region *src1,
  78. const struct region *src2 );
  79. extern struct region *xor_region( struct region *dst, const struct region *src1,
  80. const struct region *src2 );
  81. extern int point_in_region( struct region *region, int x, int y );
  82. extern int rect_in_region( struct region *region, const rectangle_t *rect );
  83. static inline struct region *create_empty_region(void) { return create_region( NULL, 0 ); }
  84. /* window functions */
  85. extern void destroy_thread_windows( struct thread *thread );
  86. extern int is_child_window( user_handle_t parent, user_handle_t child );
  87. extern int is_top_level_window( user_handle_t window );
  88. extern int is_window_visible( user_handle_t window );
  89. extern int make_window_active( user_handle_t window );
  90. extern struct thread *get_window_thread( user_handle_t handle );
  91. extern user_handle_t window_from_point( int x, int y );
  92. extern user_handle_t find_window_to_repaint( user_handle_t parent, struct thread *thread );
  93. extern struct window_class *get_window_class( user_handle_t window );
  94. /* window class functions */
  95. extern void destroy_process_classes( struct process *process );
  96. extern struct window_class *grab_class( struct process *process, atom_t atom,
  97. void *instance, int *extra_bytes );
  98. extern void release_class( struct window_class *class );
  99. extern atom_t get_class_atom( struct window_class *class );
  100. extern void *get_class_client_ptr( struct window_class *class );
  101. #endif /* __WINE_SERVER_USER_H */