Subversion Repositories SvarDOS

Rev

Rev 1360 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1360 Rev 1542
Line 2... Line 2...
2
 * Mouse routines
2
 * Mouse routines
3
 *
3
 *
4
 * This file is part of the Mateusz' DOS Routines (MDR): http://mdr.osdn.io
4
 * This file is part of the Mateusz' DOS Routines (MDR): http://mdr.osdn.io
5
 * Published under the terms of the MIT License, as stated below.
5
 * Published under the terms of the MIT License, as stated below.
6
 *
6
 *
7
 * Copyright (C) 2014-2022 Mateusz Viste
7
 * Copyright (C) 2014-2023 Mateusz Viste
8
 *
8
 *
9
 * Permission is hereby granted, free of charge, to any person obtaining a copy
9
 * Permission is hereby granted, free of charge, to any person obtaining a copy
10
 * of this software and associated documentation files (the "Software"), to
10
 * of this software and associated documentation files (the "Software"), to
11
 * deal in the Software without restriction, including without limitation the
11
 * deal in the Software without restriction, including without limitation the
12
 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12
 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
Line 27... Line 27...
27
 
27
 
28
#ifndef MDR_MOUSE_H
28
#ifndef MDR_MOUSE_H
29
  #define MDR_MOUSE_H
29
  #define MDR_MOUSE_H
30
 
30
 
31
  /* init the mouse driver (and checks for presence of mouse support at same time)
31
  /* init the mouse driver (and checks for presence of mouse support at same time)
32
   * returns 0 if no mouse is present, and the number of buttons otherwise */
32
   * returns 0 if no mouse is present, and the number of buttons otherwise.
-
 
33
   * after initialization the mouse cursor is hidden, use mdr_mouse_show() to
-
 
34
   * make it visible. */
33
  int mouse_init(void);
35
  int mdr_mouse_init(void);
34
 
36
 
35
  /* shows the mouse pointer */
37
  /* shows the mouse pointer */
36
  void mouse_show(void);
38
  void mdr_mouse_show(void);
37
 
39
 
38
  /* hides the mouse pointer */
40
  /* hides the mouse pointer */
39
  void mouse_hide(void);
41
  void mdr_mouse_hide(void);
40
 
42
 
41
  /* get x/y coordinates of the mouse, and returns a bitfield with state of buttons */
43
  /* get x/y coordinates of the mouse, and returns a bitfield with state of buttons */
42
  int mouse_getstate(int *x, int *y);
44
  int mdr_mouse_getstate(int *x, int *y);
43
 
45
 
44
  /* get x/y coordinates of the mouse when the last button release occured since last check.
46
  /* get x/y coordinates of the mouse when the last button release occured since last check.
45
     returns the id of the button pressed (1 or 2), or 0 if no event occured. */
47
     returns the id of the button pressed (1 or 2), or 0 if no event occured. */
46
  int mouse_fetchrelease(int *x, int *y);
48
  int mdr_mouse_fetchrelease(int *x, int *y);
-
 
49
 
-
 
50
  /* set graphic pointer shape. icon is 64-bytes long, two sets of 32. each set
-
 
51
   * of 32 bytes is organized as a 16x16 bitmap, ie. 16 rows of 16-bit values.
-
 
52
   * a) the first set of 16 shorts defines the background mask - that is, the
-
 
53
   * background will show through wherever there is a 1-bit in that data.
-
 
54
   * b) the second set defines the "XOR mask" - that is, the pixels matching the
-
 
55
   * 1-bit in this data set are toggled.
-
 
56
   * hotspotx and hotspoty define respectively the horizontal and vertical hot
-
 
57
   * spot of the pointer (default being [0,0], that is the top left corner). */
-
 
58
  void mdr_mouse_setcursor(const unsigned short *icon, unsigned char hotspotx, unsigned char hotspoty);
47
 
59
 
48
#endif
60
#endif