summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpedecoration_qws.cpp7
-rw-r--r--library/task-opie-applets.control2
-rw-r--r--library/task-opie-complete.control2
-rw-r--r--library/task-opie-games.control2
-rw-r--r--library/task-opie-pim.control2
-rw-r--r--library/task-opie-settings.control2
6 files changed, 10 insertions, 7 deletions
diff --git a/library/qpedecoration_qws.cpp b/library/qpedecoration_qws.cpp
index 708dd23..214c721 100644
--- a/library/qpedecoration_qws.cpp
+++ b/library/qpedecoration_qws.cpp
@@ -407,224 +407,227 @@ void WindowDecorationInterface::drawArea( Area a, QPainter *p, const WindowData
407 p->drawLine( r.left(), i, r.right(), i ); 407 p->drawLine( r.left(), i, r.right(), i );
408 } 408 }
409 break; 409 break;
410 case TitleText: 410 case TitleText:
411 p->drawText( r.x()+3+metric(HelpWidth,wd), r.top()-th, 411 p->drawText( r.x()+3+metric(HelpWidth,wd), r.top()-th,
412 r.width()-metric(OKWidth,wd)-metric(CloseWidth,wd), 412 r.width()-metric(OKWidth,wd)-metric(CloseWidth,wd),
413 th, QPainter::AlignVCenter, wd->caption); 413 th, QPainter::AlignVCenter, wd->caption);
414 break; 414 break;
415 } 415 }
416} 416}
417 417
418void WindowDecorationInterface::drawButton( Button b, QPainter *p, const WindowData *wd, int x, int y, int, int, QWSButton::State state ) const 418void WindowDecorationInterface::drawButton( Button b, QPainter *p, const WindowData *wd, int x, int y, int, int, QWSButton::State state ) const
419{ 419{
420 QImage *img = 0; 420 QImage *img = 0;
421 switch ( b ) { 421 switch ( b ) {
422 case OK: 422 case OK:
423 img = okImage(metric(TitleHeight,wd)); 423 img = okImage(metric(TitleHeight,wd));
424 break; 424 break;
425 case Close: 425 case Close:
426 img = closeImage(metric(TitleHeight,wd)); 426 img = closeImage(metric(TitleHeight,wd));
427 break; 427 break;
428 case Help: 428 case Help:
429 img = helpImage(metric(TitleHeight,wd)); 429 img = helpImage(metric(TitleHeight,wd));
430 break; 430 break;
431 case Maximize: 431 case Maximize:
432 img = maximizeImage(metric(TitleHeight,wd)); 432 img = maximizeImage(metric(TitleHeight,wd));
433 break; 433 break;
434 } 434 }
435 435
436 if ( img ) { 436 if ( img ) {
437 if ((state & QWSButton::MouseOver) && (state & QWSButton::Clicked)) 437 if ((state & QWSButton::MouseOver) && (state & QWSButton::Clicked))
438 p->drawImage(x+2, y+2, *img); 438 p->drawImage(x+2, y+2, *img);
439 else 439 else
440 p->drawImage(x+1, y+1, *img); 440 p->drawImage(x+1, y+1, *img);
441 } 441 }
442} 442}
443 443
444QRegion WindowDecorationInterface::mask( const WindowData *wd ) const 444QRegion WindowDecorationInterface::mask( const WindowData *wd ) const
445{ 445{
446 int th = metric(TitleHeight,wd); 446 int th = metric(TitleHeight,wd);
447 QRect rect( wd->rect ); 447 QRect rect( wd->rect );
448 QRect r(rect.left() - metric(LeftBorder,wd), 448 QRect r(rect.left() - metric(LeftBorder,wd),
449 rect.top() - th - metric(TopBorder,wd), 449 rect.top() - th - metric(TopBorder,wd),
450 rect.width() + metric(LeftBorder,wd) + metric(RightBorder,wd), 450 rect.width() + metric(LeftBorder,wd) + metric(RightBorder,wd),
451 rect.height() + th + metric(TopBorder,wd) + metric(BottomBorder,wd)); 451 rect.height() + th + metric(TopBorder,wd) + metric(BottomBorder,wd));
452 return QRegion(r) - rect; 452 return QRegion(r) - rect;
453} 453}
454 454
455class DefaultWindowDecoration : public WindowDecorationInterface 455class DefaultWindowDecoration : public WindowDecorationInterface
456{ 456{
457public: 457public:
458 DefaultWindowDecoration() : ref(0) {} 458 DefaultWindowDecoration() : ref(0) {}
459 QString name() const { 459 QString name() const {
460 return "Default"; 460 return "Default";
461 } 461 }
462 QPixmap icon() const { 462 QPixmap icon() const {
463 return QPixmap(); 463 return QPixmap();
464 } 464 }
465 QRESULT queryInterface( const QUuid &uuid, QUnknownInterface **iface ) { 465 QRESULT queryInterface( const QUuid &uuid, QUnknownInterface **iface ) {
466 *iface = 0; 466 *iface = 0;
467 if ( uuid == IID_QUnknown ) 467 if ( uuid == IID_QUnknown )
468 *iface = this; 468 *iface = this;
469 else if ( uuid == IID_WindowDecoration ) 469 else if ( uuid == IID_WindowDecoration )
470 *iface = this; 470 *iface = this;
471 471
472 if ( *iface ) 472 if ( *iface )
473 (*iface)->addRef(); 473 (*iface)->addRef();
474 return QS_OK; 474 return QS_OK;
475 } 475 }
476 Q_REFCOUNT 476 Q_REFCOUNT
477 477
478private: 478private:
479 ulong ref; 479 ulong ref;
480}; 480};
481 481
482static WindowDecorationInterface *wdiface = 0; 482static WindowDecorationInterface *wdiface = 0;
483static QLibrary *wdlib = 0; 483static QLibrary *wdlib = 0;
484 484
485//=========================================================================== 485//===========================================================================
486 486
487QPEDecoration::QPEDecoration() 487QPEDecoration::QPEDecoration()
488 : QWSDefaultDecoration() 488 : QWSDefaultDecoration()
489{ 489{
490 if ( wdlib ) { 490 if ( wdlib ) {
491 wdiface->release(); 491 wdiface->release();
492 wdlib->unload(); 492 wdlib->unload();
493 delete wdlib; 493 delete wdlib;
494 wdlib = 0; 494 wdlib = 0;
495 } else { 495 } else {
496 delete wdiface; 496 delete wdiface;
497 } 497 }
498 wdiface = new DefaultWindowDecoration; 498 wdiface = new DefaultWindowDecoration;
499 499
500 helpFile = QString(qApp->argv()[0]) + ".html"; 500 helpFile = QString(qApp->argv()[0]) + ".html";
501 QStringList helpPath = Global::helpPath(); 501 QStringList helpPath = Global::helpPath();
502 helpExists = FALSE; 502 helpExists = FALSE;
503 for (QStringList::ConstIterator it=helpPath.begin(); it!=helpPath.end() && !helpExists; ++it) 503 for (QStringList::ConstIterator it=helpPath.begin(); it!=helpPath.end() && !helpExists; ++it) {
504 helpExists = QFile::exists( *it + "/" + helpFile ); 504 helpExists = QFile::exists( *it + "/" + helpFile );
505 qDebug ( "Checking %s/%s for help: %d", (*it).latin1(), helpFile.latin1(),helpExists);
506 }
505 qpeManager = new QPEManager( this ); 507 qpeManager = new QPEManager( this );
506} 508}
507 509
508QPEDecoration::QPEDecoration( const QString &plugin ) 510QPEDecoration::QPEDecoration( const QString &plugin )
509 : QWSDefaultDecoration() 511 : QWSDefaultDecoration()
510{ 512{
511 if ( wdlib ) { 513 if ( wdlib ) {
512 wdiface->release(); 514 wdiface->release();
513 wdlib->unload(); 515 wdlib->unload();
514 delete wdlib; 516 delete wdlib;
515 wdlib = 0; 517 wdlib = 0;
516 } else { 518 } else {
517 delete wdiface; 519 delete wdiface;
518 } 520 }
519 WindowDecorationInterface *iface = 0; 521 WindowDecorationInterface *iface = 0;
520 QString path = QPEApplication::qpeDir() + "/plugins/decorations"; 522 QString path = QPEApplication::qpeDir() + "/plugins/decorations";
521 QLibrary *lib = new QLibrary( path + "/" + plugin ); 523 QLibrary *lib = new QLibrary( path + "/" + plugin );
522 if ( lib->queryInterface( IID_WindowDecoration, (QUnknownInterface**)&iface ) == QS_OK && iface ) { 524 if ( lib->queryInterface( IID_WindowDecoration, (QUnknownInterface**)&iface ) == QS_OK && iface ) {
523 wdiface = iface; 525 wdiface = iface;
524 wdlib = lib; 526 wdlib = lib;
525 } else { 527 } else {
526 delete lib; 528 delete lib;
527 wdiface = new DefaultWindowDecoration; 529 wdiface = new DefaultWindowDecoration;
528 } 530 }
529 531
530 helpFile = QString(qApp->argv()[0]) + ".html"; 532 helpFile = QString(qApp->argv()[0]) + ".html";
531 QStringList helpPath = Global::helpPath(); 533 QStringList helpPath = Global::helpPath();
532 helpExists = FALSE; 534 helpExists = FALSE;
533 for (QStringList::ConstIterator it=helpPath.begin(); it!=helpPath.end() && !helpExists; ++it) 535 for (QStringList::ConstIterator it=helpPath.begin(); it!=helpPath.end() && !helpExists; ++it) {
534 helpExists = QFile::exists( *it + "/" + helpFile ); 536 helpExists = QFile::exists( *it + "/" + helpFile );
537 qDebug ( "Checking %s/%s for help: %d", (*it).latin1(), helpFile.latin1(),helpExists); }
535 qpeManager = new QPEManager( this ); 538 qpeManager = new QPEManager( this );
536} 539}
537 540
538QPEDecoration::~QPEDecoration() 541QPEDecoration::~QPEDecoration()
539{ 542{
540 delete qpeManager; 543 delete qpeManager;
541} 544}
542 545
543const char **QPEDecoration::menuPixmap() 546const char **QPEDecoration::menuPixmap()
544{ 547{
545 return (const char **)0; 548 return (const char **)0;
546} 549}
547 550
548const char **QPEDecoration::closePixmap() 551const char **QPEDecoration::closePixmap()
549{ 552{
550 return (const char **)qpe_close_xpm; 553 return (const char **)qpe_close_xpm;
551} 554}
552 555
553const char **QPEDecoration::minimizePixmap() 556const char **QPEDecoration::minimizePixmap()
554{ 557{
555 return (const char **)qpe_accept_xpm; 558 return (const char **)qpe_accept_xpm;
556} 559}
557 560
558const char **QPEDecoration::maximizePixmap() 561const char **QPEDecoration::maximizePixmap()
559{ 562{
560 return (const char **)0; 563 return (const char **)0;
561} 564}
562 565
563const char **QPEDecoration::normalizePixmap() 566const char **QPEDecoration::normalizePixmap()
564{ 567{
565 return (const char **)0; 568 return (const char **)0;
566} 569}
567 570
568int QPEDecoration::getTitleHeight( const QWidget *w ) 571int QPEDecoration::getTitleHeight( const QWidget *w )
569{ 572{
570 WindowDecorationInterface::WindowData wd; 573 WindowDecorationInterface::WindowData wd;
571 windowData( w, wd ); 574 windowData( w, wd );
572 return wdiface->metric(WindowDecorationInterface::TitleHeight,&wd); 575 return wdiface->metric(WindowDecorationInterface::TitleHeight,&wd);
573} 576}
574 577
575/* 578/*
576 If rect is empty, no frame is added. (a hack, really) 579 If rect is empty, no frame is added. (a hack, really)
577*/ 580*/
578QRegion QPEDecoration::region(const QWidget *widget, const QRect &rect, QWSDecoration::Region type) 581QRegion QPEDecoration::region(const QWidget *widget, const QRect &rect, QWSDecoration::Region type)
579{ 582{
580 qpeManager->updateActive(); 583 qpeManager->updateActive();
581 584
582 WindowDecorationInterface::WindowData wd; 585 WindowDecorationInterface::WindowData wd;
583 windowData( widget, wd ); 586 windowData( widget, wd );
584 wd.rect = rect; 587 wd.rect = rect;
585 588
586 int titleHeight = wdiface->metric(WindowDecorationInterface::TitleHeight,&wd); 589 int titleHeight = wdiface->metric(WindowDecorationInterface::TitleHeight,&wd);
587 int okWidth = wdiface->metric(WindowDecorationInterface::OKWidth,&wd); 590 int okWidth = wdiface->metric(WindowDecorationInterface::OKWidth,&wd);
588 int closeWidth = wdiface->metric(WindowDecorationInterface::CloseWidth,&wd); 591 int closeWidth = wdiface->metric(WindowDecorationInterface::CloseWidth,&wd);
589 int helpWidth = wdiface->metric(WindowDecorationInterface::HelpWidth,&wd); 592 int helpWidth = wdiface->metric(WindowDecorationInterface::HelpWidth,&wd);
590 int grab = wdiface->metric(WindowDecorationInterface::CornerGrabSize,&wd); 593 int grab = wdiface->metric(WindowDecorationInterface::CornerGrabSize,&wd);
591 594
592 QRegion region; 595 QRegion region;
593 596
594 switch ((int)type) { 597 switch ((int)type) {
595 case Menu: 598 case Menu:
596 break; 599 break;
597 case Maximize: 600 case Maximize:
598 if ( !widget->inherits( "QDialog" ) && qApp->desktop()->width() > 350 ) { 601 if ( !widget->inherits( "QDialog" ) && qApp->desktop()->width() > 350 ) {
599 int maximizeWidth = wdiface->metric(WindowDecorationInterface::MaximizeWidth,&wd); 602 int maximizeWidth = wdiface->metric(WindowDecorationInterface::MaximizeWidth,&wd);
600 int left = rect.right() - maximizeWidth - closeWidth; 603 int left = rect.right() - maximizeWidth - closeWidth;
601 if ( ((HackWidget *)widget)->needsOk() ) 604 if ( ((HackWidget *)widget)->needsOk() )
602 left -= okWidth; 605 left -= okWidth;
603 QRect r(left, rect.top() - titleHeight, closeWidth, titleHeight); 606 QRect r(left, rect.top() - titleHeight, closeWidth, titleHeight);
604 region = r; 607 region = r;
605 } 608 }
606 break; 609 break;
607 case Minimize: 610 case Minimize:
608 if ( ((HackWidget *)widget)->needsOk() ) { 611 if ( ((HackWidget *)widget)->needsOk() ) {
609 QRect r(rect.right() - okWidth, 612 QRect r(rect.right() - okWidth,
610 rect.top() - titleHeight, okWidth, titleHeight); 613 rect.top() - titleHeight, okWidth, titleHeight);
611 if (r.left() > rect.left() + titleHeight) 614 if (r.left() > rect.left() + titleHeight)
612 region = r; 615 region = r;
613 } 616 }
614 break; 617 break;
615 case Close: 618 case Close:
616 { 619 {
617 int left = rect.right() - closeWidth; 620 int left = rect.right() - closeWidth;
618 if ( ((HackWidget *)widget)->needsOk() ) 621 if ( ((HackWidget *)widget)->needsOk() )
619 left -= okWidth; 622 left -= okWidth;
620 QRect r(left, rect.top() - titleHeight, closeWidth, titleHeight); 623 QRect r(left, rect.top() - titleHeight, closeWidth, titleHeight);
621 region = r; 624 region = r;
622 } 625 }
623 break; 626 break;
624 case Title: 627 case Title:
625 if ( !widget->isMaximized() ) { 628 if ( !widget->isMaximized() ) {
626 int width = rect.width() - helpWidth - closeWidth; 629 int width = rect.width() - helpWidth - closeWidth;
627 if ( ((HackWidget *)widget)->needsOk() ) 630 if ( ((HackWidget *)widget)->needsOk() )
628 width -= okWidth; 631 width -= okWidth;
629 QRect r(rect.left()+helpWidth, rect.top() - titleHeight, 632 QRect r(rect.left()+helpWidth, rect.top() - titleHeight,
630 width, titleHeight); 633 width, titleHeight);
diff --git a/library/task-opie-applets.control b/library/task-opie-applets.control
index f0e7780..11e2eae 100644
--- a/library/task-opie-applets.control
+++ b/library/task-opie-applets.control
@@ -1,9 +1,9 @@
1Files: 1Files:
2Priority: optional 2Priority: optional
3Section: opie/applications 3Section: opie/applications
4Maintainer: Maximilian Reiss <max.reiss@gmx.de> 4Maintainer: Maximilian Reiss <max.reiss@gmx.de>
5Architecture: arm 5Architecture: arm
6Version: $QPE_VERSION-$SUB_VERSION 6Version: $QPE_VERSION-$SUB_VERSION
7Depends: opie-batteryapplet, opie-clockapplet, opie-vmemo, opie-volumeapplet, opie-screenshotapplet, opie-netmonapplet, opie-pickboard, opie-keyboard, opie-jumpx, opie-handwriting, opie-dvorak, opie-unikeyboard 7Depends: opie-batteryapplet, opie-clockapplet, opie-vmemo, opie-volumeapplet, opie-screenshotapplet, opie-netmonapplet, opie-pickboard, opie-keyboard, opie-jumpx, opie-handwriting, opie-dvorak, opie-unikeyboard
8Description: Opie taskbar applets 8Description: Opie taskbar applets
9 All applets for the taskbar \ No newline at end of file 9 All applets for the taskbar
diff --git a/library/task-opie-complete.control b/library/task-opie-complete.control
index 226a278..6dafc0c 100644
--- a/library/task-opie-complete.control
+++ b/library/task-opie-complete.control
@@ -1,9 +1,9 @@
1Files: 1Files:
2Priority: optional 2Priority: optional
3Section: opie/applications 3Section: opie/applications
4Maintainer: Maximilian Reiss <max.reiss@gmx.de> 4Maintainer: Maximilian Reiss <max.reiss@gmx.de>
5Architecture: arm 5Architecture: arm
6Version: $QPE_VERSION-$SUB_VERSION 6Version: $QPE_VERSION-$SUB_VERSION
7Depends: task-opie, task-opie-apps, task-opie-settings, task-opie-games, task-opie-applets 7Depends: task-opie, task-opie-apps, task-opie-settings, task-opie-games, task-opie-applets
8Description: All off Opie 8Description: All off Opie
9 All apps that are in the feed. \ No newline at end of file 9 All apps that are in the feed.
diff --git a/library/task-opie-games.control b/library/task-opie-games.control
index 014a56d..9695a40 100644
--- a/library/task-opie-games.control
+++ b/library/task-opie-games.control
@@ -1,9 +1,9 @@
1Files: 1Files:
2Priority: optional 2Priority: optional
3Section: opie/games 3Section: opie/games
4Maintainer: Maximilian Reiss <max.reiss@gmx.de> 4Maintainer: Maximilian Reiss <max.reiss@gmx.de>
5Architecture: arm 5Architecture: arm
6Version: $QPE_VERSION-$SUB_VERSION 6Version: $QPE_VERSION-$SUB_VERSION
7Depends: opie-fifteen, opie-go, opie-kbill, opie-kcheckers, opie-kpacman, opie-minesweep, opie-parashoot, opie-qasteroids, opie-snake, opie-solitaire, opie-tetrix, opie-tictac, opie-wordgame 7Depends: opie-fifteen, opie-go, opie-kbill, opie-kcheckers, opie-kpacman, opie-minesweep, opie-parashoot, opie-qasteroids, opie-snake, opie-solitaire, opie-tetrix, opie-tictac, opie-wordgame
8Description: Opie game pack 8Description: Opie game pack
9 The full load of Opie games. \ No newline at end of file 9 The full load of Opie games.
diff --git a/library/task-opie-pim.control b/library/task-opie-pim.control
index e971780..6df8c22 100644
--- a/library/task-opie-pim.control
+++ b/library/task-opie-pim.control
@@ -1,9 +1,9 @@
1Files: 1Files:
2Priority: optional 2Priority: optional
3Section: opie/applications 3Section: opie/applications
4Maintainer: Maximilian Reiss <max.reiss@gmx.de> 4Maintainer: Maximilian Reiss <max.reiss@gmx.de>
5Architecture: arm 5Architecture: arm
6Version: $QPE_VERSION-$SUB_VERSION 6Version: $QPE_VERSION-$SUB_VERSION
7Depends: opie-datebook, opie-todo, opie-addressbook, task-opie-today, opie-drawpad, opie-keyboard 7Depends: opie-datebook, opie-todo, opie-addressbook, task-opie-today, opie-drawpad, opie-keyboard
8Description: Opie pim applications 8Description: Opie pim applications
9 Base pack of opie pim applications. Also includes keyboard input. \ No newline at end of file 9 Base pack of opie pim applications. Also includes keyboard input.
diff --git a/library/task-opie-settings.control b/library/task-opie-settings.control
index 2fbb4e8..0b572b0 100644
--- a/library/task-opie-settings.control
+++ b/library/task-opie-settings.control
@@ -1,9 +1,9 @@
1Files: 1Files:
2Priority: optional 2Priority: optional
3Section: opie/applications 3Section: opie/applications
4Maintainer: Maximilian Reiss <max.reiss@gmx.de> 4Maintainer: Maximilian Reiss <max.reiss@gmx.de>
5Architecture: arm 5Architecture: arm
6Version: $QPE_VERSION-$SUB_VERSION 6Version: $QPE_VERSION-$SUB_VERSION
7Depends: opie-appearance, opie-security, opie-systemtime, opie-light-and-power, opie-rotation, opie-tabmanager, opie-wlansetup 7Depends: opie-appearance, opie-security, opie-systemtime, opie-light-and-power, opie-rotation, opie-tabmanager, opie-wlansetup
8Description: Opie settings app 8Description: Opie settings app
9 All settings apps \ No newline at end of file 9 All settings apps