当前位置: 首页>>代码示例>>C++>>正文


C++ ProtoServiceExists函数代码示例

本文整理汇总了C++中ProtoServiceExists函数的典型用法代码示例。如果您正苦于以下问题:C++ ProtoServiceExists函数的具体用法?C++ ProtoServiceExists怎么用?C++ ProtoServiceExists使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ProtoServiceExists函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的ProtoServiceExists函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。