-
Notifications
You must be signed in to change notification settings - Fork 0
Structures
##Ellen.h
###Constants
- static const float OLD_THUMB_MIN
- Value for the minimum thumbstick value in SDL2
- static const float OLD_THUMB_MAX
- Max possible value for a thumbstick in SDL2
- static const float OLD_THUMB_RANGE
- Difference between two previous constants
- static const float NEW_THUMB_MIN
- The minimum value for a thumbstick in a controllerStruct
- static const float NEW_THUMB_MAX
- The max value for a thumbstick in a controllerStruct
- static const float NEW_THUMB_RANGE
- The difference between the two previous constants
- static const float OLD_TRIGGER_MIN
- The SDL2 min value for a trigger
- static const float OLD_TRIGGER_MAX
- The SDL2 max value for a trigger
- static const float OLD_TRIGGER_RANGE
- The difference between the two previous constants
- static const float NEW_TRIGGER_MIN
- The min trigger value for a controllerStruct
- static const float NEW_TRIGGER_MAX
- The max trigger value for a controllerStruct
- static const float NEW_TRIGGER_RANGE
- The difference between the two previous constants
- static const std::string AVATAR_PATH
- Path to user profile images in Ubuntu (tested in 14.04 and 15.04)
- static const std::string AVATAR_TYPE
- ".png" for filenames
- static const std::string ERROR_STRING
- Default error value for strings
- static const std::string ERROR_INT
- Default error value for integers
- static const int NUMBER_OF_VERSIONS_TO_LOOK_FORWARD
- How many versions to check ahead of the currently assumed library's version number (for checking if a newer version of a dylib is installed and loading it instead)
- static const int LIBUSB_LATEST_VERSION
- The latest known version of libusb (the last digit, so 0 in 1.2.0)
- static const char LIBUSB_LIB_NAME*
- The name of the file to look up for dynamically opening
- static const char LIBUSB_INIT*
- static const char LIBUSB_GET_DEVICE_LIST*
- static const char LIBUSB_GET_DEVICE_DESCRIPTOR*
- static const char LIBUSB_GET_ACTIVE_CONFIG_DESCRIPTOR*
- static const char LIBUSB_FREE_DEVICE_LIST*
- static const char LIBUSB_EXIT*
- static const char LIBUSB_GET_BUS_NUMBER*
- Names of various libusb symbols for dynamically loading
- static const int LIBSDL_LATEST_VERSION
- Latest known version of libsdl (the last digit, so 0 in 1.2.0)
- static const char LIBSDL_LIB_NAME*
- The name of the file to look up for dynamically loading libsdl
- static const char SDL_NUMJOYSTICKS*
- static const char SDL_ISGAMECONTROLLER*
- static const char SDL_JOYSTICKOPEN*
- static const char SDL_GAMECONTROLLEROPEN*
- static const char SDL_GAMECONTROLLERNAME*
- static const char SDL_JOYSTICKINSTANCEID*
- static const char SDL_GAMECONTROLLERGETAXIS*
- static const char SDL_POLLEVENT*
- static const char SDL_GAMECONTROLLERNAMEFORINDEX*
- static const char SDL_JOYSTICKNAMEFORINDEX*
- static const char SDL_JOYSTICKGETAXIS*
- static const char SDL_SETHINT*
- static const char SDL_CREATEWINDOW*
- static const char SDL_INIT*
- static const char SDL_GL_SETATTRIBUTE*
- static const char SDL_SDL_JOYSTICKNAME*
- static const char SDL_GETNUMVIDEODISPLAYS*
- static const char SDL_GETDISPLAYNAME*
- static const char SDL_GETDISPLAYBOUNDS*
- static const char SDL_GETCURRENTDISPLAYMODE*
- Symbol names for dynamically loading methods from libsdl
###Typedefs Type definitions used for dynamically loaded symbols
- typedef int (libusb_init_t)(libusb_context* context)
- typedef void (libusb_exit_t)(libusb_context context)
- typedef ssize_t (libusb_get_device_list_t)(libusb_context context, libusb_device*** list)
- typedef void (libusb_free_device_list_t)(libusb_device* list, int unref_devices)
- typedef int (libusb_get_device_descriptor_t) (libusb_device device, libusb_device_descriptor* descriptor)
- typedef uint8_t (libusb_get_bus_number_t)(libusb_device dev)
- typedef SDL_bool (*SDL_IsGameController_t)(int joystick_index)
- typedef int (*SDL_NumJoysticks_t)(void)
- typedef SDL_Joystick* (*SDL_JoystickOpen_t)(int device_index)
- typedef SDL_GameController* (*SDL_GameControllerOpen_t)(int joystick _index)
- typedef const char* (SDL_GameControllerName_t)(SDL_GameController gamecontroller)
- typedef SDL_JoystickID (SDL_JoystickInstanceID_t)(SDL_GameController gamecontroller, SDL_GameControllerAxis axis)
- typedef Sint16 (SDL_GameControllerGetAxis_t)(SDL_GameController gamecontroller, SDL_GameControllerAxis axis)
- typedef int (SDL_PollEvent_t)(SDL_Event event)
- typedef const char* (*SDL_GameControllerNameForIndex_t)(int joystick_index)
- typedef const char* (*SDL_JoystickNameForIndex_t)(int joystick_index)
- typedef Sint16 (SDL_JoystickGetAixs_t)(SDL_Joystick joystick, int axis)
- typedef SDL_bool (SDL_SetHint_t)(const char name, const char* value)
- typedef SDL_Window* (SDL_CreateWindow_t)(const char title, int x, int y, int w, int h, Uint32 flags)
- typedef int (*SDL_Init_t)(Uint32 flags);
- typedef int (*SDL_GL_SetAttribute_t)(SDL_GLattr attr, int value)
- typedef const char* (SDL_JoystickName_t)(SDL_Joystick joystick)
- typedef int (*SDL_GetNumVidoeDisplays_t)(void)
- typedef const char* (*SDL_GetDisplayName_t)(int displayIndex)
- typedef int (SDL_GetDisplayBounds_t)(int displayIndex, SDL_Rect rect)
- typedef int (SDL_GetCurrentDisplayMode_t)(int displayIndex, SDL_DisplayMode mode)
###struct libFunc A structure for representing a function that has been dynamically loaded using the dlsym() method.
####Variables
- const char funcName*
- the name of the function
- void funcAddr*
- the address to the address, used as the return value for a dlsym() call
###struct dynLib A structure for representing a library that is to be dynamically linked with using the dlopen() method.
####Variables
- const char libName*
- the name of the library
- void libAddr*
- an address used for the return value of dlopen()
- int versionNumber
- a value representing the latest version (found in research) of a given library, usually tied to a constant defined in the Ellen header file
- int funcCount
- a value representing the number of functions that will need to be dynamically loaded via dlsym(), usually tied to a constant defined in the Ellen header file
- libFunc functions*
- _a pointer to an array of type libFunc to hold all of the functions loaded dynamically via dlsym(), usually filled in at the top of the Ellen source file
- bool opened
- a boolean value denoting if the library associated with this dynLib struct was successfully opened
###enum libraries An enum for representing all of the libraries to be dynamically linked with using the dlopen() method.
####Values
- libsdl
- libusb
- libCount
###enum usbFunctions An enum for representing the value of every function to be dynamically loaded from libusb for fast by-name lookup in the allLibs table in ellen.cpp
####Values
- libusb_init_e
- libusb_get_device_list_e
- libusb_get_device_descriptor_e
- libusb_get_active_config_descriptor_e
- libsub_free_device_list_e
- libusb_exit_e
- libusb_get_bus_number_e
- libusbCount
###enum sdlFunctions An enum for representing the value of every function to be dynamically loaded from libsdl for fast by-name lookup in the allLibs tables in ellen.cpp
####Values
- SDL_NumJoysticks_e
- SDL_IsGameController_e
- SDL_JoystickOpen_e
- SDL_GameControllerOpen_e
- SDL_GameControllerName_e
- SDL_JoystickInstanceID_e
- SDL_GameControllerGetAxis_e
- SDL_PollEvent_e
- SDL_GameControllerNameForIndex_e
- SDL_JoystickNameForIndex_e
- SDL_JoystickGetAxis_e
- SDL_SetHint_e
- SDL_CreateWindow_e
- SDL_Init_e
- SDL_JoystickName_e
- SDL_GL_SetAttribute_e
- SDL_GetNumVideoDisplays_e
- SDL_GetDisplayName_e
- SDL_GetDisplayBounds_e
- SDL_GetCurrentDisplayMode_e
- libsdlCount
##Cylon.h
- struct cylonStruct
- Time
- Date
- Time Zone
- Processor
- Memory
- Account Picture
- Device Information
- Error
- struct deviceStruct
- Type
- Location
- Names
- Usability
- struct displayStruct
- Resolution
- Parent
- Rotation
- 3D
- struct controllerStruct
- Parent
- Player
- Buttons
- struct mouseStruct
- Parent
- Properties
- struct storageStruct
- struct sensorStruct
###Constants
- static const int SUNDAY
- static const int MONDAY
- static const int TUESDAY
- static const int WEDNESDAY
- static const int THURSDAY
- static const int FRIDAY
- static const int SATURDAY
- values representing days of the week
- static const int JANUARY
- static const int FEBRUARY
- static const int MARCH
- static const int APRIL
- static const int MAY
- static const int JUNE
- static const int JULY
- static const int AUGUST
- static const int SEPTEMBER
- static const int OCTOBER
- static const int NOVEMBER
- static const int DECEMBER
- Values representing months of the year
- static const int STANDARD_TIME
- static const int DAYLIGHT_TIME
- Values representing if the user in daylight savings
- static const int A_BUTTON
- static const int B_BUTTON
- static const int X_BUTTON
- static const int Y_BUTTON
- static const int UP_DPAD
- static const int DOWN_DPAD
- static const int LEFT_DPAD
- static const int RIGHT_DPAD
- static const int START_BUTTON
- static const int SELECT_BUTTON
- static const int LEFT_THUMB
- static const int RIGHT_THUMB
- static const int LEFT_SHOULDER
- static const int RIGHT_SHOULDER
- static const int HOME_BUTTON
- Values for specific buttons in controllerStruct "buttons" fields
- static const int ERROR_TYPE
- static const int GENERIC_TYPE
- static const int AUDIO_CAPTURE_TYPE
- static const int AUDIO_RENDER_TYPE
- static const int STORAGE_TYPE
- static const int VIDEO_CAPTURE_TYPE
- static const int IMAGE_SCANNER_TYPE
- static const int LOCATION_AWARE_TYPE
- static const int DISPLAY_TYPE
- static const int MOUSE_TYPE
- static const int KEYBOARD_TYPE
- static const int CONTROLLER_TYPE
- static const int TOUCHSCREEN_TYPE
- static const int TOUCH_PAD_TYPE
- static const int TRACKBALL_TYPE
- static const int STYLUS_TYPE
- static const int POSITION_TYPE
- static const int HID_TYPE
- static const int RUMBLE_TYPE
- static const int SENSOR_TYPE
- static const int BLUETOOTH_RADIO_TYPE
- static const int PHYSICAL_TYPE
- static const int PRINTER_TYPE
- static const int HUB_TYPE
- static const int COMMUNICATIONS_DATA_TYPE
- static const int SMART_CARD_TYPE
- static const int CONTENT_SECURITY_TYPE
- static const int PERSONAL_HEALTHCARE_TYPE
- static const int BILLBOARD_TYPE
- static const int WIRELESS_PHONE_TYPE
- Types of devices for categorizing a deviceStruct
- static const int UNKNOWN_PANEL_LOCATION
- static const int FRONT_PANEL
- static const int BACK_PANEL
- static const int TOP_PANEL
- static const int BOTTOM_PANEL
- static const int LEFT_PANEL
- static const int RIGHT_PANEL
- Locations for integrated deviceStructs in the system, where applicable
- static const int NO_ROTATION
- static const int LANDSCAPE
- static const int PORTRAIT
- static const int FLIPPED_LANDSCAPE
- static const int FLIPPED_PORTRAIT
- Orientations for deviceStructs and displayStructs that can be rotated
- static const int CONTROLLERS_LIST_ID_SYNCH_ERROR
- Notes when ellen code fails to correctly synchronize data between a cylonStruct's controllers and detectedDevices lists
- static const int INVALID_CONTROLLER_ID
- Notes when ellen code fails to correctly get the ID of a controller device
###struct cylonStruct cylonStruct acts as a container for holding user profile information, system settings, and hardware specifications, and should be compatible with Ellen, as well as any other libraries as part of the Final Five project.
####Variables ####Time
- uint32_t milliseconds
- current milliseconds for local time
- uint32_t seconds
- current seconds for local time
- uint32_t minutes
- current minutes for local time
- uint32_t hours
- current hours for local time, represented in 24 hour clock format
####Date
- uint32_t day
-
day of the week, supported values are:
- 1 = Sunday
- 2 = Monday
- 3 = Tuesday
- 4 = Wednesday
- 5 = Thursday
- 6 = Friday
- 7 = Saturday
- 0 = error/invalid/missing
- uint32_t date
- today's date, 1-31
- uint32_t month
- _the current month, supported values are:
- 0 = invalid/error/missing
- 1 = January
- 2 = February
- 3 = March
- 4 = April
- 5 = May
- 6 = June
- 7 = July
- 8 = August
- 9 = September
- 10 = October
- 11 = November
- 12 = December
- uint32_t year
- the current year, valid responses are 1601 up until the cows come home
####Time Zone
- uint32_t dst
-
denotes if time is current in DST mode, supported values are:
- 0 = standard time
- 1 = daylight time
- otherwise = invalid
- int32 timeZone
- time zone bias expressed in minutes +/- UTC
- std::string timeZoneName
- standard abbreviation for time zone (EST, MST, etc.)
####Processor
- std::string architecture
- architecture of the processor
- uint16_t processorLevel
- version of the processor
- uint32_t pageSize
- page size utilized by processor, measured in bytes
- uint32_t processorCount
- number of processors detected on the current machine
- uint32_t allocationGranularity
- granularity for starting address where virtual memory can be allocated
- uintptr_t minAppAddress
- lowest address in memory that an application can access, currently unused
- uintptr_t maxAppAaddress
- highest address in memory that an application can access, currently unused
- float hertz
- minimum supported value for processor speed measured in hertz
####Memory
- uint64_t memoryBytes
- the installed RAM measured in bytes
- uint32_t osArchitecture
-
operating system bit-level architecture, current supported values include:
- 0 = error/invalid/missing
- 16 = 16-bit OS
- 32 = 32-bit OS
- 64 = 64-bit OS
- uint64_t threshold
- the amount of RAM in bytes that signifies the device is running low on memory
- uint64_t bytesAvails
- the amount of RAM free in bytes
- int lowMemory
- a value of 1 denotes that the device is running low on memory, otherwise the value is set to 0
####Account Picture
- uintptr_t pictureLocation
- address value of pointer to a container for the presently logged-in user's account picture, currently unused
- std::string pictureType
- gives the file extension of the picture variable, used for debugging purposes
- std::string picturePath
- the file system path where the picture is stored
####Device Information
- uint32_t installedDeviceCount
- total number of installed devices detected, currently unused
- uint32_t detectedDeviceCount
- total number of currently detected devices, currently unused
- uint32_t portableStorageCount
- total number of currently attached portable storage devices, currently unused
- uint32_t videoCount
- total number of currently attached video capture devices, currently unused
- uint32_t micCount
- total number of currently attached audio capture devices, currently unused
- uint32_t speakerCount
- total number of currently attached audio rendering devices, currently unused
- uint32_t locationCount
- total number of currently attached location aware devices, currently unused
- uint32_t scannerCount
- total number of currently attached image scanning devices, currently unused
- std::list detectedDevices
- doubly linked list filled with nodes of type deviceStruct, for holding all detected devices' metadata, currently unused
- std::list displayDevices
- doubly linked list filled with nodes of type displayStruct, for holding all detected displays' metadata, currently unused
- std::list controllers
- doubly linked list filled with nodes of type controllerStruct, for holding all detected controller's metadata, currently unused
- std::list storages
- doubly linked list filled with nodes of type storageStruct, for holding all detected storage device's metadata, currently unused
- std::list storages
- doubly linked list filled with nodes of type sensorStruct, for holding all detected sensor's metadata, currently unused
- struct mouseStruct mice
- holds pooled metadata for all detected mice in a singular container, currently unused
####Error
- int32 error
- mask for holding raised error bits
###struct deviceStruct deviceStruct acts as a container for holding specific information for a detected device in a singular location.
####Variables ####Type
- uint32_t deviceType
- denotes the type of device described in the deviceStruct. Additionally used for polymorphic structs for more specific deviceTypes that "inherit" from deviceStruct.
- uint32_t displayIndex
- denotes the index of this deviceStruct's corresponding displayStruct IFF its type is equal to DISPLAY_TYPE, otherwise the value is defaulted to zero
- uint32_t controllerIndex
- denotes the index of this deviceStruct's corresponding controllerStruct IFF its type is equal to CONTROLLER_TYPE, otherwise the value is defaulted to zero
- uint32_t sensorsIndex
- denotes the index of this struct's corresponding sensorStruct IFF its type is equal to SENSOR_TYPE, otherwise the value is defaulted to zero
- uint32_t storageIndex
- denotes the index of this struct's corresponding storageStruct IFF its type is equal to STORAGE_TYPE, otherwise the value is defaulted to zero
####Location
- uint32_t orientation
- rotation of device, where applicable
- uint32_t panelLocation
-
for built in devices, such as laptop webcams, this value denotes the location of the device on the computer, supported values are:
- 0 = error/invalid/unknown
- 1 = front
- 2 = back
- 3 = top
- 4 = bottom
- 5 = left
- 6 = right
- uint32_t inLid
- true if device is located in the lid of the computer, false otherwise
- uint32_t inDock
- true if device is located in the dock of the computer, false otherwise
####Usability
- uint32_t isEnabled
- true if the device is presently enabled, false otherwise
- uint32_t isDefault
- true if the device is the default option for its device type, false otherwise
####ID's
- std::string wName
- name of the device, a string of "0" denotes a device with no valid name found
- std::string id_string
- unique ID of the device, a string of "0" denotes a device with no valid ID found_
- int id_int
- unique ID number of the device, a value of 0 denotes a device without a unique ID in this field
- uint32_t vendorID
- denotes the vendor ID of the device, when available
- uint32_t usb_bus
- denotes the usb bus number of the device, when available
- uint32_t udev_deviceNumber
- denotes the udev device number value for a device, when available
###struct displayStruct displayStruct holds additional information for a display device not normally found in a deviceStruct, but contains a pointer to a deviceStruct so that its location may be used for the list of deviceStructs found in cylonStruct.
####Variables ####Parent
- struct deviceStruct superDevice
- The displayStruct's parent deviceStruct container
####Rotation
- uint32_t rotationPreference
-
the preferred rotation of the current app, supported values are:
- 0 = none
- 1 = landscape
- 2 = portrait
- 4 = flipped landscape
- 8 = flipped portrait
- uint32_t currentRotation
-
the current rotation of the primary monitor, supported values are:
- 0 = none
- 1 = landscape
- 2 = portrait
- 4 = flipped landscape
- 8 = flipped portrait
- uint32_t nativeRotation
-
the native rotation of the primary monitor, supported values are:
- 0 = none
- 1 = landscape
- 2 = portrait
- 4 = flipped landscape
- 8 = flipped portrait
####Resolution
- float resolutionScale
- the current scale of the resolution in reference to the size of the primary monitor, as decimal multiplier (100% = 1.0, etc.)
- float logicalDPI
- the logical dots per inch of the primary monitor
- float rawDPIX
- the raw dots per inch across the width of the primary monitor
- float rawDPIY
- the raw dots per inch across the height of the primary monitor* float logicalDPI
- the logical dots per inch of the primary monitor
- uint32_t horizontalResolution
- the number of pixels wide the display's resolution is
- uint32_t verticalResolution
- the number of pixels high the display's resolution is
- float refreshRate
- the refresh rate in hertz for the display device
####Driver
- void driverData*
- a pointer to drive specific data for the display, when available
####3D
- uint32_t isStereoscopicEnabled
- true of stereoscopic 3D is enabled on the primary monitor, false otherwise
###struct controllerStruct controllerStruct acts as a container for holding specific information for a detected controller in a singular location.
####Variables ####Parent
- struct deviceStruct superDevice
- The corresponding deviceStruct for this controllerStruct
####Player
- uint32_t userIndex
- The player number of the controller, starting from 0 (typically 0-3 for a 4 player game, so player 1 in a given match is userIndex 0)
- uint32_t id
- Instance id number of the controller, if applicable (may be the same as userIndex on select platforms)
####Buttons
- uint32_t packetNumber
- Used to track if changes to the controller have occurred between requests
- uint32_t buttons
- Bit mask based on Windows documentation that defines which buttons are currently being pressed
- float leftTrigger
- Value between 0 & 1.0 representing how far the left trigger is depressed
- float rightTrigger
- Value between 0 & 1.0 representing how far the right trigger is depressed
- float thumbLeftX
- Left thumbstick x-axis value between -1 and 1, a value of 0 is centered, negative values signify left, positive values signify right
- float thumbRightX
- Right thumbstick x-axis value between -1 and 1, a value of 0 is centered, negative values signify left, positive values signify right
- float thumbLeftY
- Left thumbstick y-axis value between -1 and 1, a value of 0 is centered, negative values signify down, positive values signify up
- float thumbRightY
- Right thumbstick y-axis value between -1 and 1, a value of 0 is centered, negative values signify down, positive values signify up
###struct mouseStruct mouseStruct stores a pooled set of data on the capabilities of all attached/detected mice, it is unused for the Ellen portion of the Final Five Project.
####Variables ####Parent
- struct deviceStruct superDevice
- The corresponding "parent" deviceStruct for the mouseStruct
####Properties
- uint32_t anyRightLeftSwapped
- True if any of the attached mice have their left/right click buttons swapped, false otherwise
- uint32_t anyVerticalWheelPresent
- True if any of the attached mice have a vertical wheel, false otherwise
- uint32_t anyHorizontalWheelPresent
- True if any of the attached mice have a horizontal wheel, false otherwise
- uint32_t maxNumberOfButtons
- The number of buttons found on the detected/attached mouse with the most buttons
###struct storageStruct storageStruct stores data specific to certain devices that are used for storage capabilities.
####Variables ####Parent
- struct deviceStruct superDevice
- The corresponding "parent" device for the storageStruct
####Properties
- std::string path
- The path in the OS file system to the storage drive location. Used as the unique lookup for the deviceStruct paired with this storageStruct
- uint64_t bytesAvails
- The space free in the storage drive measured in bytes
- uint64_t totalBytes
- The total size in bytes of the storage drive
- uint32_t isEmulated
- If the storage drive is emulated, 0 for no/unknown, 1 for yes
###struct sensorStruct
####Variables ####Parent
- struct deviceStruct superDevice
- The corresponding "parent" device for the sensorStruct
####Properties
- uint32_t minDelay
- The minimum delay allowed between two events, measured in microseconds. This value may also be 0 if the sensor only returns new data when actively observing a change in its readings.
- uint32_t type
- The specific type of sensor this object holds data for, based on the Android mapping found here.
- uint32_t version
- The release number of the given sensor.
- std::string vendor
- The name of the vendor for the given sensor.
- std::string name
- The name of the given sensor.
- float power
- The power drawn by the sensor, measured in mA
- float resolution
- The resolution the scanner uses for scans
- uint32_t fifoMaxEventCount
- The max number of events the sensor can have batched, a value of 0 indicates batch mode is not supported, this value is not guaranteed as other sensors may share the same batch space at run time
- uint32_t fifoReservedEventCount
- Guaranteed minimum number of FIFO events for the sensor that can be batch
- std::string stringType
- A string representation of the sensor's type
- uint32_t maxDelay
- _The delay between two sensor events measured in microseconds for the lowest frequency the given sensor cna operate with. Used only for continuous and on-change sensors, and invalid when less than 1.
- uint32_t reportingMode
- The reporting mode for the given sensor, based on the Android mapping found here
- uint32_t isWakeUpSensor
- Denotes if the given sensor is a wake up sensor, 1 for yes, 0 for no/unknown