MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / cb_post_connect

Method cb_post_connect

Plugins/FreeRDP/Client/BackendFreeRDP.cpp:925–979  ·  view source on GitHub ↗

* Callback given to freerdp_connect() to perform post-connection operations. * It will be called only if the connection was initialized properly, and will continue the * initialization based on the newly created connection. */

Source from the content-addressed store, hash-verified

923 * initialization based on the newly created connection.
924 */
925BOOL CBackendFreeRDP::cb_post_connect(freerdp* instance)
926{
927 qDebug(log) << Q_FUNC_INFO;
928
929 rdpContext* context = instance->context;
930 rdpSettings* settings = instance->context->settings;
931 rdpUpdate* update = instance->context->update;
932 CBackendFreeRDP* pThis = ((ClientContext*)instance->context)->pThis;
933
934 const char* pWindowTitle = GetTitle(instance);
935 if(pWindowTitle)
936 {
937 WCHAR* windowTitle = NULL;
938#if FREERDP_VERSION_MAJOR >= 3
939 windowTitle = ConvertUtf8ToWCharAlloc(pWindowTitle, NULL);
940#else
941 ConvertToUnicode(CP_UTF8, 0, pWindowTitle, -1, &windowTitle, 0);
942#endif
943 if(windowTitle)
944 {
945 QString title = QString::fromUtf16((const char16_t*)windowTitle);
946 delete windowTitle;
947 if(pThis->m_pParameter->GetServerName().isEmpty())
948 emit pThis->sigServerName(title);
949 }
950 }
951
952 int desktopWidth = freerdp_settings_get_uint32(settings, FreeRDP_DesktopWidth);
953 int desktopHeight = freerdp_settings_get_uint32(settings, FreeRDP_DesktopHeight);
954 emit pThis->sigSetDesktopSize(desktopWidth, desktopHeight);
955
956 if (!gdi_init(instance, PIXEL_FORMAT_BGRA32))
957 return FALSE;
958
959 if(!pThis->CreateImage(instance->context))
960 return FALSE;
961
962 Q_ASSERT(instance->context->cache);
963
964 // Register cursor pointer
965 if(pThis->m_Cursor.RegisterPointer(context->graphics))
966 return FALSE;
967
968 update->BeginPaint = cb_begin_paint;
969 update->EndPaint = cb_end_paint;
970 update->DesktopResize = cb_desktop_resize;
971
972 update->PlaySound = cb_play_bell_sound;
973
974 update->SetKeyboardIndicators = cb_keyboard_set_indicators;
975 update->SetKeyboardImeStatus = cb_keyboard_set_ime_status;
976
977 emit pThis->sigRunning();
978 return TRUE;
979}
980
981void CBackendFreeRDP::cb_post_disconnect(freerdp* instance)
982{

Callers

nothing calls this directly

Calls 4

GetServerNameMethod · 0.80
CreateImageMethod · 0.80
RegisterPointerMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected