[Libreoffice-commits] .: Branch 'feature/android' - vcl/android vcl/inc

2012-02-03 Thread Michael Meeks
 vcl/android/androidinst.cxx   |7 +--
 vcl/inc/generic/geninst.h |6 +++---
 vcl/inc/headless/svpframe.hxx |3 +++
 3 files changed, 7 insertions(+), 9 deletions(-)

New commits:
commit 29aa585b2ee2af0680eb39749d1797f52e190a3a
Author: Michael Meeks michael.me...@suse.com
Date:   Fri Feb 3 18:49:59 2012 +0100

android: get the focus window from SvpSalFrame

diff --git a/vcl/android/androidinst.cxx b/vcl/android/androidinst.cxx
index 6d70471..50a3040 100644
--- a/vcl/android/androidinst.cxx
+++ b/vcl/android/androidinst.cxx
@@ -321,11 +321,6 @@ void AndroidSalInstance::RedrawWindows(ANativeWindow 
*pWindow)
 mbQueueReDraw = false;
 }
 
-SalFrame *AndroidSalInstance::getFocusFrame() const
-{
-return !getFrames().empty() ? *getFrames().begin() : NULL;
-}
-
 static const char *app_cmd_name(int cmd)
 {
 switch (cmd) {
@@ -436,7 +431,7 @@ int32_t AndroidSalInstance::onInputEvent (struct 
android_app* app, AInputEvent*
 aEvent.mnCharCode = 'a'; // the unicode of it all ...
 aEvent.mnRepeat = AKeyEvent_getRepeatCount(event);
 
-SalFrame *pFocus = getFocusFrame();
+SalFrame *pFocus = SvpSalFrame::GetFocusFrame();
 if (pFocus)
 bHandled = pFocus-CallCallback( nEvent, aEvent );
 else
diff --git a/vcl/inc/generic/geninst.h b/vcl/inc/generic/geninst.h
index 471b630..240ebe6 100644
--- a/vcl/inc/generic/geninst.h
+++ b/vcl/inc/generic/geninst.h
@@ -103,7 +103,7 @@ public:
 virtual voidGetPrinterQueueInfo( ImplPrnQueueList* 
pList );
 virtual voidGetPrinterQueueState   ( SalPrinterQueueInfo* 
pInfo );
 virtual voidDeletePrinterQueueInfo ( SalPrinterQueueInfo* 
pInfo );
-virtual rtl::OUString  GetDefaultPrinter();
+virtual rtl::OUString   GetDefaultPrinter();
 virtual voidPostPrintersChanged() = 0;
 virtual voidupdatePrinterUpdate();
 virtual voidjobStartedPrinterUpdate();
@@ -117,8 +117,8 @@ public:
 
 protected:
 void configurePspInfoPrinter( PspSalInfoPrinter* pInfoPrinter,
-   SalPrinterQueueInfo* pQueueInfo,
-   ImplJobSetup* pSetupData );
+  SalPrinterQueueInfo* pQueueInfo,
+  ImplJobSetup* pSetupData );
 };
 
 inline SalGenericInstance *GetGenericInstance()
diff --git a/vcl/inc/headless/svpframe.hxx b/vcl/inc/headless/svpframe.hxx
index fc923af..8c30e23 100644
--- a/vcl/inc/headless/svpframe.hxx
+++ b/vcl/inc/headless/svpframe.hxx
@@ -127,6 +127,9 @@ public:
 virtual voidSetScreenNumber( unsigned int nScreen ) { 
(void)nScreen; }
 virtual voidSetApplicationID(const rtl::OUString 
rApplicationID) { (void) rApplicationID; }
 bool IsVisible() { return m_bVisible; }
+
+static SvpSalFrame* GetFocusFrame() { return s_pFocusFrame; }
+
 };
 #endif // _SVP_SVPFRAME_HXX
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'feature/android' - vcl/android vcl/inc

2012-02-03 Thread Michael Meeks
 vcl/android/androidinst.cxx |   72 
 vcl/inc/android/androidinst.hxx |6 +++
 2 files changed, 78 insertions(+)

