void CExtManager::zoomText(int nZoom) { #ifndef RHODES_QT_PLATFORM ::PostMessage( getMainWnd(), WM_COMMAND, IDM_ZOOMTEXT, (LPARAM)nZoom ); #endif }
static void __minimize_restoreApp(int nParam) { ::ShowWindow(getMainWnd(), nParam ); SetForegroundWindow(getMainWnd()); }
void CExtManager::zoomPage(float fZoom) { #ifndef RHODES_QT_PLATFORM ::PostMessage( getMainWnd(), WM_COMMAND, IDM_ZOOMPAGE, (LPARAM)new CRhoFloatData(fZoom) ); #endif }
void CExtManager::zoomText(int nZoom) { ::PostMessage( getMainWnd(), WM_COMMAND, IDM_ZOOMTEXT, (LPARAM)nZoom ); }
void CExtManager::stopNavigate() { #ifndef RHODES_QT_PLATFORM ::PostMessage( getMainWnd(), WM_COMMAND, IDM_STOPNAVIGATE, (LPARAM)rho_webview_active_tab() ); #endif }
// that function return native object used for display Web content : // UIWebView* for iPhone // jobject for Android - jobect is android.webkit.WebView class type // HWND for Windows Mobile void* RhoNativeViewManager::getWebViewObject(int tab_index) { HWND main_wnd = getMainWnd();//getWebViewWnd(); return main_wnd; }
void CExtManager::zoomPage(float fZoom) { ::PostMessage( getMainWnd(), WM_COMMAND, IDM_ZOOMPAGE, (LPARAM)fZoom ); }
void CExtManager::minimizeApp() { ::ShowWindow(getMainWnd(), SW_MINIMIZE ); }
void CExtManager::restoreApp() { ::ShowWindow(getMainWnd(), SW_RESTORE ); }
void CExtManager::executeJavascript(const wchar_t* szJSFunction) { ::PostMessage( getMainWnd(), WM_COMMAND, IDM_EXECUTEJS, (LPARAM)_wcsdup(szJSFunction) ); }
void CExtManager::stopNavigate() { ::PostMessage( getMainWnd(), WM_COMMAND, IDM_STOPNAVIGATE, (LPARAM)rho_webview_active_tab() ); }
void CExtManager::navigate(const wchar_t* szUrl) { ::PostMessage( getMainWnd(), WM_COMMAND, IDM_NAVIGATE, (LPARAM)_wcsdup(szUrl) ); }
WMBitmap::WMBitmap(IImage* img, bool useAlpha) { mReferenceCount = 1; #if defined(_WIN32_WCE) ImageInfo imgInfo; img->GetImageInfo(&imgInfo); mWidth = imgInfo.Width; mHeight = imgInfo.Height; mAlphaBitmap = NULL; mBuf = NULL; HDC windowDC = ::GetDC(getMainWnd()); BITMAP bmp; HDC mMemoryDC = CreateCompatibleDC(windowDC); mRowByteSize = mWidth*2; if (((mWidth*2) & 0x3) != 0) { mRowByteSize = ((mWidth*2) & (~0x3)) + 0x4; } char buf[sizeof(BITMAPINFOHEADER) + 100]; BITMAPINFO* bmi = (BITMAPINFO*)buf; bmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bmi->bmiHeader.biWidth = mWidth; bmi->bmiHeader.biHeight = mHeight; bmi->bmiHeader.biPlanes = 1; bmi->bmiHeader.biBitCount = 16; bmi->bmiHeader.biCompression = BI_BITFIELDS; bmi->bmiHeader.biSizeImage = mRowByteSize * mHeight; bmi->bmiHeader.biXPelsPerMeter = 0; bmi->bmiHeader.biYPelsPerMeter = 0; bmi->bmiHeader.biClrUsed = 0; bmi->bmiHeader.biClrImportant = 0; *((DWORD*)&(bmi->bmiColors[0])) = 0x1F << 11; *((DWORD*)&(bmi->bmiColors[1])) = 0x3F << 5; *((DWORD*)&(bmi->bmiColors[2])) = 0x1F; mMemoryBitmap = CreateDIBSection( mMemoryDC, bmi, DIB_RGB_COLORS, (void**)&mBuf, NULL, 0); HGDIOBJ resObj = ::SelectObject(mMemoryDC, mMemoryBitmap); ::GetObject( mMemoryBitmap, sizeof(BITMAP), &bmp ); RECT r; r.left = 0; r.right = mWidth; r.top = 0; r.bottom = mHeight; if (useAlpha) { mAlphaBitmap = new WMAlphaBitmap(img); } else { img->Draw(mMemoryDC, &r, NULL); } ::SelectObject(mMemoryDC, resObj); DeleteDC(mMemoryDC); #endif //#if defined(_WIN32_WCE) }
void RhoNativeViewUtil::executeInUIThread_WM(RhoNativeViewRunnable* command) { HWND main_wnd = getMainWnd(); ::PostMessage(main_wnd, WM_EXECUTE_COMMAND, (WPARAM)command, 0); }
void take_picture(char* callback_url, rho_param * options_hash) { HWND main_wnd = getMainWnd(); ::PostMessage(main_wnd,WM_TAKEPICTURE,0,(LPARAM)strdup(callback_url)); }
void CExtManager::resizeBrowserWindow(RECT rc) { ::MoveWindow( getMainWnd(), rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, TRUE ); }
void choose_picture(char* callback_url) { //#if defined(_WIN32_WCE) HWND main_wnd = getMainWnd(); ::PostMessage(main_wnd,WM_SELECTPICTURE,0,(LPARAM)strdup(callback_url)); //#endif }
virtual void run() { ourMapViewDlg.DoModal(getMainWnd()); }