本文整理汇总了C++中ProtoServiceExists函数的典型用法代码示例。如果您正苦于以下问题:C++ ProtoServiceExists函数的具体用法?C++ ProtoServiceExists怎么用?C++ ProtoServiceExists使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ProtoServiceExists函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: mir_strncpy
Protocol::Protocol(const char *aName, const TCHAR *descr)
{
mir_strncpy(name, aName, _countof(name));
mir_tstrncpy(description, descr, _countof(description));
data_changed = true;
// Load services
int caps = CallProtoService(name, PS_GETCAPS, PFLAGNUM_1, 0);
if (caps & PF1_IM)
valid = true;
else
return;
can_have_listening_to = (ProtoServiceExists(name, PS_SET_LISTENINGTO) != 0);
PF3 = CallProtoService(name, PS_GETCAPS, (WPARAM)PFLAGNUM_3, 0);
caps = CallProtoService(name, PS_GETCAPS, PFLAGNUM_4, 0);
can_have_avatar = (caps & PF4_AVATARS) != 0;
can_set_nick = ProtoServiceExists(name, PS_SETMYNICKNAME) != FALSE;
// Initial value
GetStatus();
GetStatusMsg();
GetNick();
GetAvatar();
}
开发者ID:ybznek,项目名称:miranda-ng,代码行数:27,代码来源:data.cpp
示例2: InternalRemoveMyAvatar
static int InternalRemoveMyAvatar(char *protocol)
{
SetIgnoreNotify(protocol, TRUE);
// Remove avatar
int ret = 0;
if (protocol != NULL)
{
if ( ProtoServiceExists(protocol, PS_SETMYAVATAR))
ret = SaveAvatar(protocol, NULL);
else
ret = -3;
if (ret == 0)
{
// Has global avatar?
DBVARIANT dbv = {0};
if ( !db_get_ts(NULL, AVS_MODULE, "GlobalUserAvatarFile", &dbv)) {
db_free(&dbv);
db_set_b(NULL, AVS_MODULE, "GlobalUserAvatarNotConsistent", 1);
DeleteGlobalUserAvatar();
}
}
}
else
{
PROTOACCOUNT **accs;
int i,count;
ProtoEnumAccounts( &count, &accs );
for (i = 0; i < count; i++)
{
if ( !ProtoServiceExists( accs[i]->szModuleName, PS_SETMYAVATAR))
continue;
if (!Proto_IsAvatarsEnabled( accs[i]->szModuleName ))
continue;
// Found a protocol
int retTmp = SaveAvatar( accs[i]->szModuleName, NULL);
if (retTmp != 0)
ret = retTmp;
}
DeleteGlobalUserAvatar();
if (ret)
db_set_b(NULL, AVS_MODULE, "GlobalUserAvatarNotConsistent", 1);
else
db_set_b(NULL, AVS_MODULE, "GlobalUserAvatarNotConsistent", 0);
}
SetIgnoreNotify(protocol, FALSE);
ReportMyAvatarChanged(WPARAM((protocol == NULL ) ? "" : protocol), 0);
return ret;
}
开发者ID:MrtsComputers,项目名称:miranda-ng,代码行数:57,代码来源:services.cpp
示例3: Proto_GetDelayAfterFail
int Proto_GetDelayAfterFail(const char *proto)
{
if (ProtoServiceExists(proto, PS_GETAVATARCAPS))
return CallProtoService(proto, PS_GETAVATARCAPS, AF_DELAYAFTERFAIL, 0);
return 0;
}
开发者ID:martok,项目名称:miranda-ng,代码行数:7,代码来源:utils.cpp
示例4: SetStatus
void SetStatus(WORD code, StatusItem* item, char *szAccName)
{
if (code == IDCLOSE)
return;
PROTOACCOUNT* pdescr = Proto_GetAccount(szAccName);
if (pdescr == nullptr)
return;
if (!ProtoServiceExists(szAccName, PS_SETCUSTOMSTATUSEX))
return;
int statusToSet;
CUSTOM_STATUS ics = { sizeof(CUSTOM_STATUS) };
ics.flags = CSSF_MASK_STATUS | CSSF_MASK_NAME | CSSF_MASK_MESSAGE | CSSF_UNICODE;
if (code == IDC_CANCEL) {
statusToSet = 0;
ics.ptszName = L"";
ics.ptszMessage = L"";
}
else if (code == IDOK && item != nullptr) {
statusToSet = item->m_iIcon + 1;
ics.ptszName = variables_parsedup(item->m_tszTitle, nullptr, NULL);
ics.ptszMessage = variables_parsedup(item->m_tszMessage, nullptr, NULL);
}
else return;
ics.status = &statusToSet;
CallProtoService(szAccName, PS_SETCUSTOMSTATUSEX, 0, (LPARAM)&ics);
}
开发者ID:tweimer,项目名称:miranda-ng,代码行数:32,代码来源:cslist.cpp
示例5: ReloadMyAvatar
static void ReloadMyAvatar(LPVOID lpParam)
{
char *szProto = (char *)lpParam;
mir_sleep(500);
for (int i = 0; !g_shutDown && i < g_MyAvatars.getCount(); i++) {
char *myAvatarProto = g_MyAvatars[i].szProtoname;
if (szProto[0] == 0) {
// Notify to all possibles
if (mir_strcmp(myAvatarProto, szProto)) {
if (!ProtoServiceExists(myAvatarProto, PS_SETMYAVATAR))
continue;
if (!Proto_IsAvatarsEnabled(myAvatarProto))
continue;
}
}
else if (mir_strcmp(myAvatarProto, szProto))
continue;
if (g_MyAvatars[i].hbmPic)
DeleteObject(g_MyAvatars[i].hbmPic);
if (CreateAvatarInCache(INVALID_CONTACT_ID, &g_MyAvatars[i], myAvatarProto) != -1)
NotifyEventHooks(hMyAvatarChanged, (WPARAM)myAvatarProto, (LPARAM)&g_MyAvatars[i]);
else
NotifyEventHooks(hMyAvatarChanged, (WPARAM)myAvatarProto, 0);
}
free(lpParam);
}
开发者ID:biddyweb,项目名称:miranda-ng,代码行数:32,代码来源:services.cpp
示例6: Proto_NeedDelaysForAvatars
BOOL Proto_NeedDelaysForAvatars(const char *proto)
{
if (ProtoServiceExists(proto, PS_GETAVATARCAPS))
return CallProtoService(proto, PS_GETAVATARCAPS, AF_DONTNEEDDELAYS, 0) <= 0;
return TRUE;
}
开发者ID:martok,项目名称:miranda-ng,代码行数:7,代码来源:utils.cpp
示例7: Proto_IsFetchingWhenProtoNotVisibleAllowed
BOOL Proto_IsFetchingWhenProtoNotVisibleAllowed(const char *proto)
{
if (ProtoServiceExists(proto, PS_GETAVATARCAPS))
return CallProtoService(proto, PS_GETAVATARCAPS, AF_FETCHIFPROTONOTVISIBLE, 0);
return FALSE;
}
开发者ID:martok,项目名称:miranda-ng,代码行数:7,代码来源:utils.cpp
示例8: Proto_GetAvatarMaxFileSize
int Proto_GetAvatarMaxFileSize(const char *proto)
{
if (ProtoServiceExists(proto, PS_GETAVATARCAPS))
return CallProtoService(proto, PS_GETAVATARCAPS, AF_MAXFILESIZE, 0);
return 0;
}
开发者ID:martok,项目名称:miranda-ng,代码行数:7,代码来源:utils.cpp
示例9: AddEventThread
void AddEventThread(void *arg)
{
HANDLE hContact = (HANDLE)arg;
TCHAR stzTitle[MAX_TITLE_LEN], stzText[MAX_TEXT_LEN];
char *szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
if (szProto == NULL) return;
if (ProtoServiceExists(szProto, JS_PARSE_XMPP_URI))
{
GetJabberAdvStatusText(hContact, szProto, "mood", "title", stzTitle, SIZEOF(stzTitle));
if (stzTitle[0])
{
GetJabberAdvStatusText(hContact, szProto, "mood", "text", stzText, SIZEOF(stzText));
LogXstatusChange(hContact, szProto, TYPE_JABBER_MOOD, stzTitle, stzText);
}
GetJabberAdvStatusText(hContact, szProto, "activity", "title", stzTitle, SIZEOF(stzTitle));
if (stzTitle[0])
{
GetJabberAdvStatusText(hContact, szProto, "activity", "text", stzText, SIZEOF(stzText));
LogXstatusChange(hContact, szProto, TYPE_JABBER_ACTIVITY, stzTitle, stzText);
}
}
else
{
GetIcqXStatus(hContact, szProto, "XStatusName", stzTitle, SIZEOF(stzTitle));
if (stzTitle[0])
{
GetIcqXStatus(hContact, szProto, "XStatusMsg", stzText, SIZEOF(stzText));
LogXstatusChange(hContact, szProto, TYPE_ICQ_XSTATUS, stzTitle, stzText);
}
}
}
开发者ID:TonyAlloa,项目名称:miranda-dev,代码行数:34,代码来源:xstatus.cpp
示例10: Proto_AvatarImageProportion
int Proto_AvatarImageProportion(const char *proto)
{
if (ProtoServiceExists(proto, PS_GETAVATARCAPS))
return CallProtoService(proto, PS_GETAVATARCAPS, AF_PROPORTION, 0);
return 0;
}
开发者ID:martok,项目名称:miranda-ng,代码行数:7,代码来源:utils.cpp
示例11: Proto_IsAvatarsEnabled
BOOL Proto_IsAvatarsEnabled(const char *proto)
{
if (ProtoServiceExists(proto, PS_GETAVATARCAPS))
return CallProtoService(proto, PS_GETAVATARCAPS, AF_ENABLED, 0);
return TRUE;
}
开发者ID:martok,项目名称:miranda-ng,代码行数:7,代码来源:utils.cpp
示例12: sttPreviewSkin
static void sttPreviewSkin(MODERNOPTOBJECT *obj, TCHAR *fn, LPDRAWITEMSTRUCT lps)
{
if (!fn) return;
if (ProtoServiceExists(obj->lpzThemeModuleName, TS_SKIN_PREVIEW)) {
CallProtoService(obj->lpzThemeModuleName, TS_SKIN_PREVIEW, (WPARAM)lps, (LPARAM)fn);
return;
}
HBITMAP hbmPreview = Bitmap_Load(CMString(fn) + _T(".png"));
if (!hbmPreview)
return;
BITMAP bmp;
GetObject(hbmPreview, sizeof(bmp), &bmp);
SIZE szDst = { abs(bmp.bmWidth), abs(bmp.bmHeight) };
if ((szDst.cx > lps->rcItem.right - lps->rcItem.left) || (szDst.cy > lps->rcItem.bottom - lps->rcItem.top)) {
float q = min(
float(lps->rcItem.right - lps->rcItem.left) / szDst.cx,
float(lps->rcItem.bottom - lps->rcItem.top) / szDst.cy);
szDst.cx *= q;
szDst.cy *= q;
}
POINT ptDst = {
(lps->rcItem.left + lps->rcItem.right - szDst.cx) / 2,
(lps->rcItem.top + lps->rcItem.bottom - szDst.cy) / 2 };
HDC hdc = CreateCompatibleDC(lps->hDC);
SelectObject(hdc, hbmPreview);
SetStretchBltMode(hdc, HALFTONE);
StretchBlt(lps->hDC, ptDst.x, ptDst.y, szDst.cx, szDst.cy, hdc, 0, 0, abs(bmp.bmWidth), abs(bmp.bmHeight), SRCCOPY);
DeleteDC(hdc);
DeleteObject(hbmPreview);
}
开发者ID:kxepal,项目名称:miranda-ng,代码行数:35,代码来源:mopt_selector.cpp
示例13: Proto_IsFetchingWhenContactOfflineAllowed
BOOL Proto_IsFetchingWhenContactOfflineAllowed(const char *proto)
{
if (ProtoServiceExists(proto, PS_GETAVATARCAPS))
return CallProtoService(proto, PS_GETAVATARCAPS, AF_FETCHIFCONTACTOFFLINE, 0);
return FALSE;
}
开发者ID:martok,项目名称:miranda-ng,代码行数:7,代码来源:utils.cpp
示例14: OnCreateMenuItems
static int OnCreateMenuItems(WPARAM, LPARAM)
{
for (auto &pa : Accounts())
if (ProtoServiceExists(pa->szModuleName, PS_SETCUSTOMSTATUSEX))
addProtoStatusMenuItem(pa->szModuleName);
return 0;
}
开发者ID:tweimer,项目名称:miranda-ng,代码行数:8,代码来源:cslist.cpp
示例15: CanSetMyAvatar
static INT_PTR CanSetMyAvatar(WPARAM wParam, LPARAM)
{
char *protocol = (char *)wParam;
if (protocol == NULL || fei == NULL)
return 0;
return ProtoServiceExists(protocol, PS_SETMYAVATAR);
}
开发者ID:biddyweb,项目名称:miranda-ng,代码行数:8,代码来源:services.cpp
示例16:
TCHAR *Hlp_GetProtocolName(const char *proto) {
char protoname[256];
if ((!ProtoServiceExists(proto, PS_GETNAME)) || (CallProtoService(proto, PS_GETNAME, (WPARAM)sizeof(protoname), (LPARAM)protoname)))
return NULL;
return mir_a2t(protoname);
}
开发者ID:kmdtukl,项目名称:miranda-ng,代码行数:9,代码来源:gen_helpers.cpp
示例17: GetNickMaxLength
int Protocol::GetNickMaxLength()
{
if (!ProtoServiceExists(name, PS_GETMYNICKNAMEMAXLENGTH))
return MS_MYDETAILS_GETMYNICKNAME_BUFFER_SIZE;
int ret = CallProtoService(name, PS_GETMYNICKNAMEMAXLENGTH, 0, 0);
if (ret <= 0)
ret = MS_MYDETAILS_GETMYNICKNAME_BUFFER_SIZE;
return ret;
}
开发者ID:ybznek,项目名称:miranda-ng,代码行数:10,代码来源:data.cpp
示例18: Proto_IsAvatarFormatSupported
BOOL Proto_IsAvatarFormatSupported(const char *proto, int format)
{
if (ProtoServiceExists(proto, PS_GETAVATARCAPS))
return CallProtoService(proto, PS_GETAVATARCAPS, AF_FORMATSUPPORTED, format);
if (format >= PA_FORMAT_SWF)
return FALSE;
return TRUE;
}
开发者ID:martok,项目名称:miranda-ng,代码行数:10,代码来源:utils.cpp
示例19: HideNudgeButton
void HideNudgeButton(MCONTACT hContact)
{
char *szProto = GetContactProto(hContact);
if (!ProtoServiceExists(szProto, PS_SEND_NUDGE)) {
BBButton bbd = { sizeof(bbd) };
bbd.bbbFlags = BBSF_HIDDEN | BBSF_DISABLED;
bbd.pszModuleName = "Nudge";
bbd.dwButtonID = 6000;
CallService(MS_BB_SETBUTTONSTATE, hContact, (LPARAM)&bbd);
}
}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:11,代码来源:main.cpp
示例20: VoiceRegister
static INT_PTR VoiceRegister(WPARAM wParam, LPARAM lParam)
{
VOICE_MODULE *in = (VOICE_MODULE *) wParam;
if (in == NULL || in->cbSize < sizeof(VOICE_MODULE) || in->name == NULL || in->description == NULL)
return -1;
if (FindModule(in->name) != NULL)
return -2;
if (!ProtoServiceExists(in->name, PS_VOICE_CALL)
|| !ProtoServiceExists(in->name, PS_VOICE_ANSWERCALL)
|| !ProtoServiceExists(in->name, PS_VOICE_DROPCALL))
return -3;
modules.insert(new VoiceProvider(in->name, in->description, in->flags, in->icon));
if (hwnd_frame != NULL)
PostMessage(hwnd_frame, WMU_REFRESH, 0, 0);
return 0;
}
开发者ID:Robyer,项目名称:miranda-plugins,代码行数:21,代码来源:voiceservice.cpp
注:本文中的ProtoServiceExists函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论