New commits:
commit 5cd1d6740cc9e85b5ed3730800dff4717cb7e1ae
Author: Michael Meeks michael.me...@suse.com
Date:   Fri Feb 3 22:02:01 2012 +0100

android: implement theming to get default font set, 1st cut at GetWorkArea

diff --git a/vcl/android/androidinst.cxx b/vcl/android/androidinst.cxx
index ec38cec..16a5125 100644
--- a/vcl/android/androidinst.cxx
+++ b/vcl/android/androidinst.cxx
@@ -347,6 +347,18 @@ static const char *app_cmd_name(int cmd)
 }
 }
 
+void AndroidSalInstance::GetWorkArea( Rectangle rRect )
+{
+ANativeWindow *pWindow = mpApp-window;
+if (!pWindow)
+rRect = Rectangle( Point( 0, 0 ),
+   Size( 800, 600 ) );
+else
+rRect = Rectangle( Point( 0, 0 ),
+   Size( ANativeWindow_getWidth( pWindow ),
+ ANativeWindow_getHeight( pWindow ) ) );
+}
+
 void AndroidSalInstance::onAppCmd (struct android_app* app, int32_t cmd)
 {
 fprintf (stderr, app cmd for app %p: %s\n, app, app_cmd_name(cmd));
@@ -603,6 +615,66 @@ SalSystem *AndroidSalInstance::CreateSalSystem()
 return new AndroidSalSystem();
 }
 
+class AndroidSalFrame : public SvpSalFrame
+{
+public:
+AndroidSalFrame( AndroidSalInstance *pInstance,
+ SalFrame   *pParent,
+ sal_uLong   nSalFrameStyle,
+ SystemParentData   *pSysParent )
+: SvpSalFrame( pInstance, pParent, nSalFrameStyle, pSysParent )
+{
+}
+
+virtual void GetWorkArea( Rectangle rRect )
+{
+AndroidSalInstance::getInstance()-GetWorkArea( rRect );
+}
+
+virtual void UpdateSettings( AllSettings rSettings )
+{
+// Clobber the UI fonts
+#if 0
+psp::FastPrintFontInfo aInfo;
+aInfo.m_aFamilyName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 
Roboto ) );
+aInfo.m_eItalic = ITALIC_NORMAL;
+aInfo.m_eWeight = WEIGHT_NORMAL;
+aInfo.m_eWidth = WIDTH_NORMAL;
+psp::PrintFontManager::get().matchFont( aInfo, rSettings.GetUILocale() 
);
+#endif
+
+// FIXME: is 12 point enough ?
+Font aFont( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( Roboto ) ),
+Size( 0, 14 ) );
+
+StyleSettings aStyleSet = rSettings.GetStyleSettings();
+aStyleSet.SetAppFont( aFont );
+aStyleSet.SetHelpFont( aFont );
+aStyleSet.SetMenuFont( aFont );
+aStyleSet.SetToolFont( aFont );
+aStyleSet.SetLabelFont( aFont );
+aStyleSet.SetInfoFont( aFont );
+aStyleSet.SetRadioCheckFont( aFont );
+aStyleSet.SetPushButtonFont( aFont );
+aStyleSet.SetFieldFont( aFont );
+aStyleSet.SetIconFont( aFont );
+aStyleSet.SetGroupFont( aFont );
+
+rSettings.SetStyleSettings( aStyleSet );
+}
+};
+
+SalFrame *AndroidSalInstance::CreateChildFrame( SystemParentData* pParent, 
sal_uLong nStyle )
+{
+return new AndroidSalFrame( this, NULL, nStyle, pParent );
+}
+
+SalFrame *AndroidSalInstance::CreateFrame( SalFrame* pParent, sal_uLong nStyle 
)
+{
+return new AndroidSalFrame( this, pParent, nStyle, NULL );
+}
+
+
 // All the interesting stuff is slaved from the AndroidSalInstance
 void InitSalData()   {}
 void DeInitSalData() {}
