author | schurig <schurig> | 2004-09-08 14:37:07 (UTC) |
---|---|---|
committer | schurig <schurig> | 2004-09-08 14:37:07 (UTC) |
commit | 548f5017a18a0d574baadfb3f063f734db13944a (patch) (unidiff) | |
tree | 04b0f1958f767455496375945b15e9fe898b759c | |
parent | 409d1470e28bfaf9a8de34f231a3d6e0ff0b090d (diff) | |
download | opie-548f5017a18a0d574baadfb3f063f734db13944a.zip opie-548f5017a18a0d574baadfb3f063f734db13944a.tar.gz opie-548f5017a18a0d574baadfb3f063f734db13944a.tar.bz2 |
default rotation is now 90
-rw-r--r-- | libopie/odevice.cpp | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp index 4258d60..013f804 100644 --- a/libopie/odevice.cpp +++ b/libopie/odevice.cpp | |||
@@ -348,70 +348,48 @@ struct s_button { | |||
348 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 348 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
349 | Qt::Key_F7, QT_TRANSLATE_NOOP("Button", "Upper+Right"), | 349 | Qt::Key_F7, QT_TRANSLATE_NOOP("Button", "Upper+Right"), |
350 | "devicebuttons/simpad_upper_right", | 350 | "devicebuttons/simpad_upper_right", |
351 | "QPE/TaskBar", "toggleMenu()", | 351 | "QPE/TaskBar", "toggleMenu()", |
352 | "QPE/TaskBar", "toggleStartMenu()" }, | 352 | "QPE/TaskBar", "toggleStartMenu()" }, |
353 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 353 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
354 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Upper+Left"), | 354 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Upper+Left"), |
355 | "devicebuttons/simpad_upper_left", | 355 | "devicebuttons/simpad_upper_left", |
356 | "QPE/Rotation", "flip()", | 356 | "QPE/Rotation", "flip()", |
357 | "QPE/Rotation", "flip()" }, | 357 | "QPE/Rotation", "flip()" }, |
358 | /* | 358 | /* |
359 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 359 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
360 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"), | 360 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"), |
361 | "devicebuttons/simpad_lower_upper", | 361 | "devicebuttons/simpad_lower_upper", |
362 | "QPE/Launcher", "home()", | 362 | "QPE/Launcher", "home()", |
363 | "buttonsettings", "raise()" }, | 363 | "buttonsettings", "raise()" }, |
364 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 364 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
365 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"), | 365 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"), |
366 | "devicebuttons/simpad_upper_lower", | 366 | "devicebuttons/simpad_upper_lower", |
367 | "QPE/Launcher", "home()", | 367 | "QPE/Launcher", "home()", |
368 | "buttonsettings", "raise()" }, | 368 | "buttonsettings", "raise()" }, |
369 | */ | 369 | */ |
370 | }; | 370 | }; |
371 | 371 | ||
372 | struct r_button { | ||
373 | uint model; | ||
374 | Qt::Key code; | ||
375 | char *utext; | ||
376 | char *pix; | ||
377 | char *fpressedservice; | ||
378 | char *fpressedaction; | ||
379 | char *fheldservice; | ||
380 | char *fheldaction; | ||
381 | } ramses_buttons [] = { | ||
382 | { Model_Ramses_MNCI, | ||
383 | Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), | ||
384 | "devicebuttons/z_menu", | ||
385 | "QPE/TaskBar", "toggleMenu()", | ||
386 | "QPE/TaskBar", "toggleStartMenu()" }, | ||
387 | { Model_Ramses_MNCI, | ||
388 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), | ||
389 | "devicebuttons/ipaq_home", | ||
390 | "QPE/Launcher", "home()", | ||
391 | "buttonsettings", "raise()" }, | ||
392 | }; | ||
393 | |||
394 | class Yopy : public ODevice { | 372 | class Yopy : public ODevice { |
395 | protected: | 373 | protected: |
396 | virtual void init ( ); | 374 | virtual void init ( ); |
397 | virtual void initButtons ( ); | 375 | virtual void initButtons ( ); |
398 | 376 | ||
399 | public: | 377 | public: |
400 | virtual bool suspend ( ); | 378 | virtual bool suspend ( ); |
401 | 379 | ||
402 | virtual bool setDisplayBrightness ( int b ); | 380 | virtual bool setDisplayBrightness ( int b ); |
403 | virtual int displayBrightnessResolution ( ) const; | 381 | virtual int displayBrightnessResolution ( ) const; |
404 | 382 | ||
405 | static bool isYopy ( ); | 383 | static bool isYopy ( ); |
406 | }; | 384 | }; |
407 | 385 | ||
408 | struct yopy_button { | 386 | struct yopy_button { |
409 | Qt::Key code; | 387 | Qt::Key code; |
410 | char *utext; | 388 | char *utext; |
411 | char *pix; | 389 | char *pix; |
412 | char *fpressedservice; | 390 | char *fpressedservice; |
413 | char *fpressedaction; | 391 | char *fpressedaction; |
414 | char *fheldservice; | 392 | char *fheldservice; |
415 | char *fheldaction; | 393 | char *fheldaction; |
416 | } yopy_buttons [] = { | 394 | } yopy_buttons [] = { |
417 | { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Action Button"), | 395 | { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Action Button"), |
@@ -431,54 +409,54 @@ struct yopy_button { | |||
431 | static QCString makeChannel ( const char *str ) | 409 | static QCString makeChannel ( const char *str ) |
432 | { | 410 | { |
433 | if ( str && !::strchr ( str, '/' )) | 411 | if ( str && !::strchr ( str, '/' )) |
434 | return QCString ( "QPE/Application/" ) + str; | 412 | return QCString ( "QPE/Application/" ) + str; |
435 | else | 413 | else |
436 | return str; | 414 | return str; |
437 | } | 415 | } |
438 | 416 | ||
439 | static inline bool isQWS() | 417 | static inline bool isQWS() |
440 | { | 418 | { |
441 | return qApp ? ( qApp-> type ( ) == QApplication::GuiServer ) : false; | 419 | return qApp ? ( qApp-> type ( ) == QApplication::GuiServer ) : false; |
442 | } | 420 | } |
443 | 421 | ||
444 | ODevice *ODevice::inst ( ) | 422 | ODevice *ODevice::inst ( ) |
445 | { | 423 | { |
446 | static ODevice *dev = 0; | 424 | static ODevice *dev = 0; |
447 | 425 | ||
448 | if ( !dev ) { | 426 | if ( !dev ) { |
449 | if ( QFile::exists ( "/proc/hal/model" )) | 427 | if ( QFile::exists ( "/proc/hal/model" )) |
450 | dev = new iPAQ ( ); | 428 | dev = new iPAQ ( ); |
451 | else if ( Zaurus::isZaurus() ) | 429 | else if ( Zaurus::isZaurus() ) |
452 | dev = new Zaurus ( ); | 430 | dev = new Zaurus ( ); |
453 | else if ( QFile::exists ( "/proc/ucb1x00" ) && QFile::exists ( "/proc/cs3" )) | 431 | else if ( QFile::exists ( "/proc/ucb1x00" ) && QFile::exists ( "/proc/cs3" )) |
454 | dev = new SIMpad ( ); | 432 | dev = new SIMpad ( ); |
455 | else if ( QFile::exists ( "/proc/sys/board/name" )) | ||
456 | dev = new Ramses ( ); | ||
457 | else if ( Yopy::isYopy() ) | 433 | else if ( Yopy::isYopy() ) |
458 | dev = new Yopy ( ); | 434 | dev = new Yopy ( ); |
459 | else if ( Jornada::isJornada() ) | 435 | else if ( Jornada::isJornada() ) |
460 | dev = new Jornada ( ); | 436 | dev = new Jornada ( ); |
437 | else if ( QFile::exists ( "/proc/sys/board/sys_name" )) | ||
438 | dev = new Ramses ( ); | ||
461 | else | 439 | else |
462 | dev = new ODevice ( ); | 440 | dev = new ODevice ( ); |
463 | dev-> init ( ); | 441 | dev-> init ( ); |
464 | } | 442 | } |
465 | return dev; | 443 | return dev; |
466 | } | 444 | } |
467 | 445 | ||
468 | 446 | ||
469 | /************************************************** | 447 | /************************************************** |
470 | * | 448 | * |
471 | * common | 449 | * common |
472 | * | 450 | * |
473 | **************************************************/ | 451 | **************************************************/ |
474 | 452 | ||
475 | 453 | ||
476 | ODevice::ODevice ( ) | 454 | ODevice::ODevice ( ) |
477 | { | 455 | { |
478 | d = new ODeviceData; | 456 | d = new ODeviceData; |
479 | 457 | ||
480 | d-> m_modelstr = "Unknown"; | 458 | d-> m_modelstr = "Unknown"; |
481 | d-> m_model = Model_Unknown; | 459 | d-> m_model = Model_Unknown; |
482 | d-> m_vendorstr = "Unknown"; | 460 | d-> m_vendorstr = "Unknown"; |
483 | d-> m_vendor = Vendor_Unknown; | 461 | d-> m_vendor = Vendor_Unknown; |
484 | d-> m_systemstr = "Unknown"; | 462 | d-> m_systemstr = "Unknown"; |
@@ -2507,49 +2485,49 @@ bool SIMpad::setDisplayBrightness ( int bright ) | |||
2507 | } | 2485 | } |
2508 | 2486 | ||
2509 | 2487 | ||
2510 | int SIMpad::displayBrightnessResolution ( ) const | 2488 | int SIMpad::displayBrightnessResolution ( ) const |
2511 | { | 2489 | { |
2512 | return 255; // All SIMpad models share the same display | 2490 | return 255; // All SIMpad models share the same display |
2513 | } | 2491 | } |
2514 | 2492 | ||
2515 | /************************************************** | 2493 | /************************************************** |
2516 | * | 2494 | * |
2517 | * Ramses | 2495 | * Ramses |
2518 | * | 2496 | * |
2519 | **************************************************/ | 2497 | **************************************************/ |
2520 | 2498 | ||
2521 | void Ramses::init() | 2499 | void Ramses::init() |
2522 | { | 2500 | { |
2523 | d->m_vendorstr = "M und N"; | 2501 | d->m_vendorstr = "M und N"; |
2524 | d->m_vendor = Vendor_MundN; | 2502 | d->m_vendor = Vendor_MundN; |
2525 | 2503 | ||
2526 | QFile f("/proc/sys/board/ramses"); | 2504 | QFile f("/proc/sys/board/ramses"); |
2527 | 2505 | ||
2528 | d->m_modelstr = "Ramses"; | 2506 | d->m_modelstr = "Ramses"; |
2529 | d->m_model = Model_Ramses_MNCI; | 2507 | d->m_model = Model_Ramses_MNCI; |
2530 | 2508 | ||
2531 | d->m_rotation = Rot0; | 2509 | d->m_rotation = Rot90; |
2532 | d->m_holdtime = 1000; | 2510 | d->m_holdtime = 1000; |
2533 | 2511 | ||
2534 | f.setName("/etc/oz_version"); | 2512 | f.setName("/etc/oz_version"); |
2535 | 2513 | ||
2536 | if (f.open(IO_ReadOnly)) { | 2514 | if (f.open(IO_ReadOnly)) { |
2537 | d->m_systemstr = "OpenEmbedded/Ramses"; | 2515 | d->m_systemstr = "OpenEmbedded/Ramses"; |
2538 | d->m_system = System_OpenZaurus; | 2516 | d->m_system = System_OpenZaurus; |
2539 | 2517 | ||
2540 | QTextStream ts(&f); | 2518 | QTextStream ts(&f); |
2541 | ts.setDevice(&f); | 2519 | ts.setDevice(&f); |
2542 | d->m_sysverstr = ts.readLine(); | 2520 | d->m_sysverstr = ts.readLine(); |
2543 | f.close(); | 2521 | f.close(); |
2544 | } | 2522 | } |
2545 | 2523 | ||
2546 | m_power_timer = 0; | 2524 | m_power_timer = 0; |
2547 | 2525 | ||
2548 | #ifdef QT_QWS_ALLOW_OVERCLOCK | 2526 | #ifdef QT_QWS_ALLOW_OVERCLOCK |
2549 | #warning *** Overclocking enabled - this may fry your hardware - you have been warned *** | 2527 | #warning *** Overclocking enabled - this may fry your hardware - you have been warned *** |
2550 | #define OC(x...) x | 2528 | #define OC(x...) x |
2551 | #else | 2529 | #else |
2552 | #define OC(x...) | 2530 | #define OC(x...) |
2553 | #endif | 2531 | #endif |
2554 | 2532 | ||
2555 | 2533 | ||