Solutions Registry Payload Examples

From wiki.gpii
Jump to: navigation, search

Request

    GET /solutions

Response

[{
    "name": "GNOME Shell Magnifier",
    "id": "org.gnome.desktop.a11y.magnifier",
    "version": "3.2.1", //semver compatible: https://github.com/isaacs/node-semver
    "contexts": {
    	"platforms": [ {
    	    "id": "org.gnome",
    	    "version": ">=3.0" //semver compatible: https://github.com/isaacs/node-semver
    	    }
    	]
    },

    "settingsHandlers": [{
        "type": "gpii.settings.gsettingsHandler",
        "settingsTransformationMap": {
            "mag-factor": "display.screenEnhancement.magnification",
            "mouse-tracking": {
                 "expander": {
                     "type": "gpii.transform.valueMapper",
                     "inputPath": "display.screenEnhancement.tracking",
                     "options": {
                        "valueMap": {
                             "mouse": "centered"
                        }
                     }
                 }
            }
        }
    }],
    "lifecycleManager": {
        "start": [ 
            "setSettings", {
                "type": "gpii.launch.spawn",
                "command": "gsettings set org.gnome.desktop.a11y.applications screen-magnifier-enabled true"
            }
        ],
        "stop": [ {
                "type": "gpii.launch.spawn",
                "command": "gsettings set org.gnome.desktop.a11y.applications screen-magnifier-enabled false"
                },
            "restoreSettings"
            ]
        }                
    }
},
{
    "name": "Screen Magnifier",
    "id": "com.microsoft.windows.magnifier",
    "version": "7", //semver compatible: https://github.com/isaacs/node-semver
    "contexts": {
    	"platforms": [ {
    	    "id": "com.microsoft.windows",
    	    "version": ">=7.0" //semver compatible: https://github.com/isaacs/node-semver
    	    }
    	]
    },

    "settingsHandlers": [{
        "type": "gpii.settings.windowsRegistryHandler",
        "options": {
            "hKey": "HKEY_CURRENT_USER",
            "path": "Software\Microsoft\ScreenMagnifier"
        },
        "capabilities": {
            "Magnification": {
                "inputPath": "display.screenEnhancement.magnification"
                "type": "gpii.transform.scaleValue",
                "option": {
                     "scaleFactor": 100
                }
            },
            "Invert": {
                path: "display.screenEnhancement.invertColourChoice",
                dataType: "DWORD"
            },
            "expander": {
                "type": "gpii.transform.demultiplexValue",
                "inputPath": "screenEnhancement.tracking",
                "options": {
                    "mouse": {
                        "outputPath": "FollowMouse",
                        "value": true
                    },
                    "focus": {
                        "outputPath": "FollowFocus",
                        "value": true
                     },
                    "caret": {
                        "outputPath": "FollowCaret",
                        "value": true
                    }
                }
            ]
        }
        }
    }],

    "lifecycleManager": {
        "start": [ 
            "setSettings", {
                "type": "gpii.launch.exec",
				// Note: this path is actually held at 
				//HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Accessibility\ATs\magnifierpane|StartExe 
				// but the following path is easier to express for now and probably at least as stable
                "command": "${{environment}.SystemRoot}\System32\Magnify.exe"
                }
            ],
        "stop": [ {
                "type": "gpii.launch.spawn",
                "command": "taskkill.exe /im Magnify.exe"
                },
            "restoreSettings"
            ]
        }           
    }]
}]

or:

    "lifecycleManager": {
        "start": ["setSettings", {
            "type": "gpii.gsettings.set",
            "settings": [ {
                "schema": "org.gnome.desktop.a11y.applications",
                "key": "screen-magnifier-enabled",
                "value": true
                }
            ]
        }],
        "stop": [{
           "type": "gpii.gsettings.set",
           "settings": [ {
              "schema": "org.gnome.desktop.a11y.applications",
              "key": "screen-magnifier-enabled",
              "value": false
            }]
        }, "restoreSettings"]
    }