diff --git a/vcl/inc/android/androidinst.hxx b/vcl/inc/android/androidinst.hxx
index e947737..10d17c5 100644
--- a/vcl/inc/android/androidinst.hxx
+++ b/vcl/inc/android/androidinst.hxx
@@ -49,6 +49,11 @@ public:
 
 virtual SalSystem* CreateSalSystem();
 
+// frame management
+void GetWorkArea( Rectangle rRect );
+SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle );
+SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uLong nStyle );
+
 // mainloop pieces
 virtual void Wakeup();
 virtual bool AnyInput( sal_uInt16 nType );
@@ -58,6 +63,7 @@ public:
 int32_t   onInputEvent (struct android_app* app, AInputEvent* event);
 void  RedrawWindows(ANativeWindow *pWindow);
 SalFrame *getFocusFrame() const;
+
 protected:
 virtual void DoReleaseYield( int nTimeoutMS );
 struct android_app *mpApp;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'feature/android' - vcl/android vcl/inc

2012-01-31 Thread Michael Meeks
 vcl/android/androidinst.cxx   |   10 +-
 vcl/inc/headless/svpframe.hxx |2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 436e2f870144342aa6bcc28a3a5cea32680eaacf
Author: Michael Meeks michael.me...@suse.com
Date:   Tue Jan 31 19:53:49 2012 +

android: undo broken AnyInput method causing app startup to fail.

diff --git a/vcl/android/androidinst.cxx b/vcl/android/androidinst.cxx
index b20d7c4..dfb8855 100644
--- a/vcl/android/androidinst.cxx
+++ b/vcl/android/androidinst.cxx
@@ -572,11 +572,11 @@ void AndroidSalInstance::DoReleaseYield (int nTimeoutMS)
 
 bool AndroidSalInstance::AnyInput( sal_uInt16 nType )
 {
-(void) nType;
-// FIXME: ideally we should check the input queue to avoid being busy ...
-fprintf (stderr, FIXME: AnyInput returns true\n);
-// mpApp-inputQueue ? ...
-return true;
+if( (nType  VCL_INPUT_TIMER) != 0 )
+return CheckTimeout( false );
+// FIXME: ideally we should check our input queue here ...
+fprintf (stderr, FIXME: AnyInput returns false\n);
+return false;
 }
 
 class AndroidSalSystem : public SvpSalSystem {
diff --git a/vcl/inc/headless/svpframe.hxx b/vcl/inc/headless/svpframe.hxx
index 8de4054..fc923af 100644
--- a/vcl/inc/headless/svpframe.hxx
+++ b/vcl/inc/headless/svpframe.hxx
@@ -74,7 +74,7 @@ public:
 virtual SalGraphics*GetGraphics();
 virtual voidReleaseGraphics( SalGraphics* pGraphics );
 
-virtual sal_BoolPostEvent( void* pData );
+virtual sal_BoolPostEvent( void* pData );
 
 virtual voidSetTitle( const rtl::OUString rTitle );
 virtual voidSetIcon( sal_uInt16 nIcon );
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'feature/android' - vcl/android vcl/inc

2012-01-30 Thread Michael Meeks
 vcl/android/androidinst.cxx |  214 +---
 vcl/inc/android/androidinst.hxx |7 -
 2 files changed, 183 insertions(+), 38 deletions(-)

New commits:
commit 7c6cc25249f708805c4073399b09a17ec7ac32f7
Author: Michael Meeks michael.me...@suse.com
Date:   Mon Jan 30 16:21:04 2012 +

android: add start of keycode mapping

diff --git a/vcl/android/androidinst.cxx b/vcl/android/androidinst.cxx
index 31b1560..081f11b 100644
--- a/vcl/android/androidinst.cxx
+++ b/vcl/android/androidinst.cxx
@@ -81,6 +81,123 @@ static rtl::OString KeyMetaStateToString(int32_t nFlags)
 return aStr.makeStringAndClear();
 }
 
