MediaWiki API result

This is the HTML representation of the JSON format. HTML is good for debugging, but is unsuitable for application use.

Specify the format parameter to change the output format. To see the non-HTML representation of the JSON format, set format=json.

See the complete documentation, or the API help for more information.

{
    "warnings": {
        "query": {
            "*": "Formatting of continuation data has changed. To receive raw query-continue data, use the 'rawcontinue' parameter. To silence this warning, pass an empty string for 'continue' in the initial query."
        }
    },
    "batchcomplete": "",
    "continue": {
        "gapcontinue": "Tabset",
        "continue": "gapcontinue||"
    },
    "query": {
        "pages": {
            "60": {
                "pageid": 60,
                "ns": 0,
                "title": "Remote displays",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "The [[GDISP]] module offers the possibility to connect a remote display.\nIn the following we will use the two terms '''headless''' and '''display''', where headless refers to the embedded target project (your microcontroller) and the display is the device that will act as the remote display.\n\n== Configuration ==\nFrom the application point of view, there's no difference between using a local or a remote display. The headless device will still run the entire logic and also process the GUI. The only difference is the interface (TCP/IP). There are several advantages compared to directly running the GUI on the remote display and simply pass the raw values:\n\n=== Multiple clients ===\nIt's possible to connect from a variety of different devices to the headless device without implementing the logic function and the GUI toolkit for each. For example, you can control your target device from another embedded remote, a tablet and a computer and all the parameters are always the same (as they only exist once).\nHowever, currently you can only have one remote display connected at once. This limitation shall be removed soon.\n\n=== Multiple displays ===\nBy using the [[Multiple displays|multiple displays]] support, you can use both, a local and a remote display without the need to write another line of code.\n\n=== Upgradability ===\nA firmware upgrade of your device will automatically upgrade the GUI on all clients. Therefore you never have to give different client software to your customers along with the firmware upgrade itself. One updated - all interfaces updated.\n\n=== Services ===\nImagine your device is installed somewhere in a factory floor. A technican can now go to the device and just hook up a display module and he'll have the same view as the operator on the remote display. This can simplify the troubleshooting and improvement process a lot.\n\n== Supported IP stacks ==\nThe uGFXnet driver currently supports the following systems:\n* [http://savannah.nongnu.org/projects/lwip/ LwIP]\n* [http://beej.us/guide/bgipc/output/html/multipage/unixsock.html unix sockets]\n* [http://en.wikipedia.org/wiki/Winsock winsock]\nHowever, you can extend the uGFXnet driver to use any IP stack.\n\n== Example ==\nAs stated above, you don't have to change your application code of the headless device. However, you have to initialise the sockets. At startup, the uGFXnet driver will call a function named Start_LWIP(). You have to ensure that LwIP is up and running after this function has been called. \n\nThe part left to do is the code for the remote display. There's a premade example that can be found in ''/tools/uGFXtool''. As this tool uses \u00b5GFX itself, it can be used to act as a remote display running on Windows, Linux and Mac OS-X without any modification. just compile it as you would any \u00b5GFX application (Makefiles can be found in the  [[Getting Started]] article). After a successful build, simply start the executable with the IP of the headless device as a parameter and the GUI will show up. When you disconnect, the current state will be the same once you reconnect again. The default port of the uGFXnet driver is 13001.\n<pre>\n./ugfx 192.168.1.20\n</pre>\n\n== Protocol ==\nHowever, you don't have to use \u00b5GFX on the remote display side. The protocol of the uGFXnet driver is documented and therefore you can build your own application using anything you want.\nThe uGFXnet protocol can be found in ''/drivers/multiple/uGFXnet/uGFXnetProtocol.h''. This is the current protocol:\n<syntaxhighlight lang=c>\n#define GNETCODE_INIT\t\t0xFFFF\t\t// Followed by version,width,height,pixelformat,hasmouse\n#define GNETCODE_FLUSH\t\t0x0000\t\t// No following data\n#define GNETCODE_PIXEL\t\t0x0001\t\t// Followed by x,y,color\n#define GNETCODE_FILL\t\t0x0002\t\t// Followed by x,y,cx,cy,color\n#define GNETCODE_BLIT\t\t0x0003\t\t// Followed by x,y,cx,cy,bits\n#define GNETCODE_READ\t\t0x0004\t\t// Followed by x,y - Response is GNETCODE_READ,color\n#define GNETCODE_SCROLL\t\t0x0005\t\t// Followed by x,y,cx,cy,lines\n#define GNETCODE_CONTROL\t0x0006\t\t// Followed by what,data - Response is GNETCODE_CONTROL,0x0000 (fail) or GNETCODE_CONTROL,0x0001 (success)\n#define GNETCODE_MOUSE_X\t0x0007\t\t// This is only ever received - never sent. Response is GNETCODE_MOUSE_X,x\n#define GNETCODE_MOUSE_Y\t0x0008\t\t// This is only ever received - never sent. Response is GNETCODE_MOUSE_Y,y\n#define GNETCODE_MOUSE_B\t0x0009\t\t// This is only ever received - never sent. Response is GNETCODE_MOUSE_B,buttons.\n#define GNETCODE_KILL\t\t0xFFFE\t\t// This is only ever received - never sent. Response is GNETCODE_KILL,retcode\n</syntaxhighlight>\n\n\n\n[[Category:GDISP]]"
                    }
                ]
            },
            "31": {
                "pageid": 31,
                "ns": 0,
                "title": "Slider",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "A slider is a bar shaped element in which a much smaller bar can be moved from the lowest (0) to the highest (100) value. The text attribute of the slider is displayed in the very center of the slider bar.\n\n== API reference ==\nThe API reference of the slider widget can be found [http://api.ugfx.org/group___slider.html here].\n\n== Custom Draw Routines ==\nThe slider widget predefines a number of custom draw routines. They can be set using <code>gwinSetCustomDraw()</code> or by specifying the custom draw routine in the GWidgetInit structure during creation. The predefined custom draw routines are:\n{| class=\"wikitable\"\n ! scope=\"col\"|Custom Draw Routine\n ! scope=\"col\"|Description\n |-\n |gwinSliderDraw_Std\n | The standard slider look.\n |-\n |gwinSliderDraw_Image\n | The parameter is an open gdispImage that is tiled to fill the active part of the slider.\n |}\n\n== Example ==\nThe following example shows how to create and use a vertical and a horizontal slider:\n<syntaxhighlight lang=c>\n#include \"gfx.h\"\n \nstatic GListener\tgl;\nstatic GHandle\t\tghSlider1, ghSlider2;\n \nstatic void createWidgets(void) {\n\tGWidgetInit\twi;\n \n\t// Apply some default values for GWIN\n\twi.customDraw = 0;\n\twi.customParam = 0;\n\twi.customStyle = 0;\n\twi.g.show = TRUE;\n \n\t// create Slider1\n\twi.g.y = 10; wi.g.x = 10; wi.g.width = 200; wi.g.height = 20; wi.text = \"S1\";\n\tghSlider1 = gwinSliderCreate(NULL, &wi);\n \n\t// create Slider2\n\twi.g.y = 40; wi.g.x = 10; wi.g.width = 20; wi.g.height = 200; wi.text = \"S2\";\n\tghSlider2 = gwinSliderCreate(NULL, &wi);\n}\n \nint main(void) {\n\tGEvent* pe;\n \n\t// Initialize the display\n\tgfxInit();\n \n\t// Set the widget defaults\n\tgwinSetDefaultFont(gdispOpenFont(\"UI2\"));\n\tgwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);\n\tgdispClear(White);\n \n\t// Attach the mouse input\n\tgwinAttachMouse(0);\n \n\t// create the widget\n\tcreateWidgets();\n \n\t// We want to listen for widget events\n\tgeventListenerInit(&gl);\n\tgwinAttachListener(&gl);\n \n\twhile(1) {\n\t\t// Get an Event\n\t\tpe = geventEventWait(&gl, TIME_INFINITE);\n \n\t\tswitch(pe->type) {\n\t\t\tcase GEVENT_GWIN_SLIDER:\n\t\t\t\tprintf(\"Slider %s = %d\\n\", gwinGetText(((GEventGWinSlider *)pe)->slider),\n                                                           ((GEventGWinSlider *)pe)->position\n                                      );\n\t\t\t\tbreak;\n \n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}\n \n\treturn 0;\n}\n</syntaxhighlight>\n\n\n\n[[Category:Widget]]"
                    }
                ]
            }
        }
    }
}