cl monitors
1.0.0Bindings to libmonitors, allowing the handling of monitors querying and resolution changing.
Table of Contents
About cl-monitors
This is a small wrapper library around libmonitors, providing independent monitor resolution detection and change support.
How To
Precompiled versions of the underlying library are included in this. If you want to build it manually however, refer to the libmonitors README.
Load the system through ASDF or Quicklisp and initialise it:
(ql:quickload :cl-monitors)
(cl-monitors:init)
Now you can retrieve a list of the monitors on your system:
(cl-monitors:detect)
You can inspect the available video modes for each of them too:
(mapcar #'cl-monitors:modes *)
And even switch the mode:
(cl-monitors:make-current (second (first *)))
Though you probably want to switch back again to your preferred resolution:
(cl-monitors:make-current (first (first **)))
Once you're all done, don't forget to clean up again after yourself:
(cl-monitors:deinit)
And that's all there is to it. Well-- almost all. You can query information from the monitor and mode objects as well of course. For this, see width, height, refresh, current-p, mode, name, and primary-p.
System Information
Definition Index
-
CL-MONITORS
- ORG.SHIRAKUMO.FRAF.MONITORS
No documentation provided.-
EXTERNAL CLASS MODE
-
EXTERNAL CLASS MONITOR
-
EXTERNAL CONDITION DETECTION-FAILED-ERROR
Condition for when the monitor detection fails. See DETECT See MONITOR-CONDITION
-
EXTERNAL CONDITION INITIALIZATION-FAILED-ERROR
Condition for when the monitor initialization fails. See INIT See MONITOR-CONDITION
-
EXTERNAL CONDITION MODE-SWITCH-FAILED-ERROR
Condition for when the mode switch call fails. See MODE See MONITOR-CONDITION
-
EXTERNAL CONDITION MONITOR-CONDITION
Base condition class for conditions relating to this library.
-
EXTERNAL FUNCTION DEINIT
Cleans up the library. You should call this once you are done with everything.
-
EXTERNAL FUNCTION DETECT
Detects the monitors and modes on the system. Returns a list of monitors on the system. Signals a DETECTION-FAILED-ERROR on failured. See MONITOR
-
EXTERNAL FUNCTION INIT
Initializes the library. You should call this before any other function to the library is called. Signals an INITIALIZATION-FAILED-ERROR on failure.
-
EXTERNAL FUNCTION MAKE-CURRENT
- MODE
Attempts to make the passed mode the current one. This is equivalent to doing (SETF (MODE (MONITOR mode)) mode). See MODE
-
EXTERNAL GENERIC-FUNCTION CURRENT-P
- MODE
Returns whether the mode is the current mode of the monitor. See MODE
-
EXTERNAL GENERIC-FUNCTION HEIGHT
- MODE
-
EXTERNAL GENERIC-FUNCTION MODE
- CONDITION
-
EXTERNAL GENERIC-FUNCTION (SETF MODE)
- MODE
- MONITOR
No documentation provided. -
EXTERNAL GENERIC-FUNCTION MODES
- OBJECT
Returns the list of possible modes the monitor can assume. A pox upon those that modify this list. See MONITOR
-
EXTERNAL GENERIC-FUNCTION MONITOR
- OBJECT
-
EXTERNAL GENERIC-FUNCTION NAME
- MONITOR
Returns the monitor's name on the system. See MONITOR
-
EXTERNAL GENERIC-FUNCTION PRIMARY-P
- MONITOR
Returns whether the monitor is the system's primary monitor. See MONITOR
-
EXTERNAL GENERIC-FUNCTION REFRESH
- MODE
Returns the mode's refresh rate in Herz. See MODE
-
EXTERNAL GENERIC-FUNCTION WIDTH
- MODE
-
CL-MONITORS-CFFI
- ORG.SHIRAKUMO.FRAF.MONITORS.CFFI
No documentation provided.-
EXTERNAL SPECIAL-VARIABLE *STATIC*
Variable containing a pathname to the static directory.
-
EXTERNAL CLASS MODE-STRUCT
CL type for the C mode struct. See MODE-MONITOR See MODE-WIDTH See MODE-HEIGHT See MODE-REFRESH See MODE-DATA
-
EXTERNAL CLASS MONITOR-STRUCT
CL type for the C monitor struct. See MONITOR-NAME See MONITOR-PRIMARY See MONITOR-WIDTH See MONITOR-HEIGHT See MONITOR-MODE-COUNT See MONITOR-CURRENT-MODE See MONITOR-MODES See MONITOR-DATA See MONITORS-FREE-MONITOR
-
EXTERNAL FUNCTION MODE-DATA
- POINTER-TO-MODE-STRUCT
Reads the pointer to the system-dependant data struct of the mode. You should not need this for anything. See MODE-STRUCT
-
EXTERNAL FUNCTION (SETF MODE-DATA)
- VALUE
- POINTER-TO-MODE-STRUCT
No documentation provided. -
EXTERNAL FUNCTION MODE-HEIGHT
- POINTER-TO-MODE-STRUCT
Reads the mode's height in pixels. See MODE-STRUCT
-
EXTERNAL FUNCTION (SETF MODE-HEIGHT)
- VALUE
- POINTER-TO-MODE-STRUCT
No documentation provided. -
EXTERNAL FUNCTION MODE-MONITOR
- POINTER-TO-MODE-STRUCT
Reads the pointer to the monitor struct this mode originated from. See MODE-STRUCT
-
EXTERNAL FUNCTION (SETF MODE-MONITOR)
- VALUE
- POINTER-TO-MODE-STRUCT
No documentation provided. -
EXTERNAL FUNCTION MODE-REFRESH
- POINTER-TO-MODE-STRUCT
Reads the mode's refresh rate in Herz. See MODE-STRUCT
-
EXTERNAL FUNCTION (SETF MODE-REFRESH)
- VALUE
- POINTER-TO-MODE-STRUCT
No documentation provided. -
EXTERNAL FUNCTION MODE-WIDTH
- POINTER-TO-MODE-STRUCT
Reads the mode's width in pixels. See MODE-STRUCT
-
EXTERNAL FUNCTION (SETF MODE-WIDTH)
- VALUE
- POINTER-TO-MODE-STRUCT
No documentation provided. -
EXTERNAL FUNCTION MONITOR-CURRENT-MODE
- POINTER-TO-MONITOR-STRUCT
Reads the pointer to the current mode of the monitor. See MONITOR-STRUCT
-
EXTERNAL FUNCTION (SETF MONITOR-CURRENT-MODE)
- VALUE
- POINTER-TO-MONITOR-STRUCT
No documentation provided. -
EXTERNAL FUNCTION MONITOR-DATA
- POINTER-TO-MONITOR-STRUCT
Reads the pointer to the system-dependant data struct of the monitor. You should not need this for anything. See MONITOR-STRUCT
-
EXTERNAL FUNCTION (SETF MONITOR-DATA)
- VALUE
- POINTER-TO-MONITOR-STRUCT
No documentation provided. -
EXTERNAL FUNCTION MONITOR-HEIGHT
- POINTER-TO-MONITOR-STRUCT
Reads the monitor's physical height in millimetres. See MONITOR-STRUCT
-
EXTERNAL FUNCTION (SETF MONITOR-HEIGHT)
- VALUE
- POINTER-TO-MONITOR-STRUCT
No documentation provided. -
EXTERNAL FUNCTION MONITOR-MODE-COUNT
- POINTER-TO-MONITOR-STRUCT
Reads the count for how many mode structs there are in the mode field of the monitor. See MONITOR-MODES See MONITOR-STRUCT
-
EXTERNAL FUNCTION (SETF MONITOR-MODE-COUNT)
- VALUE
- POINTER-TO-MONITOR-STRUCT
No documentation provided. -
EXTERNAL FUNCTION MONITOR-MODES
- POINTER-TO-MONITOR-STRUCT
Reads the pointer to the packed mode struct array of the monitor. See MONITOR-MODE-COUNT See MONITOR-STRUCT
-
EXTERNAL FUNCTION (SETF MONITOR-MODES)
- VALUE
- POINTER-TO-MONITOR-STRUCT
No documentation provided. -
EXTERNAL FUNCTION MONITOR-NAME
- POINTER-TO-MONITOR-STRUCT
Reads the monitor's name string. See MONITOR-STRUCT
-
EXTERNAL FUNCTION (SETF MONITOR-NAME)
- VALUE
- POINTER-TO-MONITOR-STRUCT
No documentation provided. -
EXTERNAL FUNCTION MONITOR-PRIMARY
- POINTER-TO-MONITOR-STRUCT
Reads whether the monitor is the primary monitor of the system. See MONITOR-STRUCT
-
EXTERNAL FUNCTION (SETF MONITOR-PRIMARY)
- VALUE
- POINTER-TO-MONITOR-STRUCT
No documentation provided. -
EXTERNAL FUNCTION MONITOR-WIDTH
- POINTER-TO-MONITOR-STRUCT
Reads the monitor's physical width in millimetres. See MONITOR-STRUCT
-
EXTERNAL FUNCTION (SETF MONITOR-WIDTH)
- VALUE
- POINTER-TO-MONITOR-STRUCT
No documentation provided. -
EXTERNAL FUNCTION MONITORS-DEINIT
Cleans up the monitors library. You should call this once you are done with everything.
-
EXTERNAL FUNCTION MONITORS-DETECT
- COUNT
- MONITORS
Detects the monitors and their modes on the system. You need to pass this two "empty" pointers. The first will be set to reference an int for the number of monitors that were detected, and the second to an array of pointers to monitor structs. If NIL is returned, the detection failed and the two pointers you passed will not have changed. See MONITOR-STRUCT
-
EXTERNAL FUNCTION MONITORS-FREE-MONITOR
- MONITOR
Frees a monitor struct. See MONITOR-STRUCT
-
EXTERNAL FUNCTION MONITORS-FREE-MONITORS
- COUNT
- MONITORS
Frees an array of pointers to monitor objects, including the monitors referenced by it. See MONITORS-FREE-MONITOR
-
EXTERNAL FUNCTION MONITORS-INIT
Initializes the monitors library. You should call this before anything. If NIL is returned, the initialisation failed and other library calls will most likely too.
-
EXTERNAL FUNCTION MONITORS-MAKE-MODE-CURRENT
- MODE
Attempts to make the given mode the current mode on its monitor. If NIL is returned, the mode change failed. Otherwise the monitor's current mode is updated to reflect the newly chose none. See MODE-STRUCT See MONITOR-CURRENT-MODE