src/gui/kernel/qwidget_s60.cpp
branchRCL_3
changeset 4 3b1da2848fc7
parent 3 41300fa6a67c
child 7 3f74d0d4af4c
equal deleted inserted replaced
3:41300fa6a67c 4:3b1da2848fc7
     1 /****************************************************************************
     1 /****************************************************************************
     2 **
     2 **
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     4 ** All rights reserved.
     4 ** All rights reserved.
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     6 **
     6 **
     7 ** This file is part of the QtGui module of the Qt Toolkit.
     7 ** This file is part of the QtGui module of the Qt Toolkit.
     8 **
     8 **
   387                 | EPointerFilterMove | EPointerFilterDrag, 0);
   387                 | EPointerFilterMove | EPointerFilterDrag, 0);
   388             drawableWindow->EnableVisibilityChangeEvents();
   388             drawableWindow->EnableVisibilityChangeEvents();
   389 
   389 
   390             if (!isOpaque) {
   390             if (!isOpaque) {
   391                 RWindow *const window = static_cast<RWindow *>(drawableWindow);
   391                 RWindow *const window = static_cast<RWindow *>(drawableWindow);
       
   392 #ifdef Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE
       
   393                 window->SetSurfaceTransparency(true);
       
   394 #else
   392                 const TDisplayMode displayMode = static_cast<TDisplayMode>(window->SetRequiredDisplayMode(EColor16MA));
   395                 const TDisplayMode displayMode = static_cast<TDisplayMode>(window->SetRequiredDisplayMode(EColor16MA));
   393                 if (window->SetTransparencyAlphaChannel() == KErrNone)
   396                 if (window->SetTransparencyAlphaChannel() == KErrNone)
   394                     window->SetBackgroundColor(TRgb(255, 255, 255, 0));
   397                     window->SetBackgroundColor(TRgb(255, 255, 255, 0));
       
   398 #endif
   395             }
   399             }
   396         }
   400         }
   397 
   401 
   398         q->setAttribute(Qt::WA_WState_Created);
   402         q->setAttribute(Qt::WA_WState_Created);
   399 
   403 
   705     if ((data.window_flags & Qt::FramelessWindowHint) == 0)
   709     if ((data.window_flags & Qt::FramelessWindowHint) == 0)
   706         return;
   710         return;
   707 
   711 
   708     RWindow *const window = static_cast<RWindow *>(q->effectiveWinId()->DrawableWindow());
   712     RWindow *const window = static_cast<RWindow *>(q->effectiveWinId()->DrawableWindow());
   709 
   713 
       
   714 #ifdef Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE
       
   715     window->SetSurfaceTransparency(!isOpaque);
       
   716 #else
   710     if (!isOpaque) {
   717     if (!isOpaque) {
   711         const TDisplayMode displayMode = static_cast<TDisplayMode>(window->SetRequiredDisplayMode(EColor16MA));
   718         const TDisplayMode displayMode = static_cast<TDisplayMode>(window->SetRequiredDisplayMode(EColor16MA));
   712         if (window->SetTransparencyAlphaChannel() == KErrNone)
   719         if (window->SetTransparencyAlphaChannel() == KErrNone)
   713             window->SetBackgroundColor(TRgb(255, 255, 255, 0));
   720             window->SetBackgroundColor(TRgb(255, 255, 255, 0));
   714     } else
   721     } else
   715         window->SetTransparentRegion(TRegionFix<1>());
   722         window->SetTransparentRegion(TRegionFix<1>());
       
   723 #endif
   716 }
   724 }
   717 
   725 
   718 void QWidgetPrivate::setWindowIcon_sys(bool forceReset)
   726 void QWidgetPrivate::setWindowIcon_sys(bool forceReset)
   719 {
   727 {
   720 #ifdef Q_WS_S60
   728 #ifdef Q_WS_S60
   879 void QWidgetPrivate::createSysExtra()
   887 void QWidgetPrivate::createSysExtra()
   880 {
   888 {
   881     extra->activated = 0;
   889     extra->activated = 0;
   882     extra->nativePaintMode = QWExtra::Default;
   890     extra->nativePaintMode = QWExtra::Default;
   883     extra->receiveNativePaintEvents = 0;
   891     extra->receiveNativePaintEvents = 0;
       
   892     extra->inExpose = 0;
   884 }
   893 }
   885 
   894 
   886 void QWidgetPrivate::deleteSysExtra()
   895 void QWidgetPrivate::deleteSysExtra()
   887 {
   896 {
   888     // this should only be non-zero if destroy() has not run due to constructor fail
   897     // this should only be non-zero if destroy() has not run due to constructor fail
  1156 
  1165 
  1157 #ifndef QT_NO_IM
  1166 #ifndef QT_NO_IM
  1158         if (d->ic) {
  1167         if (d->ic) {
  1159             delete d->ic;
  1168             delete d->ic;
  1160         } else {
  1169         } else {
  1161             QInputContext *ic = inputContext();
  1170             QInputContext *ic = QApplicationPrivate::inputContext;
  1162             if (ic) {
  1171             if (ic) {
  1163                 ic->widgetDestroyed(this);
  1172                 ic->widgetDestroyed(this);
  1164             }
  1173             }
  1165         }
  1174         }
  1166 #endif
  1175 #endif