132 NONSHARABLE_CLASS(CMIDCanvas) : |
132 NONSHARABLE_CLASS(CMIDCanvas) : |
133 public CCoeControl, |
133 public CCoeControl, |
134 public MMIDCanvas, |
134 public MMIDCanvas, |
135 public MMIDBufferProcessor, |
135 public MMIDBufferProcessor, |
136 public MDirectContainer, |
136 public MDirectContainer, |
|
137 public MMIDLcduiEventConsumer, |
137 #ifdef CANVAS_DIRECT_ACCESS |
138 #ifdef CANVAS_DIRECT_ACCESS |
138 public MDirectScreenAccess, |
139 public MDirectScreenAccess, |
139 #endif |
140 #endif |
140 public MMIDMediaKeysListener, |
141 public MMIDMediaKeysListener, |
141 #ifdef RD_TACTILE_FEEDBACK |
142 #ifdef RD_TACTILE_FEEDBACK |
581 * @since S60 v9.2 |
582 * @since S60 v9.2 |
582 */ |
583 */ |
583 void MdcNotifyContentAdded(); |
584 void MdcNotifyContentAdded(); |
584 #endif |
585 #endif |
585 |
586 |
|
587 /** |
|
588 * From MDirectContainer. |
|
589 * |
|
590 * @since S60 v9.2 |
|
591 * @param TBool aEnableFix |
|
592 */ |
|
593 void MdcFixUIOrientation(TBool aEnableFix); |
|
594 |
|
595 // From MMIDLcduiEventConsumer |
|
596 public: |
|
597 void HandleLcduiEvent(int aType); |
586 |
598 |
587 // from base class MMIDMediaKeysListener |
599 // from base class MMIDMediaKeysListener |
588 |
600 |
589 /** |
601 /** |
590 * From MMIDMediaKeysListener. |
602 * From MMIDMediaKeysListener. |
706 * @return <code>ETrue</code> if this component container is set to full screen |
718 * @return <code>ETrue</code> if this component container is set to full screen |
707 * and <code>EFalse</code> if not. |
719 * and <code>EFalse</code> if not. |
708 * @since S60 5.0 |
720 * @since S60 5.0 |
709 */ |
721 */ |
710 TBool IsFullScreen() const; |
722 TBool IsFullScreen() const; |
|
723 |
|
724 /** |
|
725 * Returns the drawing rectangle. |
|
726 * |
|
727 * @since java 2.1 |
|
728 * @return The rectangle where canvas draws. |
|
729 */ |
|
730 inline const TRect ViewRect() const; |
711 |
731 |
712 #ifdef RD_JAVA_S60_RELEASE_9_2 |
732 #ifdef RD_JAVA_S60_RELEASE_9_2 |
713 /** |
733 /** |
714 * Gets a Displayable from the container. |
734 * Gets a Displayable from the container. |
715 * |
735 * |
1048 * @since S60 3.2 |
1068 * @since S60 3.2 |
1049 * @return ETrue, if network indicator is shown in Canvas, otherwise |
1069 * @return ETrue, if network indicator is shown in Canvas, otherwise |
1050 * returns EFalse. |
1070 * returns EFalse. |
1051 */ |
1071 */ |
1052 TBool IsNetworkIndicatorEnabledL() const; |
1072 TBool IsNetworkIndicatorEnabledL() const; |
1053 |
1073 #ifdef RD_JAVA_NGA_ENABLED |
|
1074 TBool IsDownScaling(const TSize& aSourceSize, const TRect& aDestRect,TBool aM3GContent) const; |
|
1075 #else |
|
1076 TBool IsDownScaling(const TSize& aSourceSize, const TRect& aDestRect) const; |
|
1077 #endif //RD_JAVA_NGA_ENABLED |
1054 public: |
1078 public: |
1055 /** |
1079 /** |
1056 * Handles switching from foreground to |
1080 * Handles switching from foreground to |
1057 * background and vice versa. Mainly rendering |
1081 * background and vice versa. Mainly rendering |
1058 * context and surfaces need to be relased. |
1082 * context and surfaces need to be relased. |
1059 */ |
1083 */ |
1060 void HandleForeground(TBool aForeground); |
1084 void HandleForeground(TBool aForeground); |
|
1085 |
|
1086 #ifdef RD_JAVA_NGA_ENABLED |
|
1087 /** |
|
1088 * Motification about MIDlet's changed full or partial foreground status. |
|
1089 * @param aFullOrPartialFg ETrue, when full or partial foreground was gained. |
|
1090 * EFalse, when foreground was fully lost. |
|
1091 * @param aCurrentDisplayable ETrue, if canvas is the current displayable |
|
1092 */ |
|
1093 void HandleFullOrPartialForegroundL(TBool aFullOrPartialFg, TBool aCurrentDisplayable); |
|
1094 |
|
1095 /** |
|
1096 * Frees all GPU memory that is reserved by Canvas. |
|
1097 * @param aForced If ETrue, memory is freed without checking window visibility |
|
1098 * If EFalse, memory is freed if canvas window is invisible. |
|
1099 */ |
|
1100 void FreeGraphicsMemory(TBool aForced); |
|
1101 #endif |
1061 |
1102 |
1062 private: |
1103 private: |
1063 /** States of the first paint */ |
1104 /** States of the first paint */ |
1064 enum TFirstPainState { |
1105 enum TFirstPainState { |
1065 EFirstPaintNeverOccurred = 0, |
1106 EFirstPaintNeverOccurred = 0, |
1241 TSize GetEglSurfaceSize(EGLSurface aSurface = EGL_NO_SURFACE); |
1288 TSize GetEglSurfaceSize(EGLSurface aSurface = EGL_NO_SURFACE); |
1242 |
1289 |
1243 /** |
1290 /** |
1244 * Handles size changed. EGL window surface needs to be recreated |
1291 * Handles size changed. EGL window surface needs to be recreated |
1245 * if window size increases. |
1292 * if window size increases. |
1246 * @since S60 9.2 |
1293 * @param aOrientationChange ETrue, method is called because of orientation change |
1247 */ |
1294 * @since S60 9.2 |
1248 void HandleSizeChanged(); |
1295 */ |
|
1296 void HandleSizeChanged(TBool aOrientationChange); |
1249 |
1297 |
1250 /** |
1298 /** |
1251 * Draws frame buffer 2D content as OpenGL texture in case of |
1299 * Draws frame buffer 2D content as OpenGL texture in case of |
1252 * M3G + 2D mixing. |
1300 * M3G + 2D mixing. |
1253 * @since S60 9.2 |
1301 * @since S60 9.2 |
1331 * Clears UI surface to transparent color |
1379 * Clears UI surface to transparent color |
1332 * @since S60 9.2 |
1380 * @since S60 9.2 |
1333 */ |
1381 */ |
1334 void ClearUiSurface(TBool aDrawing); |
1382 void ClearUiSurface(TBool aDrawing); |
1335 |
1383 |
|
1384 /** |
|
1385 * Draws current canvas content to CWindowGc. |
|
1386 * @since S60 9.2 |
|
1387 */ |
|
1388 void DrawToWindowGc(); |
|
1389 |
|
1390 /** |
|
1391 * Checks if canvas window is currently really visible on screen. |
|
1392 * Used for checking when canvas should destroy its surfaces. |
|
1393 * @since S60 9.2 |
|
1394 */ |
|
1395 TBool IsWindowVisible() const; |
|
1396 |
|
1397 /** |
|
1398 * Posts forced paint event to Java side. Forced paint causes Canvas.paint() to be |
|
1399 * called, event if Displayable.isShown() would return false in Java. See also Canvas.java. |
|
1400 * @since S60 9.2 |
|
1401 */ |
|
1402 void PostForcedPaint(); |
1336 #endif // RD_JAVA_NGA_ENABLED |
1403 #endif // RD_JAVA_NGA_ENABLED |
1337 |
1404 |
1338 private: // data |
1405 private: // data |
1339 |
1406 |
1340 /** CMIDCanvas flags datatype */ |
1407 /** CMIDCanvas flags datatype */ |
1559 * Stores old bounds of the direct content |
1626 * Stores old bounds of the direct content |
1560 * used before SizeChanged is called |
1627 * used before SizeChanged is called |
1561 */ |
1628 */ |
1562 TRect iOldContentBounds; |
1629 TRect iOldContentBounds; |
1563 |
1630 |
1564 /** |
|
1565 * The startup trace should be done only once. |
|
1566 */ |
|
1567 mutable TBool iStartUpTraceDone; |
|
1568 |
|
1569 // The list of registered custom components. |
1631 // The list of registered custom components. |
1570 RPointerArray< MMIDCustomComponent > iCustomComponents; |
1632 RPointerArray< MMIDCustomComponent > iCustomComponents; |
1571 |
1633 |
1572 // The count of custom components. |
1634 // The count of custom components. |
1573 TInt iCustomComponentsControlCount; |
1635 TInt iCustomComponentsControlCount; |
1701 * OpenGL coordinate arrays used fo r rendering filled rectangles |
1767 * OpenGL coordinate arrays used fo r rendering filled rectangles |
1702 */ |
1768 */ |
1703 GLshort* iVertexArray; |
1769 GLshort* iVertexArray; |
1704 GLubyte* iTriangleStrip; |
1770 GLubyte* iTriangleStrip; |
1705 |
1771 |
|
1772 /** |
|
1773 * ETrue, when midlet is exiting and this canvas is the current displayable |
|
1774 */ |
|
1775 TBool iExiting; |
1706 #endif // RD_JAVA_NGA_ENABLED |
1776 #endif // RD_JAVA_NGA_ENABLED |
1707 |
1777 |
1708 /** |
1778 /** |
1709 * If dragging was started (by pointer down) inside the canvas, |
1779 * If dragging was started (by pointer down) inside the canvas, |
1710 * all drag events and release event should go to canvas |
1780 * all drag events and release event should go to canvas |
1735 *aDst++ = (argb >> 8) & 0xFFu; |
1805 *aDst++ = (argb >> 8) & 0xFFu; |
1736 *aDst++ = argb & 0xFFu; |
1806 *aDst++ = argb & 0xFFu; |
1737 *aDst++ = (argb >> 24) & 0xFFu; |
1807 *aDst++ = (argb >> 24) & 0xFFu; |
1738 } |
1808 } |
1739 } |
1809 } |
|
1810 |
|
1811 inline const TRect CMIDCanvas::ViewRect() const |
|
1812 { |
|
1813 return iViewRect; |
|
1814 } |
1740 #endif // RD_JAVA_NGA_ENABLED |
1815 #endif // RD_JAVA_NGA_ENABLED |
1741 |
1816 |
1742 #endif // CMIDCANVAS_H |
1817 #endif // CMIDCANVAS_H |