*** empty log message ***
[enigma2.git] / main / enigma.cpp
index f7cf44e052b0dd2e196e9215d8c464b02aadf2e9..cc9781cc4b32c3e6d83ec7b2fc64bd3cf789bbe3 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <lib/actions/action.h>
 #include <lib/driver/rc.h>
+#include <lib/base/ioprio.h>
 #include <lib/base/ebase.h>
 #include <lib/base/eerror.h>
 #include <lib/base/init.h>
@@ -46,20 +47,26 @@ void object_dump()
 
 static eWidgetDesktop *wdsk, *lcddsk;
 
-PSignal1<void,int> keyPressed;
+static int prev_ascii_code;
 
-PSignal1<void,int> &keyPressedSignal()
+int getPrevAsciiCode()
 {
-       return keyPressed;
+       int ret = prev_ascii_code;
+       prev_ascii_code = 0;
+       return ret;
 }
 
 void keyEvent(const eRCKey &key)
 {
        ePtr<eActionMap> ptr;
        eActionMap::getInstance(ptr);
-       ptr->keyPressed(0, key.code, key.flags);
-//     if (!key.flags)
-//             keyPressed(key.code);
+       if (key.flags & eRCKey::flagAscii)
+       {
+               prev_ascii_code = key.code;
+               ptr->keyPressed(key.producer->getIdentifier(), 510 /* faked KEY_ASCII */, 0);
+       }
+       else
+               ptr->keyPressed(key.producer->getIdentifier(), key.code, key.flags);
 }
 
 /************************************************/
@@ -105,6 +112,10 @@ int exit_code;
 
 int main(int argc, char **argv)
 {
+#ifdef MEMLEAK_CHECK
+       atexit(DumpUnfreed);
+#endif
+
 #ifdef OBJECT_DEBUG
        atexit(object_dump);
 #endif
@@ -136,10 +147,8 @@ int main(int argc, char **argv)
        ePtr<gLCDDC> my_lcd_dc;
        gLCDDC::getInstance(my_lcd_dc);
 
-       fontRenderClass::getInstance()->AddFont(FONTDIR "/md_khmurabi_10.ttf", "Regular", 100);
-       fontRenderClass::getInstance()->AddFont(FONTDIR "/ae_AlMateen.ttf", "Replacement", 90);
-       eTextPara::setReplacementFont("Replacement");
-       
+
+               /* ok, this is currently hardcoded for arabic. */
                        /* some characters are wrong in the regular font, force them to use the replacement font */
        for (int i = 0x60c; i <= 0x66d; ++i)
                eTextPara::forceReplacementGlyph(i);
@@ -151,6 +160,9 @@ int main(int argc, char **argv)
        eWidgetDesktop dsk(eSize(720, 576));
        eWidgetDesktop dsk_lcd(eSize(132, 64));
        
+       dsk.setStyleID(0);
+       dsk_lcd.setStyleID(1);
+       
 /*     if (double_buffer)
        {
                eDebug(" - double buffering found, enable buffered graphics mode.");
@@ -183,7 +195,9 @@ int main(int argc, char **argv)
        printf("executing main\n");
        
        bsodCatchSignals();
-       
+
+       setIoPrio(IOPRIO_CLASS_BE, 3);
+
        python.execute("mytest", "__main__");
        
        if (exit_code == 5) /* python crash */