+static sal_uInt16 KeyMetaStateToCode(AInputEvent *event)
+{
+sal_uInt16 nCode = 0;
+int32_t nFlags = AKeyEvent_getMetaState(event);
+if (nFlags  AMETA_SHIFT_ON)
+nCode |= KEY_SHIFT;
+if (nFlags  AMETA_SYM_ON)
+nCode |= KEY_MOD1;
+if (nFlags  AMETA_ALT_ON)
+nCode |= KEY_MOD2;
+return nCode;
+}
+
+static sal_uInt16 KeyToCode(AInputEvent *event)
+{
+sal_uInt16 nCode = 0;
+switch (AKeyEvent_getKeyCode(event)) {
+#define MAP(a,b) \
+case AKEYCODE_##a: nCode = KEY_##b; break
+#define MAP_SAME(a) MAP(a,a)
+
+MAP_SAME(HOME);
+MAP_SAME(0); MAP_SAME(1); MAP_SAME(2); MAP_SAME(3); MAP_SAME(4);
+MAP_SAME(5); MAP_SAME(6); MAP_SAME(7); MAP_SAME(8); MAP_SAME(9);
+
+MAP_SAME(A); MAP_SAME(B); MAP_SAME(C); MAP_SAME(D);
+MAP_SAME(E); MAP_SAME(F); MAP_SAME(G); MAP_SAME(H);
+MAP_SAME(I); MAP_SAME(J); MAP_SAME(K); MAP_SAME(L);
+MAP_SAME(M); MAP_SAME(N); MAP_SAME(O); MAP_SAME(P);
+MAP_SAME(Q); MAP_SAME(R); MAP_SAME(S); MAP_SAME(T);
+MAP_SAME(U); MAP_SAME(V); MAP_SAME(W); MAP_SAME(X);
+MAP_SAME(Y); MAP_SAME(Z);
+
+MAP_SAME(TAB); MAP_SAME(SPACE); MAP_SAME(COMMA);
+
+MAP(ENTER,RETURN);
+MAP(PAGE_UP, PAGEUP);
+MAP(PAGE_DOWN, PAGEDOWN);
+MAP(DEL, DELETE);
+MAP(PERIOD, POINT);
+
+case AKEYCODE_BACK: // escape ?
+case AKEYCODE_UNKNOWN:
+case AKEYCODE_SOFT_LEFT:
+case AKEYCODE_SOFT_RIGHT:
+case AKEYCODE_CALL:
+case AKEYCODE_ENDCALL:
+case AKEYCODE_STAR:
+case AKEYCODE_POUND:
+case AKEYCODE_DPAD_UP:
+case AKEYCODE_DPAD_DOWN:
+case AKEYCODE_DPAD_LEFT:
+case AKEYCODE_DPAD_RIGHT:
+case AKEYCODE_DPAD_CENTER:
+case AKEYCODE_VOLUME_UP:
+case AKEYCODE_VOLUME_DOWN:
+case AKEYCODE_POWER:
+case AKEYCODE_CAMERA:
+case AKEYCODE_CLEAR:
+case AKEYCODE_ALT_LEFT:
+case AKEYCODE_ALT_RIGHT:
+case AKEYCODE_SHIFT_LEFT:
+case AKEYCODE_SHIFT_RIGHT:
+case AKEYCODE_SYM:
+case AKEYCODE_EXPLORER:
+case AKEYCODE_ENVELOPE:
+case AKEYCODE_GRAVE:
+case AKEYCODE_MINUS:
+case AKEYCODE_EQUALS:
+case AKEYCODE_LEFT_BRACKET:
+case AKEYCODE_RIGHT_BRACKET:
+case AKEYCODE_BACKSLASH:
+case AKEYCODE_SEMICOLON:
+case AKEYCODE_APOSTROPHE:
+case AKEYCODE_SLASH:
+case AKEYCODE_AT:
+case AKEYCODE_NUM:
+case AKEYCODE_HEADSETHOOK:
+case AKEYCODE_FOCUS: // not widget, but camera focus
+case AKEYCODE_PLUS:
+case AKEYCODE_MENU:
+case AKEYCODE_NOTIFICATION:
+case AKEYCODE_SEARCH:
+case AKEYCODE_MEDIA_PLAY_PAUSE:
+case AKEYCODE_MEDIA_STOP:
+case AKEYCODE_MEDIA_NEXT:
+case AKEYCODE_MEDIA_PREVIOUS:
+case AKEYCODE_MEDIA_REWIND:
+case AKEYCODE_MEDIA_FAST_FORWARD:
+case AKEYCODE_MUTE:
+case AKEYCODE_PICTSYMBOLS:
+case AKEYCODE_SWITCH_CHARSET:
+case AKEYCODE_BUTTON_A:
+case AKEYCODE_BUTTON_B:
+case AKEYCODE_BUTTON_C:
+case AKEYCODE_BUTTON_X:
+case AKEYCODE_BUTTON_Y:
+case AKEYCODE_BUTTON_Z:
+case AKEYCODE_BUTTON_L1:
+case AKEYCODE_BUTTON_R1:
+case AKEYCODE_BUTTON_L2:
+case AKEYCODE_BUTTON_R2:
+case AKEYCODE_BUTTON_THUMBL:
+case AKEYCODE_BUTTON_THUMBR:
+case AKEYCODE_BUTTON_START:
+case AKEYCODE_BUTTON_SELECT:
+case AKEYCODE_BUTTON_MODE:
+fprintf (stderr, un-mapped keycode %d\n, nCode);
+nCode = 0;
+break;
+#undef MAP_SAME
+#undef MAP
+}
+fprintf (stderr, mapped %d - %d\n, AKeyEvent_getKeyCode(event), nCode);
+return nCode;
+}
+
 static void BlitFrameRegionToWindow(ANativeWindow_Buffer *pOutBuffer,
 const basebmp::BitmapDeviceSharedPtr aDev,
 const ARect rSrcRect,
@@ -174,8 +291,8 @@ void AndroidSalInstance::RedrawWindows(ANativeWindow 
*pWindow)
 int32_t *p = (int32_t *)aOutBuffer.bits;
 for (int32_t y = 0; y  aOutBuffer.height; y++)
 {
-for (int32_t x = 0; x  aOutBuffer.stride / 2; x++)
-*p++ = (y  24) + x;
+for (int32_t x = 0; x  aOutBuffer.stride; x++)
+*p++ = (y  24) + (x  10) + 0xff ;
 }
 #endif
 
@@ -199,7 +316,12 @@ void AndroidSalInstance::RedrawWindows(ANativeWindow 
*pWindow)
 ANativeWindow_unlockAndPost(pWindow);
 
 fprintf 

[Libreoffice-commits] .: Branch 'feature/android' - vcl/android vcl/inc

2012-01-26 Thread Michael Meeks
 vcl/android/androidinst.cxx |   17 +++--
 vcl/inc/android/androidinst.hxx |2 +-
 2 files changed, 12 insertions(+), 7 deletions(-)

New commits:
commit 0c2de3df0982b0c77987c640a9af38d310325a55
Author: Michael Meeks michael.me...@suse.com
Date:   Thu Jan 26 14:36:25 2012 +

android: get at least something onto the screen

diff --git a/vcl/android/androidinst.cxx b/vcl/android/androidinst.cxx
index d867fa8..d8ba0b0 100644
--- a/vcl/android/androidinst.cxx
+++ b/vcl/android/androidinst.cxx
@@ -152,6 +152,7 @@ void AndroidSalInstance::RedrawWindows(ANativeWindow 
*pWindow)
 SvpSalFrame *pFrame = static_castSvpSalFrame *(*it);
 BlitFrameToWindow (pWindow, pFrame-getDevice());
 }
