NAME
EZ_LCD.cpp
COPYRIGHT
The Logitech EZ LCD SDK Wrapper, including all accompanying documentation, is protected by intellectual property laws. All rights not expressly granted by Logitech are reserved.
PURPOSE
The EZ LCD SDK Wrapper is aimed at developers wanting to make use of the LCD display on Logitech G-series keyboard. It comes with a very intuitive and easy to use interface which enables one to easily display static strings, scrolling strings, progress bars, and icons. See the following to get started: - readme.txt: Describes how to get started - Use one of the samples included to see how things work.
AUTHOR
Christophe Juncker (christophe_juncker@logitech.com)
CREATION DATE
06/13/2005
MODIFICATION HISTORY
03/01/2006 - Vahid Afshar. Added the concept of pages to the API. A client can now have multiple pages, each with its own controls. A page can be shown, while another is modified. - Introduced the InitYourself() method.
NAME
CEzLcd::CEzLcd() -- Basic constructor. The user must call the InitYourself(...) method after calling this constructor.
FUNCTION
Object is created.
INPUTS
NAME
CEzLcd::CEzLcd(LPCTSTR pFriendlyName, INT iWidth, INT iHeight).
FUNCTION
Does necessary initialization. If you are calling this constructor, then you should NOT call the InitYourself(...) method.
INPUTS
pFriendlyName - friendly name of the applet/game. This name will be displayed in the Logitech G-series LCD Manager. iWidth - width in pixels of the LCD. iHeight - height in pixels of the LCD.
NAME
HRESULT CEzLcd::InitYourself(pFriendlyName, BOOL IsAutoStartable, BOOL IsPersistent, lgLcdOnConfigureCB callbackFunction ,width , height)
FUNCTION
Does necessary initialization. This method SHOULD ONLY be called if the empty constructor is used: CEzLcd::CEzLcd()
INPUTS
pFriendlyName - friendly name of the applet/game. This name will be displayed in the Logitech G-series LCD Manager. IsAutoStartable - Determines if the applet is to be started automatically every time by the LCD manager software (Part of G15 software package) IsPersistent - Determines if the applet's friendlyName will remain in the list of applets seen by the LCD manager software after the applet terminates pConfigContext - Pointer to the lgLcdConfigContext structure used during callback into the applet width - width in pixels of the LCD. height - height in pixels of the LCD.
RETURN VALUE
The method returns the S_OK if it can connect to the LCD Manager library, or returns E_FAIL if it can not.
NAME
INT CEzLcd::AddNewPage(VOID) -- Call this method to create a new page to be displayed on the LCD. The method returns the current number of pages, after the page is added.
INPUTS
NONE
RETURN VALUE
The method returns the current number of pages, after the page is added.
NAME
INT CEzLcd::RemovePage(INT iPageNumber) -- Call this method to remove a page from the pages you've created to be displayed on the LCD. The method returns the current number of pages, after the page is deleted.
INPUTS
iPageNumber - The number for the page that is to be removed.
RETURN VALUE
The method returns the current number of pages, after the page is removed.
NAME
INT CEzLcd::GetPageCount(VOID) returns the current number of pages.
INPUTS
None.
RETURN VALUE
The method returns the current number of pages.
NAME
INT CEzLcd::AddNumberOfPages(INT iNumberOfPages) - Adds iNumberOfPages to the total of pages you've created.
INPUTS
iNumberOfPages - Count of pages to add in.
RETURN VALUE
The method returns the current number of pages, after the pages are added.
NAME
INT CEzLcd::ModifyControlsOnPage(INT iPageNumber) - Call this method in order to modify the controls on page. This method must be called first prior to any modifications on that page.
INPUTS
iPageNumber - The page number that the controls will be modified on.
RETURN VALUE
TRUE - If succeeded. FALSE - If encountered an error.
NAME
INT CEzLcd::ShowPage(INT iPageNumber) Call this method in order to make the page shown on the LCD,
INPUTS
iPageNumber - The page that will be shown among your pages on the LCD.
RETURN VALUE
TRUE - If succeeded. FALSE - If encountered an error.
NAME
HANDLE CEzLcd::AddText(LGObjectType type, LGTextSize size, INT iAlignment, INT iMaxLengthPixels) -- Add a text object to the page you are working on.
INPUTS
type - specifies whether the text is static or scrolling. Possible types are: LG_SCROLLING_TEXT, LG_STATIC_TEXT size - size of the text. Choose between these three: LG_SMALL, LG_MEDIUM or LG_BIG. iAlignment - alignment of the text. Values are: DT_LEFT, DT_CENTER, DT_RIGHT. iMaxLengthPixels - max length in pixels of the text. If the text is longer and of type LG_STATIC_TEXT, it will be cut off. If the text is longer and of type LG_SCROLLING_TEXT, it will scroll.
RETURN VALUE
Handle for this object.
SEE ALSO
CEzLcd::AddIcon CEzLcd::AddProgressBar
NAME
HANDLE CEzLcd::AddText(LGObjectType type, LGTextSize size, INT iAlignment, INT iMaxLengthPixels, INT iNumberOfLines) -- Add a text object to the page you are working on.
INPUTS
type - specifies whether the text is static or scrolling. Possible types are: LG_SCROLLING_TEXT, LG_STATIC_TEXT size - size of the text. Choose between these three: LG_SMALL, LG_MEDIUM or LG_BIG. iAlignment - alignment of the text. Values are: DT_LEFT, DT_CENTER, DT_RIGHT. iMaxLengthPixels - max length in pixels of the text. If the text is longer and of type LG_STATIC_TEXT, it will be cut off. If the text is longer and of type LG_SCROLLING_TEXT, it will scroll. iNumberOfLines - number of lines the text can use. For static text only. If number bigger than 1 and statoc text is too long to fit on LCD, the text will be displayed on multiple lines as necessary.
RETURN VALUE
Handle for this object.
SEE ALSO
CEzLcd::AddIcon CEzLcd::AddProgressBar
NAME
HRESULT CEzLcd::SetText -- Sets the text in the control on the page that you are working on.
INPUTS
hHandle - handle to the object. pText - text string.
RETURN VALUE
E_FAIL if there was an error. S_OK if no error.
NAME
HANDLE CEzLcd::AddIcon -- Add an icon object to the page that you are working on.
INPUTS
hIcon - icon to be displayed on the page. Should be 1 bpp bitmap. iSizeX - x-axis size of the bitmap. iSizeY - y-axis size of the bitmap.
RETURN VALUE
Handle for this object.
SEE ALSO
CEzLcd::AddText CEzLcd::AddProgressBar
NAME
HANDLE CEzLcd::AddProgressBar -- Add a progress bar object to the page that you are working on.
INPUTS
type - type of the progress bar. Types are: LG_CURSOR, LG_FILLED, LG_DOT_CURSOR.
RETURN VALUE
Handle for this object.
SEE ALSO
CEzLcd::AddText CEzLcd::AddIcon
NAME
HRESULT CEzLcd::SetProgressBarPosition -- Set position of the progress bar's cursor.
INPUTS
hHandle - handle to the object. fPercentage - percentage of progress (0 to 100).
RETURN VALUE
E_FAIL if there was an error or if handle does not correspond to a progress bar. S_OK if no error.
NAME
HRESULT CEzLcd::SetProgressBarSize -- Set size of progress bar.
INPUTS
hHandle - handle to the object. iWidth - x-axis part of the size iHeight - y-axis part of the size (a good default value is 5).
RETURN VALUE
E_FAIL if there was an error or if handle does not correspond to a progress bar. S_OK if no error.
NAME
HANDLE CEzLcd::AddBitmap() -- Add a bitmap object to the page that you are working on.
NOTES
A bitmap's size currently must always be 160x43 pixels.
RETURN VALUE
Handle for this object.
SEE ALSO
CEzLcd::AddText CEzLcd::AddIcon
NAME
HRESULT CEzLcd::SetBitmap(HANDLE hHandle, HBITMAP hBitmap) -- Set the bitmap.
INPUTS
hHandle - handle to the object. hBitmap - 1bpp bitmap.
RETURN VALUE
E_FAIL if there was an error or if handle does not correspond to a bitmap. S_OK if no error.
NAME
HRESULT CEzLcd::SetOrigin -- Set the origin of an object. The origin corresponds to the furthest pixel on the upper left corner of an object.
INPUTS
hHandle - handle to the object. iXOrigin - x-axis part of the origin. iYOrigin - y-axis part of the origin.
RETURN VALUE
E_FAIL if there was an error. S_OK if no error.
NAME
HRESULT CEzLcd::SetVisible -- set corresponding object to be visible or invisible on the page that you are working on.
INPUTS
hHandle - handle to the object. bVisible - set to FALSE to make object invisible, TRUE to make it visible (default).
RETURN VALUE
E_FAIL if there was an error. S_OK if no error.
NAME
BOOL CEzLcd::ButtonTriggered -- Check if a button was triggered.
INPUTS
iButton - name of the button to be checked. Possible names are: LG_BUTTON_1, LG_BUTTON_2, LG_BUTTON_3, LG_BUTTON_4
RETURN VALUE
TRUE if the specific button was triggered FALSE otherwise
SEE ALSO
CEzLcd::ButtonReleased CEzLcd::ButtonIsPressed
NAME
BOOL CEzLcd::ButtonReleased -- Check if a button was released.
INPUTS
iButton - name of the button to be checked. Possible names are: LG_BUTTON_1, LG_BUTTON_2, LG_BUTTON_3, LG_BUTTON_4
RETURN VALUE
TRUE if the specific button was released FALSE otherwise
SEE ALSO
CEzLcd::ButtonTriggered CEzLcd::ButtonIsPressed
NAME
BOOL CEzLcd::ButtonIsPressed -- Check if a button is being pressed.
INPUTS
iButton - name of the button to be checked. Possible names are: LG_BUTTON_1, LG_BUTTON_2, LG_BUTTON_3, LG_BUTTON_4
RETURN VALUE
TRUE if the specific button is being pressed FALSE otherwise
SEE ALSO
CEzLcd::ButtonTriggered CEzLcd::ButtonReleased
NAME
BOOL CEzLcd::IsConnected -- Check if a Logitech G-series LCD is connected.
RETURN VALUE
TRUE if an LCD is connected FALSE otherwise
NAME
HRESULT CEzLcd::SetAsForeground(BOOL bSetAsForeground) -- Become foreground applet on LCD, or remove yourself as foreground applet.
INPUTS
bSetAsForeground - Determines whether to be foreground or not. Possible values are: - TRUE implies foreground - FALSE implies no longer foreground
RETURN VALUE
E_FAIL if there was an error. S_OK if no error.
NAME
HRESULT CEzLcd::SetScreenPriority(DWORD priority) -- Set screen priority.
INPUTS
dwPriority - priority of the screen. Possible values are: - LGLCD_PRIORITY_IDLE_NO_SHOW - LGLCD_PRIORITY_BACKGROUND - LGLCD_PRIORITY_NORMAL - LGLCD_PRIORITY_ALERT. Default is LGLCD_PRIORITY_NORMAL.
RETURN VALUE
E_FAIL if there was an error. S_OK if no error.
NAME
VOID CEzLcd::Update -- Update LCD display
FUNCTION
Updates the display. Must be called every loop.