-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.cpp | 2 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.h | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp index 2128d46..59f1592 100644 --- a/libopie2/opiecore/device/odevice_zaurus.cpp +++ b/libopie2/opiecore/device/odevice_zaurus.cpp | |||
@@ -366,193 +366,193 @@ bool Zaurus::setLedState( OLed which, OLedState st ) | |||
366 | 366 | ||
367 | switch ( st ) { | 367 | switch ( st ) { |
368 | case Led_Off : leds. status = LED_MAIL_NO_UNREAD_MAIL; break; | 368 | case Led_Off : leds. status = LED_MAIL_NO_UNREAD_MAIL; break; |
369 | case Led_On : leds. status = LED_MAIL_NEWMAIL_EXISTS; break; | 369 | case Led_On : leds. status = LED_MAIL_NEWMAIL_EXISTS; break; |
370 | case Led_BlinkSlow: leds. status = LED_MAIL_UNREAD_MAIL_EX; break; | 370 | case Led_BlinkSlow: leds. status = LED_MAIL_UNREAD_MAIL_EX; break; |
371 | default : ok = false; | 371 | default : ok = false; |
372 | } | 372 | } |
373 | 373 | ||
374 | if ( ok && ( ::ioctl ( fd, SHARP_LED_SETSTATUS, &leds ) >= 0 )) { | 374 | if ( ok && ( ::ioctl ( fd, SHARP_LED_SETSTATUS, &leds ) >= 0 )) { |
375 | m_leds [0] = st; | 375 | m_leds [0] = st; |
376 | return true; | 376 | return true; |
377 | } | 377 | } |
378 | } | 378 | } |
379 | } | 379 | } |
380 | return false; | 380 | return false; |
381 | } | 381 | } |
382 | 382 | ||
383 | int Zaurus::displayBrightnessResolution() const | 383 | int Zaurus::displayBrightnessResolution() const |
384 | { | 384 | { |
385 | int res = 1; | 385 | int res = 1; |
386 | if (m_embedix) | 386 | if (m_embedix) |
387 | { | 387 | { |
388 | int fd = ::open( SHARP_FL_IOCTL_DEVICE, O_RDWR|O_NONBLOCK ); | 388 | int fd = ::open( SHARP_FL_IOCTL_DEVICE, O_RDWR|O_NONBLOCK ); |
389 | if ( fd ) | 389 | if ( fd ) |
390 | { | 390 | { |
391 | int value = ::ioctl( fd, SHARP_FL_IOCTL_GET_STEP, 0 ); | 391 | int value = ::ioctl( fd, SHARP_FL_IOCTL_GET_STEP, 0 ); |
392 | ::close( fd ); | 392 | ::close( fd ); |
393 | return value ? value : res; | 393 | return value ? value : res; |
394 | } | 394 | } |
395 | } | 395 | } |
396 | else | 396 | else |
397 | { | 397 | { |
398 | int fd = ::open( "/sys/class/backlight/corgi-bl/max_brightness", O_RDONLY|O_NONBLOCK ); | 398 | int fd = ::open( "/sys/class/backlight/corgi-bl/max_brightness", O_RDONLY|O_NONBLOCK ); |
399 | if ( fd ) | 399 | if ( fd ) |
400 | { | 400 | { |
401 | char buf[100]; | 401 | char buf[100]; |
402 | if ( ::read( fd, &buf[0], sizeof buf ) ) ::sscanf( &buf[0], "%d", &res ); | 402 | if ( ::read( fd, &buf[0], sizeof buf ) ) ::sscanf( &buf[0], "%d", &res ); |
403 | ::close( fd ); | 403 | ::close( fd ); |
404 | } | 404 | } |
405 | } | 405 | } |
406 | return res; | 406 | return res; |
407 | } | 407 | } |
408 | 408 | ||
409 | bool Zaurus::setDisplayBrightness( int bright ) | 409 | bool Zaurus::setDisplayBrightness( int bright ) |
410 | { | 410 | { |
411 | //qDebug( "Zaurus::setDisplayBrightness( %d )", bright ); | 411 | //qDebug( "Zaurus::setDisplayBrightness( %d )", bright ); |
412 | bool res = false; | 412 | bool res = false; |
413 | 413 | ||
414 | if ( bright > 255 ) bright = 255; | 414 | if ( bright > 255 ) bright = 255; |
415 | if ( bright < 0 ) bright = 0; | 415 | if ( bright < 0 ) bright = 0; |
416 | 416 | ||
417 | int numberOfSteps = displayBrightnessResolution(); | 417 | int numberOfSteps = displayBrightnessResolution(); |
418 | int val = ( bright == 1 ) ? 1 : ( bright * numberOfSteps ) / 255; | 418 | int val = ( bright == 1 ) ? 1 : ( bright * numberOfSteps ) / 255; |
419 | 419 | ||
420 | if ( m_embedix ) | 420 | if ( m_embedix ) |
421 | { | 421 | { |
422 | int fd = ::open( SHARP_FL_IOCTL_DEVICE, O_WRONLY|O_NONBLOCK ); | 422 | int fd = ::open( SHARP_FL_IOCTL_DEVICE, O_WRONLY|O_NONBLOCK ); |
423 | if ( fd ) | 423 | if ( fd ) |
424 | { | 424 | { |
425 | res = ( ::ioctl( fd, SHARP_FL_IOCTL_STEP_CONTRAST, val ) == 0 ); | 425 | res = ( ::ioctl( fd, SHARP_FL_IOCTL_STEP_CONTRAST, val ) == 0 ); |
426 | ::close( fd ); | 426 | ::close( fd ); |
427 | } | 427 | } |
428 | } | 428 | } |
429 | else | 429 | else |
430 | { | 430 | { |
431 | int fd = ::open( "/sys/class/backlight/corgi-bl/brightness", O_WRONLY|O_NONBLOCK ); | 431 | int fd = ::open( "/sys/class/backlight/corgi-bl/brightness", O_WRONLY|O_NONBLOCK ); |
432 | if ( fd ) | 432 | if ( fd ) |
433 | { | 433 | { |
434 | char buf[100]; | 434 | char buf[100]; |
435 | int len = ::snprintf( &buf[0], sizeof buf, "%d", val ); | 435 | int len = ::snprintf( &buf[0], sizeof buf, "%d", val ); |
436 | res = ( ::write( fd, &buf[0], len ) == 0 ); | 436 | res = ( ::write( fd, &buf[0], len ) == 0 ); |
437 | ::close( fd ); | 437 | ::close( fd ); |
438 | } | 438 | } |
439 | } | 439 | } |
440 | return res; | 440 | return res; |
441 | } | 441 | } |
442 | 442 | ||
443 | bool Zaurus::setDisplayStatus( bool on ) | 443 | bool Zaurus::setDisplayStatus( bool on ) |
444 | { | 444 | { |
445 | bool res = false; | 445 | bool res = false; |
446 | if ( m_embedix ) | 446 | if ( m_embedix ) |
447 | { | 447 | { |
448 | int fd = ::open( SHARP_FL_IOCTL_DEVICE, O_WRONLY|O_NONBLOCK ); | 448 | int fd = ::open( SHARP_FL_IOCTL_DEVICE, O_WRONLY|O_NONBLOCK ); |
449 | if ( fd ) | 449 | if ( fd ) |
450 | { | 450 | { |
451 | int ioctlnum = on ? SHARP_FL_IOCTL_ON : SHARP_FL_IOCTL_OFF; | 451 | int ioctlnum = on ? SHARP_FL_IOCTL_ON : SHARP_FL_IOCTL_OFF; |
452 | res = ( ::ioctl ( fd, ioctlnum, 0 ) == 0 ); | 452 | res = ( ::ioctl ( fd, ioctlnum, 0 ) == 0 ); |
453 | ::close ( fd ); | 453 | ::close ( fd ); |
454 | } | 454 | } |
455 | } | 455 | } |
456 | else | 456 | else |
457 | { | 457 | { |
458 | int fd = ::open( "/sys/class/backlight/corgi-bl/power", O_WRONLY|O_NONBLOCK ); | 458 | int fd = ::open( "/sys/class/backlight/corgi-bl/power", O_WRONLY|O_NONBLOCK ); |
459 | if ( fd ) | 459 | if ( fd ) |
460 | { | 460 | { |
461 | char buf[10]; | 461 | char buf[10]; |
462 | buf[0] = on ? '1' : '0'; | 462 | buf[0] = on ? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN; |
463 | buf[1] = '\0'; | 463 | buf[1] = '\0'; |
464 | res = ( ::write( fd, &buf[0], 2 ) == 0 ); | 464 | res = ( ::write( fd, &buf[0], 2 ) == 0 ); |
465 | ::close( fd ); | 465 | ::close( fd ); |
466 | } | 466 | } |
467 | } | 467 | } |
468 | return res; | 468 | return res; |
469 | } | 469 | } |
470 | 470 | ||
471 | bool Zaurus::suspend() | 471 | bool Zaurus::suspend() |
472 | { | 472 | { |
473 | qDebug("ODevice::suspend"); | 473 | qDebug("ODevice::suspend"); |
474 | if ( !isQWS( ) ) // only qwsserver is allowed to suspend | 474 | if ( !isQWS( ) ) // only qwsserver is allowed to suspend |
475 | return false; | 475 | return false; |
476 | 476 | ||
477 | if ( d->m_model == Model_Unknown ) // better don't suspend in qvfb / on unkown devices | 477 | if ( d->m_model == Model_Unknown ) // better don't suspend in qvfb / on unkown devices |
478 | return false; | 478 | return false; |
479 | 479 | ||
480 | bool res = false; | 480 | bool res = false; |
481 | ODevice::sendSuspendmsg(); | 481 | ODevice::sendSuspendmsg(); |
482 | 482 | ||
483 | struct timeval tvs, tvn; | 483 | struct timeval tvs, tvn; |
484 | ::gettimeofday ( &tvs, 0 ); | 484 | ::gettimeofday ( &tvs, 0 ); |
485 | 485 | ||
486 | ::sync(); // flush fs caches | 486 | ::sync(); // flush fs caches |
487 | res = ( ::system ( "apm --suspend" ) == 0 ); | 487 | res = ( ::system ( "apm --suspend" ) == 0 ); |
488 | 488 | ||
489 | // This is needed because the apm implementation is asynchronous and we | 489 | // This is needed because the apm implementation is asynchronous and we |
490 | // can not be sure when exactly the device is really suspended | 490 | // can not be sure when exactly the device is really suspended |
491 | if ( res ) { | 491 | if ( res ) { |
492 | do { // Yes, wait 15 seconds. This APM sucks big time. | 492 | do { // Yes, wait 15 seconds. This APM sucks big time. |
493 | ::usleep ( 200 * 1000 ); | 493 | ::usleep ( 200 * 1000 ); |
494 | ::gettimeofday ( &tvn, 0 ); | 494 | ::gettimeofday ( &tvn, 0 ); |
495 | } while ((( tvn. tv_sec - tvs. tv_sec ) * 1000 + ( tvn. tv_usec - tvs. tv_usec ) / 1000 ) < 15000 ); | 495 | } while ((( tvn. tv_sec - tvs. tv_sec ) * 1000 + ( tvn. tv_usec - tvs. tv_usec ) / 1000 ) < 15000 ); |
496 | } | 496 | } |
497 | 497 | ||
498 | QCopEnvelope ( "QPE/Rotation", "rotateDefault()" ); | 498 | QCopEnvelope ( "QPE/Rotation", "rotateDefault()" ); |
499 | return res; | 499 | return res; |
500 | } | 500 | } |
501 | 501 | ||
502 | 502 | ||
503 | Transformation Zaurus::rotation() const | 503 | Transformation Zaurus::rotation() const |
504 | { | 504 | { |
505 | Transformation rot; | 505 | Transformation rot; |
506 | 506 | ||
507 | switch ( d->m_model ) { | 507 | switch ( d->m_model ) { |
508 | case Model_Zaurus_SLC3000: // fallthrough | 508 | case Model_Zaurus_SLC3000: // fallthrough |
509 | case Model_Zaurus_SLC7x0: { | 509 | case Model_Zaurus_SLC7x0: { |
510 | OHingeStatus hs = readHingeSensor(); | 510 | OHingeStatus hs = readHingeSensor(); |
511 | if ( hs == CASE_PORTRAIT ) rot = Rot0; | 511 | if ( hs == CASE_PORTRAIT ) rot = Rot0; |
512 | else if ( hs == CASE_UNKNOWN ) rot = Rot0; | 512 | else if ( hs == CASE_UNKNOWN ) rot = Rot0; |
513 | else rot = Rot270; | 513 | else rot = Rot270; |
514 | } | 514 | } |
515 | break; | 515 | break; |
516 | case Model_Zaurus_SL6000: | 516 | case Model_Zaurus_SL6000: |
517 | case Model_Zaurus_SLB600: | 517 | case Model_Zaurus_SLB600: |
518 | case Model_Zaurus_SLA300: | 518 | case Model_Zaurus_SLA300: |
519 | case Model_Zaurus_SL5500: | 519 | case Model_Zaurus_SL5500: |
520 | case Model_Zaurus_SL5000: | 520 | case Model_Zaurus_SL5000: |
521 | default: | 521 | default: |
522 | rot = d->m_rotation; | 522 | rot = d->m_rotation; |
523 | break; | 523 | break; |
524 | } | 524 | } |
525 | 525 | ||
526 | return rot; | 526 | return rot; |
527 | } | 527 | } |
528 | ODirection Zaurus::direction() const | 528 | ODirection Zaurus::direction() const |
529 | { | 529 | { |
530 | ODirection dir; | 530 | ODirection dir; |
531 | 531 | ||
532 | switch ( d->m_model ) { | 532 | switch ( d->m_model ) { |
533 | case Model_Zaurus_SLC3000: // fallthrough | 533 | case Model_Zaurus_SLC3000: // fallthrough |
534 | case Model_Zaurus_SLC7x0: { | 534 | case Model_Zaurus_SLC7x0: { |
535 | OHingeStatus hs = readHingeSensor(); | 535 | OHingeStatus hs = readHingeSensor(); |
536 | if ( hs == CASE_PORTRAIT ) dir = CCW; | 536 | if ( hs == CASE_PORTRAIT ) dir = CCW; |
537 | else if ( hs == CASE_UNKNOWN ) dir = CCW; | 537 | else if ( hs == CASE_UNKNOWN ) dir = CCW; |
538 | else dir = CW; | 538 | else dir = CW; |
539 | } | 539 | } |
540 | break; | 540 | break; |
541 | case Model_Zaurus_SL6000: | 541 | case Model_Zaurus_SL6000: |
542 | case Model_Zaurus_SLA300: | 542 | case Model_Zaurus_SLA300: |
543 | case Model_Zaurus_SLB600: | 543 | case Model_Zaurus_SLB600: |
544 | case Model_Zaurus_SL5500: | 544 | case Model_Zaurus_SL5500: |
545 | case Model_Zaurus_SL5000: | 545 | case Model_Zaurus_SL5000: |
546 | default: dir = d->m_direction; | 546 | default: dir = d->m_direction; |
547 | break; | 547 | break; |
548 | } | 548 | } |
549 | return dir; | 549 | return dir; |
550 | 550 | ||
551 | } | 551 | } |
552 | 552 | ||
553 | bool Zaurus::hasHingeSensor() const | 553 | bool Zaurus::hasHingeSensor() const |
554 | { | 554 | { |
555 | return d->m_model == Model_Zaurus_SLC7x0 || d->m_model == Model_Zaurus_SLC3000; | 555 | return d->m_model == Model_Zaurus_SLC7x0 || d->m_model == Model_Zaurus_SLC3000; |
556 | } | 556 | } |
557 | 557 | ||
558 | OHingeStatus Zaurus::readHingeSensor() const | 558 | OHingeStatus Zaurus::readHingeSensor() const |
diff --git a/libopie2/opiecore/device/odevice_zaurus.h b/libopie2/opiecore/device/odevice_zaurus.h index 04e73c4..80593ce 100644 --- a/libopie2/opiecore/device/odevice_zaurus.h +++ b/libopie2/opiecore/device/odevice_zaurus.h | |||
@@ -1,136 +1,140 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | Copyright (C) The Opie Team <opie-devel@handhelds.org> | 3 | Copyright (C) The Opie Team <opie-devel@handhelds.org> |
4 | =. Copyright (C) 2003-2005 Michael 'Mickey' Lauer <mickey@Vanille.de> | 4 | =. Copyright (C) 2003-2005 Michael 'Mickey' Lauer <mickey@Vanille.de> |
5 | .=l. | 5 | .=l. |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #ifndef ODEVICE_ZAURUS | 30 | #ifndef ODEVICE_ZAURUS |
31 | #define ODEVICE_ZAURUS | 31 | #define ODEVICE_ZAURUS |
32 | 32 | ||
33 | #include <opie2/odevice.h> | 33 | #include <opie2/odevice.h> |
34 | 34 | ||
35 | #ifndef ARRAY_SIZE | 35 | #ifndef ARRAY_SIZE |
36 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) | 36 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) |
37 | #endif | 37 | #endif |
38 | 38 | ||
39 | // _IO and friends are only defined in kernel headers ... | 39 | // _IO and friends are only defined in kernel headers ... |
40 | #define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) | 40 | #define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) |
41 | #define OD_IO(type,number) OD_IOC(0,type,number,0) | 41 | #define OD_IO(type,number) OD_IOC(0,type,number,0) |
42 | #define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size)) | 42 | #define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size)) |
43 | #define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size)) | 43 | #define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size)) |
44 | #define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size)) | 44 | #define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size)) |
45 | 45 | ||
46 | // Audio | 46 | // Audio |
47 | #define SHARP_DEV_IOCTL_COMMAND_START 0x5680 | 47 | #define SHARP_DEV_IOCTL_COMMAND_START 0x5680 |
48 | 48 | ||
49 | #define SHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) | 49 | #define SHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) |
50 | #define SHARP_BUZZER_MAKESOUND (SHARP_BUZZER_IOCTL_START) | 50 | #define SHARP_BUZZER_MAKESOUND (SHARP_BUZZER_IOCTL_START) |
51 | 51 | ||
52 | #define SHARP_BUZ_TOUCHSOUND 1 /* touch panel sound */ | 52 | #define SHARP_BUZ_TOUCHSOUND 1 /* touch panel sound */ |
53 | #define SHARP_BUZ_KEYSOUND 2 /* key sound */ | 53 | #define SHARP_BUZ_KEYSOUND 2 /* key sound */ |
54 | #define SHARP_BUZ_SCHEDULE_ALARM 11 /* schedule alarm */ | 54 | #define SHARP_BUZ_SCHEDULE_ALARM 11 /* schedule alarm */ |
55 | 55 | ||
56 | #define SHARP_BUZZER_SETVOLUME (SHARP_BUZZER_IOCTL_START+1) | 56 | #define SHARP_BUZZER_SETVOLUME (SHARP_BUZZER_IOCTL_START+1) |
57 | #define SHARP_BUZZER_GETVOLUME (SHARP_BUZZER_IOCTL_START+2) | 57 | #define SHARP_BUZZER_GETVOLUME (SHARP_BUZZER_IOCTL_START+2) |
58 | #define SHARP_BUZZER_ISSUPPORTED (SHARP_BUZZER_IOCTL_START+3) | 58 | #define SHARP_BUZZER_ISSUPPORTED (SHARP_BUZZER_IOCTL_START+3) |
59 | #define SHARP_BUZZER_SETMUTE (SHARP_BUZZER_IOCTL_START+4) | 59 | #define SHARP_BUZZER_SETMUTE (SHARP_BUZZER_IOCTL_START+4) |
60 | #define SHARP_BUZZER_STOPSOUND (SHARP_BUZZER_IOCTL_START+5) | 60 | #define SHARP_BUZZER_STOPSOUND (SHARP_BUZZER_IOCTL_START+5) |
61 | 61 | ||
62 | // LED | 62 | // LED |
63 | #define SHARP_LED_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) | 63 | #define SHARP_LED_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) |
64 | #define SHARP_LED_SETSTATUS (SHARP_LED_IOCTL_START+1) | 64 | #define SHARP_LED_SETSTATUS (SHARP_LED_IOCTL_START+1) |
65 | #define SHARP_LED_MAIL_EXISTS 9 /* mail status (exists or not) */ | 65 | #define SHARP_LED_MAIL_EXISTS 9 /* mail status (exists or not) */ |
66 | 66 | ||
67 | #define LED_MAIL_NO_UNREAD_MAIL 0 /* for SHARP_LED_MAIL_EXISTS */ | 67 | #define LED_MAIL_NO_UNREAD_MAIL 0 /* for SHARP_LED_MAIL_EXISTS */ |
68 | #define LED_MAIL_NEWMAIL_EXISTS 1 /* for SHARP_LED_MAIL_EXISTS */ | 68 | #define LED_MAIL_NEWMAIL_EXISTS 1 /* for SHARP_LED_MAIL_EXISTS */ |
69 | #define LED_MAIL_UNREAD_MAIL_EX 2 /* for SHARP_LED_MAIL_EXISTS */ | 69 | #define LED_MAIL_UNREAD_MAIL_EX 2 /* for SHARP_LED_MAIL_EXISTS */ |
70 | 70 | ||
71 | // Rotation and Power Management | 71 | // Rotation and Power Management |
72 | #define SHARP_IOCTL_GET_ROTATION 0x413c | 72 | #define SHARP_IOCTL_GET_ROTATION 0x413c |
73 | 73 | ||
74 | #define APM_IOCGEVTSRC OD_IOR( 'A', 203, int ) | 74 | #define APM_IOCGEVTSRC OD_IOR( 'A', 203, int ) |
75 | #define APM_IOCSEVTSRC OD_IORW( 'A', 204, int ) | 75 | #define APM_IOCSEVTSRC OD_IORW( 'A', 204, int ) |
76 | #define APM_EVT_POWER_BUTTON (1 << 0) | 76 | #define APM_EVT_POWER_BUTTON (1 << 0) |
77 | 77 | ||
78 | // Brightness | 78 | // Brightness Embedix |
79 | #define SHARP_FL_IOCTL_DEVICE "/dev/sharp_fl" | 79 | #define SHARP_FL_IOCTL_DEVICE "/dev/sharp_fl" |
80 | #define SHARP_FL_IOCTL_ON 1 | 80 | #define SHARP_FL_IOCTL_ON 1 |
81 | #define SHARP_FL_IOCTL_OFF 2 | 81 | #define SHARP_FL_IOCTL_OFF 2 |
82 | #define SHARP_FL_IOCTL_STEP_CONTRAST 100 | 82 | #define SHARP_FL_IOCTL_STEP_CONTRAST 100 |
83 | #define SHARP_FL_IOCTL_GET_STEP_CONTRAST 101 | 83 | #define SHARP_FL_IOCTL_GET_STEP_CONTRAST 101 |
84 | #define SHARP_FL_IOCTL_GET_STEP 102 | 84 | #define SHARP_FL_IOCTL_GET_STEP 102 |
85 | 85 | ||
86 | // Vesa Standard | ||
87 | #define FB_BLANK_UNBLANK 0 | ||
88 | #define FB_BLANK_POWERDOWN 4 | ||
89 | |||
86 | namespace Opie { | 90 | namespace Opie { |
87 | namespace Core { | 91 | namespace Core { |
88 | namespace Internal { | 92 | namespace Internal { |
89 | 93 | ||
90 | class Zaurus : public ODevice | 94 | class Zaurus : public ODevice |
91 | { | 95 | { |
92 | protected: | 96 | protected: |
93 | virtual void init(const QString&); | 97 | virtual void init(const QString&); |
94 | virtual void initButtons(); | 98 | virtual void initButtons(); |
95 | 99 | ||
96 | public: | 100 | public: |
97 | virtual bool setDisplayBrightness( int b ); | 101 | virtual bool setDisplayBrightness( int b ); |
98 | virtual bool setDisplayStatus( bool on ); | 102 | virtual bool setDisplayStatus( bool on ); |
99 | virtual int displayBrightnessResolution() const; | 103 | virtual int displayBrightnessResolution() const; |
100 | 104 | ||
101 | virtual void playAlarmSound(); | 105 | virtual void playAlarmSound(); |
102 | virtual void playKeySound(); | 106 | virtual void playKeySound(); |
103 | virtual void playTouchSound(); | 107 | virtual void playTouchSound(); |
104 | 108 | ||
105 | virtual QValueList <OLed> ledList() const; | 109 | virtual QValueList <OLed> ledList() const; |
106 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; | 110 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; |
107 | virtual OLedState ledState( OLed led ) const; | 111 | virtual OLedState ledState( OLed led ) const; |
108 | virtual bool setLedState( OLed led, OLedState st ); | 112 | virtual bool setLedState( OLed led, OLedState st ); |
109 | 113 | ||
110 | virtual bool hasHingeSensor() const; | 114 | virtual bool hasHingeSensor() const; |
111 | virtual OHingeStatus readHingeSensor() const; | 115 | virtual OHingeStatus readHingeSensor() const; |
112 | 116 | ||
113 | virtual bool suspend(); | 117 | virtual bool suspend(); |
114 | virtual Transformation rotation() const; | 118 | virtual Transformation rotation() const; |
115 | virtual ODirection direction() const; | 119 | virtual ODirection direction() const; |
116 | 120 | ||
117 | protected: | 121 | protected: |
118 | virtual void buzzer( int snd ); | 122 | virtual void buzzer( int snd ); |
119 | 123 | ||
120 | OLedState m_leds[1]; | 124 | OLedState m_leds[1]; |
121 | bool m_embedix; | 125 | bool m_embedix; |
122 | }; | 126 | }; |
123 | 127 | ||
124 | struct z_button { | 128 | struct z_button { |
125 | Qt::Key code; | 129 | Qt::Key code; |
126 | char *utext; | 130 | char *utext; |
127 | char *pix; | 131 | char *pix; |
128 | char *fpressedservice; | 132 | char *fpressedservice; |
129 | char *fpressedaction; | 133 | char *fpressedaction; |
130 | char *fheldservice; | 134 | char *fheldservice; |
131 | char *fheldaction; | 135 | char *fheldaction; |
132 | }; | 136 | }; |
133 | } | 137 | } |
134 | } | 138 | } |
135 | } | 139 | } |
136 | #endif | 140 | #endif |