+mbQueueReDraw = false;
 }
 
 void AndroidSalInstance::onAppCmd (struct android_app* app, int32_t cmd)
@@ -167,7 +168,6 @@ void AndroidSalInstance::onAppCmd (struct android_app* app, 
int32_t cmd)
 fprintf (stderr, we have an app window ! %p %dx%x (%d)\n,
  pWindow, aRect.right, aRect.bottom,
  ANativeWindow_getFormat(pWindow));
-mbQueueReDraw = true;
 break;
 }
 case APP_CMD_WINDOW_RESIZED:
@@ -178,12 +178,12 @@ void AndroidSalInstance::onAppCmd (struct android_app* 
app, int32_t cmd)
 fprintf (stderr, app window resized to ! %p %dx%x (%d)\n,
  pWindow, aRect.right, aRect.bottom,
  ANativeWindow_getFormat(pWindow));
-mbQueueReDraw = true;
 break;
 }
 
 case APP_CMD_WINDOW_REDRAW_NEEDED:
 {
+fprintf (stderr, redraw needed\n);
 mbQueueReDraw = true;
 break;
 }
@@ -248,15 +248,21 @@ AndroidSalInstance *AndroidSalInstance::getInstance()
 }
 
 extern C {
-void onAppCmd_cb (struct android_app* app, int32_t cmd)
+void onAppCmd_cb (struct android_app *app, int32_t cmd)
 {
 AndroidSalInstance::getInstance()-onAppCmd(app, cmd);
 }
 
-int32_t onInputEvent_cb (struct android_app* app, AInputEvent* event)
+int32_t onInputEvent_cb (struct android_app *app, AInputEvent *event)
 {
 return AndroidSalInstance::getInstance()-onInputEvent(app, event);
 }
+void onNativeWindowRedrawNeeded_cb(ANativeActivity * /* activity */,
+   ANativeWindow *pWindow)
+{
+fprintf (stderr, onNativeWindowRedrawNeeded_cb\n);
+AndroidSalInstance::getInstance()-RedrawWindows (pWindow);
+}
 }
 
 AndroidSalInstance::AndroidSalInstance( SalYieldMutex *pMutex )
