Wince display driver

Source: Internet
Author: User

Volume loading and management, similar to GWES loading and management, there are also keyboard and mouse, touch screen, printer and other drivers, these are called local drivers (built-in drivers ). therefore, DDI is not a common device driver ). more specifically, it is not accessed through the file system API interfaces such as createfile. instead, we can use the GDI interface to familiarize ourselves with Win32 Application Programming and remember that GDI is createdc, releasedc, and so on. h.

Generally, the display driver is implemented hierarchically. The MDD layer generally uses the GPE module provided by Microsoft. to support rotation, use gperotate. To support ddraw, use the ddgpe module. in fact, for wince5, gperotate has already been merged into Gpe, and typedef GPE gperotate. ddgpe is also a class inherited from GPE. in some drivers, ddraw and rotate cannot be used at the same time .)

TIPS: What is GPE? A simple graphics engine. first, this is a class. Second, from the display driver layer, GPE can be used as the upper-layer MDD, which can save work because it processes interfaces with the upper-layer, some graphical functions are simulated in software mode.

Upper-layer GDI Interface

A total of 20 functions are provided to GWES. GWES interacts with the display driver through the following DDI and provides the GDI interface.

Drvanyblt supports extended or transparent bit transfer (bit block transfers)
Drvbitblt provides common bit transfer with cut and shield
Drvconstrostcontrol allows software and hardware control adjustment
Drvcopybits sends the print segment of the GDI design to the print driver
Design and manage bitmap for drvcreatedevicebitmap
Drvdeletedevicebitmap Delete design bitmap
Drvdisabledriver notifies the driver that GDI no longer needs it and is ready to uninstall it.
Drvdisablepdev notification driver GDI no longer requires special printing or display devices
Drvdisablesurface notifies the driver that GDI no longer requires a special surface drawing.
The drvenabledriver outputs an initial record by the driver and returns a pointer to the DDI function of GDI.
Drvenablepdev returns a pdev for GDI, which is a logical representation of a physical display device.
Drvenablesurface design a drawing interface and connect it to pdev
Drvenddoc sends any required printed file control information
Drvfillpath fill the path with a brush
Drvgetmasks shows the current display device mode for color shielding.
Display modes supported by drvgetmodes
Drvmovepointer moves the pointer to ensure that GDI does not interfere
Drvpaint paint a specific area with a brush
Drvpowerhandler call handling, power-on, power-down notifications
// Drvaweryfont to obtain the font metric Information
Create a drvrealizebrush with the parameters specified by GDI.
Drvrealizecolor maps an RGB color to the colors that are most likely to be available by devices
Drvsetpalette settings display device color palette
Drvsetpointershape: set a new shape for the cursor and update the display.
Drvstaredoc sends arbitrary start print file information
Drvstartpage sends any new page information
Drvstrokepath deletion path
Drvtransparentblt Transparent Bit Transfer
Drvunrealizecolor: The color of the device is displayed in RGB format.

However, in fact, the above interfaces are not directly disclosed to GWES by the display driver. The display driver only discloses one interface, drvenabledriver (). To export other interfaces, follow these steps.

Bool
Apientry
Gpeenabledriver (
Ulong iengineversion,
Ulong CJ,
Drvenabledata * pded,
Pengcallbacks)

 

Bool apientry drvenabledriver (
Ulong iengineversion,
Ulong CJ,
Drvenabledata * pded,
Pengcallbacks)
{
Return gpeenabledriver (iengineversion, CJ, pded, pengcallbacks );
}

GWES calls drvenabledriver (), while the drvenabledriver () function calls the above gpeenabledriver function. The third parameter is the function pointer of other returned interfaces. the global function pointer array defined in ddi_if.c is as follows:

Const drvenabledata pdrvfn = {
{Drvenablepdev },
{Drvdisablepdev },

Omitted

{Null/* drvenddoc */},
{Null/* drvstartdoc */},
{Null/* drvstartpage */},
{Drvescape}
};

In this way, the upper layer obtains the lower-layer function pointer pded. the pointer of all interface functions is obtained. in addition, the 4th parameter pengcallbacks is a pointer entry to the callback function provided by the upper layer to the lower layer. is provided by the system to the display driver for calling. it includes the following:

(Brvshobj indicates a brush for deleting and filling with solid wires or grids .)

Brvshobj_pvallocrbrush allocates memory for the brush

Brushobj_pvgetrbrush returns pointer for specific brush

(Clipobj indicates the structure of the cut area)

Clipobj-benum: list the functions used to cut a rectangle from the cut area.

Clipobj-cenumstart is used to list cut rectangles in the cut area.

Engcreatedericebitmap enables GDI to process device bitmap

Engcreatedevicebitmap requests GDI to create a bitmap and return a handle.

Engcreatedevicesurface creates a display driver management device interface through GDI

Engcreatepalette requests GDI to create a palette.

Engdeletesurface notifies the GDI display driver that the device interface is no longer required

Palobj-cgetcolors copy the color to the color palette

(Pathdat stores the structure of partially drawn paths)

Pathobj-beenum: List pathdata records in the drawing path

Pathobj-venumstart A plotting path to list its linear part

Pathobj-vgetbounds returns the restricted rectangle of the painting path.

(Xlateobj is used to transfer colors between the color palette)

Xlateobj-cgetpalette returns the color from the specified color palette.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.