567 void HbMainWindowPrivate::addViewEffects() |
567 void HbMainWindowPrivate::addViewEffects() |
568 { |
568 { |
569 // Register the view switch animations from the theme. |
569 // Register the view switch animations from the theme. |
570 // Use HbEffectInternal and the HB_ prefix to prevent general overriding of these effects. |
570 // Use HbEffectInternal and the HB_ prefix to prevent general overriding of these effects. |
571 // Instead, view switch effects can be overridden on a per-instance basis. |
571 // Instead, view switch effects can be overridden on a per-instance basis. |
572 bool ok = HbEffectInternal::add( |
572 const char *vsType[] = { "HB_view", "HB_view", "HB_view", "HB_view" }; |
573 QStringList() << "HB_view" << "HB_view" << "HB_view" << "HB_view", |
573 const char *vsPath[] = { "view_show_normal", "view_hide_normal", "view_show_back", "view_hide_back" }; |
574 QStringList() << "view_show_normal" << "view_hide_normal" << "view_show_back" << "view_hide_back", |
574 const char *vsEvent[] = { "show", "hide", "show_back", "hide_back" }; |
575 QStringList() << "show" << "hide" << "show_back" << "hide_back"); |
575 bool ok = HbEffectInternal::add(vsType, vsPath, vsEvent, 4); |
576 if (!ok) { |
576 if (!ok) { |
577 hbWarning("HbMainWindow: addViewEffects: atomic registration for show/hide effects failed"); |
577 hbWarning("HbMainWindow: addViewEffects: atomic registration for show/hide effects failed"); |
578 } |
578 } |
579 |
579 |
580 // Register the alternative default. |
580 // Register the alternative default. |
581 ok = HbEffectInternal::add( |
581 const char *vsAltPath[] = { "view_show_normal_alt", "view_hide_normal_alt", "view_show_back_alt", "view_hide_back_alt" }; |
582 QStringList() << "HB_view" << "HB_view" << "HB_view" << "HB_view", |
582 const char *vsAltEvent[] = { "show_alt", "hide_alt", "show_alt_back", "hide_alt_back" }; |
583 QStringList() << "view_show_normal_alt" << "view_hide_normal_alt" << "view_show_back_alt" << "view_hide_back_alt", |
583 ok = HbEffectInternal::add(vsType, vsAltPath, vsAltEvent, 4); |
584 QStringList() << "show_alt" << "hide_alt" << "show_alt_back" << "hide_alt_back"); |
|
585 if (!ok) { |
584 if (!ok) { |
586 hbWarning("HbMainWindow: addViewEffects: atomic registration for alternative show/hide effects failed"); |
585 hbWarning("HbMainWindow: addViewEffects: atomic registration for alternative show/hide effects failed"); |
587 } |
586 } |
588 |
587 |
589 // Register titlebar effects. |
588 // Register titlebar effects. |
590 // These should be overridable in general (so we use HbEffect and no HB_ prefix). |
589 // These should be overridable in general (so we use HbEffect and no HB_ prefix). |
591 ok = HbEffect::add( |
590 const char *tbType[] = { "titlebar", "titlebar", "titlebar", "titlebar" }; |
592 QStringList() << "titlebar" << "titlebar" << "titlebar" << "titlebar", |
591 const char *tbPath[] = { "titlebar_disappear", "titlebar_appear", "titlebar_orient_disappear", "titlebar_orient_appear" }; |
593 QStringList() << "titlebar_disappear" << "titlebar_appear" << "titlebar_orient_disappear" << "titlebar_orient_appear", |
592 const char *tbEvent[] = { "disappear", "appear", "disappear_orient", "appear_orient" }; |
594 QStringList() << "disappear" << "appear" << "disappear_orient" << "appear_orient"); |
593 ok = HbEffectInternal::add(tbType, tbPath, tbEvent, 4); |
595 if (!ok) { |
594 if (!ok) { |
596 hbWarning("HbMainWindow: addViewEffects: atomic registration for titlebar effects failed"); |
595 hbWarning("HbMainWindow: addViewEffects: atomic registration for titlebar effects failed"); |
597 } |
596 } |
598 |
597 |
599 // Register statusbar effects. |
598 // Register statusbar effects. |
600 ok = HbEffect::add( |
599 const char *sbType[] = { "statusbar", "statusbar", "statusbar", "statusbar" }; |
601 QStringList() << "statusbar" << "statusbar" << "statusbar" << "statusbar", |
600 const char *sbPath[] = { "statusbar_disappear", "statusbar_appear", "statusbar_orient_disappear", "statusbar_orient_appear" }; |
602 QStringList() << "statusbar_disappear" << "statusbar_appear" << "statusbar_orient_disappear" << "statusbar_orient_appear", |
601 ok = HbEffectInternal::add(sbType, sbPath, tbEvent, 4); |
603 QStringList() << "disappear" << "appear" << "disappear_orient" << "appear_orient"); |
|
604 if (!ok) { |
602 if (!ok) { |
605 hbWarning("HbMainWindow: addViewEffects: atomic registration for statusbar effects failed"); |
603 hbWarning("HbMainWindow: addViewEffects: atomic registration for statusbar effects failed"); |
606 } |
604 } |
607 } |
605 } |
608 |
606 |