javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/Toolkit.java
branchRCL_3
changeset 60 6c158198356e
parent 59 e5618cc85d74
--- a/javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/Toolkit.java	Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/Toolkit.java	Thu Aug 19 09:48:13 2010 +0300
@@ -131,6 +131,9 @@
 
     static final int EVET_CANVAS_GRAPHICS_ITEM_REPAINT = 31;
     static final int EVENT_M3G_DRAW = 32 ;
+    static final int EVENT_FORCED_PAINT = 33;
+    static final int EVENT_FREE_GPU_MEMORY = 34;
+
     // IMPLICIT EVENT TYPES
     static final int EVENT_DISMISS = 0;         // ALERT
     static final int EVENT_ITEM_CHANGED = 0;    // ITEM(S)
@@ -261,7 +264,7 @@
 
     InputStream getResourceAsStream(String aResource)
     throws
-                IOException
+        IOException
     {
         return getClass().getResourceAsStream(aResource);
     }
@@ -554,11 +557,10 @@
                     break;
                 case EVENT_FOREGROUND:
                     iDisplay.handleForeground(true);
-                    notifyForeground(true);
                     break;
                 case EVENT_BACKGROUND:
                     iDisplay.handleForeground(false);
-                    notifyForeground(false);
+                    notifyFreeGraphicsMemory();
                     break;
                 case EVENT_SET_CURRENT:
                     iDisplay.switchCurrent();
@@ -566,6 +568,9 @@
                 case EVENT_SERIAL:
                     iDisplay.processSerialEvents();
                     break;
+                case EVENT_FREE_GPU_MEMORY:
+                    notifyFreeGraphicsMemory();
+                    break;
                 default:
                     throw new IllegalArgumentException();
                 }
@@ -573,7 +578,7 @@
         }
     }
 
-    private synchronized void notifyForeground(boolean foreground)
+    private synchronized void notifyFreeGraphicsMemory()
     {
         if (null != iObservers)
         {
@@ -584,7 +589,7 @@
                 {
                     final ToolkitObserverNGAExtension observer =
                         (ToolkitObserverNGAExtension)iObservers.elementAt(ii);
-                    observer.foregroundEvent(foreground);
+                    observer.freeGraphicsMemory();
                 }
             }
         }