View Single Post
Old 10-04-2016, 08:29 AM   #410
brucelee
Addict
brucelee can program the VCR without an owner's manual.brucelee can program the VCR without an owner's manual.brucelee can program the VCR without an owner's manual.brucelee can program the VCR without an owner's manual.brucelee can program the VCR without an owner's manual.brucelee can program the VCR without an owner's manual.brucelee can program the VCR without an owner's manual.brucelee can program the VCR without an owner's manual.brucelee can program the VCR without an owner's manual.brucelee can program the VCR without an owner's manual.brucelee can program the VCR without an owner's manual.
 
Posts: 352
Karma: 188498
Join Date: Jan 2015
Location: Romania
Device: Kobo Aura One
If I remember correctly this works only for FW5

inkinternal.h (SDK_481)
PHP Code:
/*
* Returns frontlight state (0-100 - brightness, negative value if off)
* returns INT_MIN if can't read or not supported
*/
int GetFrontlightState(void);

/*
* Sets frontlight state (0-100 - brightness, negative value if off)
*/
void SetFrontlightState(int flstate);

/*
* Sets frontlight state (0-100 - brightness, negative value if off)
* temporary for use when about to keylock and this value should not be stored
*/
void SetFrontlightStateEx(int flstateint temporary);

/*
* If supported open special application
*/
void OpenFrontLightConfig();

/*
On/off FrontLight
*/
void SwitchFrontlightState(); 

CR3 implementation
PHP Code:
virtual bool onClientTouch(lvPoint &ptCRGUITouchEventType evType)
{
    
// TOUCH DOWN
    
if( evType == CRTOUCH_DOWN ) {
        
finger1.start.pt.x;
        
finger1.start.pt.y;

        
touchPointing 1;
    }

    
// RELEASE / LONG TAP
    
else if (CRTOUCH_UP == evType || CRTOUCH_DOWN_LONG == evType) {...}

    
// MULTI
    #if defined(POCKETBOOK_PRO) && !defined(POCKETBOOK_PRO_PRO2)
    
else if (CRTOUCH_MULTI_TOUCH == evType && touchPointing && max(pt.x,pt.y) > 2) {...}
    
#endif

    // DRAG
    #ifdef POCKETBOOK_PRO_FW5
    
else if( evType == CRTOUCH_MOVE && touchPointing == ) {

        
// VERTICAL
        
if( abs(finger1.start.x-pt.x) < abs(finger1.start.y-pt.y) ) {
            
int front_light_swipes_mode CRPocketBookDocView::instance->getProps()->getIntDef(PROP_CTRL_FRONT_LIGHT_SWIPES2);

            if( 
front_light_swipes_mode == ) {
                
setFrontLightValue(
                    
/* bottom to top */
                    
100 -
                    
/* value (%) */
                    
(
                        
100 *
                        (
                            
/* touch point (PX) */
                            
pt.-
                            
/* offset (PX) used to center the region */
                            
ScreenHeight() * FRONTLIGHT_SWIPE_USABLE_SCREEN_HEIGHT 2
                        
)
                        /
                        
/* usable screen (PX) */
                        
ScreenHeight() * FRONTLIGHT_SWIPE_USABLE_SCREEN_HEIGHT )
                    )
                    );
                
ignoreNextTouchRelease true;
            }
            else if( 
front_light_swipes_mode == ) {
                
setFrontLightValue(
                    
getFrontLightValue() -
                    
/* value (%) */
                    
(
                        
100 *
                        (
                            
/* step height (PX) */
                            
pt.finger1.start.y
                        
)
                        /
                        
/* usable screen (PX) */
                        
ScreenHeight() * FRONTLIGHT_SWIPE_USABLE_SCREEN_HEIGHT )
                    )
                    );
                
finger1.start.pt.y;
                
ignoreNextTouchRelease true;
            }
            return 
true;
        }

        
// HORIZONTALY
        
else {

        }

    }
    
#endif

    
return false;


Last edited by brucelee; 10-04-2016 at 08:46 AM.
brucelee is offline   Reply With Quote