@@ -275,6 +281,7 @@ AndroidSalInstance::AndroidSalInstance( SalYieldMutex 
*pMutex )
 mpApp-onInputEvent = onInputEvent_cb;
 if (mpApp-window != NULL)
 onAppCmd_cb (mpApp, APP_CMD_INIT_WINDOW);
+mpApp-activity-callbacks-onNativeWindowRedrawNeeded = 
onNativeWindowRedrawNeeded_cb;
 pthread_mutex_unlock (mpApp-mutex);
 }
 }
@@ -317,8 +324,6 @@ void AndroidSalInstance::DoReleaseYield (int nTimeoutMS)
 mpApp-cmdPollSource.process(mpApp, mpApp-cmdPollSource);
 else if (nRet == LOOPER_ID_INPUT)
 mpApp-inputPollSource.process(mpApp, mpApp-inputPollSource);
-else if (mbQueueReDraw)
-RedrawWindows (mpApp-window);
 }
 
 bool AndroidSalInstance::AnyInput( sal_uInt16 nType )
diff --git a/vcl/inc/android/androidinst.hxx b/vcl/inc/android/androidinst.hxx
index e39f147..8efb963 100644
--- a/vcl/inc/android/androidinst.hxx
+++ b/vcl/inc/android/androidinst.hxx
@@ -37,7 +37,6 @@
 
 class AndroidSalInstance : public SvpSalInstance
 {
-void RedrawWindows(ANativeWindow *pWindow);
 void BlitFrameToWindow(ANativeWindow *pWindow,
const basebmp::BitmapDeviceSharedPtr aDev);
 public:
@@ -54,6 +53,7 @@ public:
 // incoming android event handlers:
 voidonAppCmd (struct android_app* app, int32_t cmd);
 int32_t onInputEvent (struct android_app* app, AInputEvent* event);
+voidRedrawWindows(ANativeWindow *pWindow);
 protected:
 virtual void DoReleaseYield( int nTimeoutMS );
 struct android_app *mpApp;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits