int NotificationServer::initialize(void) { if (m_initialized) return PRIV_FLTR_ERROR_SUCCESS; DBusError error; dbus_error_init(&error); m_pDBusConnection = dbus_bus_get_private(DBUS_BUS_SYSTEM, &error); TryReturn(m_pDBusConnection != NULL, PRIV_FLTR_ERROR_SYSTEM_ERROR, dbus_error_free(&error), "dbus_bus_get_private : %s", error.message); dbus_connection_setup_with_g_main(m_pDBusConnection, NULL); std::unique_ptr < char[] > pRule(new char[MAX_LOCAL_BUF_SIZE]); snprintf(pRule.get(), MAX_LOCAL_BUF_SIZE, "path='%s',type='signal',interface='%s'", DBUS_PATH.c_str(), DBUS_SIGNAL_INTERFACE.c_str()); dbus_bus_add_match(m_pDBusConnection, pRule.get(), &error); TryReturn(!dbus_error_is_set(&error), PRIV_FLTR_ERROR_SYSTEM_ERROR, dbus_error_free(&error), "dbus_bus_add_match : %s", error.message); m_initialized = true; return PRIV_FLTR_ERROR_SUCCESS; }
int PrivacyGuardClient::PgAddPrivacyAccessLog(const int userId, const std::string packageId, const std::string privacyId) { int result = PRIV_FLTR_ERROR_SUCCESS; logInfoList.push_back(std::pair <std::string, std::string> (packageId, privacyId)); PF_LOGD("PrivacyGuardClient userId : %d, PgAddPrivacyAccessLog logInfoList.size() : %d", userId, logInfoList.size()); if(logInfoList.size() >= COUNT) { int res = m_pSocketClient->connect(); TryReturn(res == PRIV_FLTR_ERROR_SUCCESS, res, , "connect : %d", res); res = m_pSocketClient->call("PgAddPrivacyAccessLog", userId, logInfoList, &result); TryReturn(res == PRIV_FLTR_ERROR_SUCCESS, res, m_pSocketClient->disconnect(), "call : %d", res); res = m_pSocketClient->disconnect(); TryReturn(res == PRIV_FLTR_ERROR_SUCCESS, res, , "disconnect : %d", res); logInfoList.clear(); }
int CynaraService::start(void) { LOGI("CynaraService starting"); int res = 0; sigset_t sigset; sigemptyset(&sigset); res = pthread_sigmask(SIG_BLOCK, &sigset, NULL); TryReturn( res >= 0, PRIV_FLTR_ERROR_SYSTEM_ERROR, , "pthread_sigmask : %s", strerror(errno)); pthread_t cynaraThread; res = pthread_create(&cynaraThread, NULL, &getEntriesThread, this); TryReturn( res >= 0, PRIV_FLTR_ERROR_SYSTEM_ERROR, errno = res, "pthread_create : %s", strerror(res)); m_cynaraThread = cynaraThread; LOGI("CynaraService started"); return PRIV_FLTR_ERROR_SUCCESS; }
bool EditingScrollPanel::Initialize(String content) { result r = Construct(FORM_STYLE_NORMAL | FORM_STYLE_PORTRAIT_INDICATOR); TryReturn(r == E_SUCCESS, false, "Failed to construct form"); AppResource* pAppResource = Application::GetInstance()->GetAppResource(); int i; int current_y = 0; int current_x = 70; Dimension tmp_dim; String tmp_str; Rectangle panel_rect; wchar_t tmp_char; Font font; font.Construct(FONT_STYLE_PLAIN, 30); str_content = content; str_content = L"이용수 위원장은 협상팀과 함께 지난 4일 출국해 6일 귀국했고 곧바로 7일 브리핑을 하는 셈이다. 큰 틀에서 이미 판 마르바이크 감독과 합의가 이루어진 것으로 예상할 수 있는 대목이다. 판 마르바이크 감독과의 교감이 없었다면 굳이 브리핑을 할 이유가 없으며 다른 후보자들을 두고 조기 귀국할 이유 역시 없기 때문이다. 사실상 판 마르바이크 감독과의 세부적인 조율만을 남겨놓고 있다는 전망이 나오고 있는 이유다. 이미 네덜란드 언론에서도 판 마르바이크 감독이 한국와의 협상이 진행중이라는 보도가 나온 만큼 대한축구협회가 판 마르바이크 감독에게 관심을 보이고 있다는 사실은 더 이상 비밀이 아니다. 7일 열리는 브리핑을 통해 한국 축구대표팀 차기 감독의 윤곽이 드러날지 기대된다."; for(i=0; i<str_content.GetLength(); i++) { str_content.GetCharAt(i, tmp_char); tmp_str.Append(tmp_char); if(tmp_char == ' ' && (i+1) < str_content.GetLength()) { str_content.GetCharAt(i+1,tmp_char); if(tmp_char != ' ') { font.GetTextExtent(tmp_str, tmp_str.GetLength(), tmp_dim); arr_text_element.Add(new String(tmp_str)); if(current_x + tmp_dim.width > 650) { current_x = 70; current_y += (STRIATION_SPACING); } arr_text_element_highlight.Add(new Boolean(false)); arr_text_element_rect.Add(new Rectangle(current_x, current_y, tmp_dim.width ,STRIATION_SPACING)); current_x += tmp_dim.width; tmp_str.Clear(); } } else if(i == str_content.GetLength()-1) { font.GetTextExtent(tmp_str, tmp_str.GetLength(), tmp_dim); arr_text_element.Add(new String(tmp_str)); if(current_x + tmp_dim.width > 650) { current_x = 70; current_y += (STRIATION_SPACING); } arr_text_element_highlight.Add(new Boolean(false)); arr_text_element_rect.Add(new Rectangle(current_x, current_y, tmp_dim.width ,STRIATION_SPACING)); //this->SetBounds(30, 377, this->GetWidth()-60, + current_y+STRIATION_SPACING); current_x += tmp_dim.width; tmp_str.Clear(); } } this->AddTouchEventListener(*this); this->AddScrollEventListener(*this); this->Show(); return true; }