示例#1
0
int WStrToScalar(PERL_CALL SV *string, PWSTR str)
{
	if(!string)
		return 0;

	PSTR strPtr = str ? W2S(str) : NULL;

	if(strPtr)
		sv_setpv(string, strPtr);
	
	FreeStr(strPtr);

	return 1;
}
示例#2
0
int WStrToArray(PERL_CALL AV *array, PWSTR str)
{
	if(!array)
		return 0;

	PSTR strPtr = str ? W2S(str) : NULL;

	if(strPtr)
		av_push(array, newSVpv(strPtr, strlen(strPtr)));
	
	FreeStr(strPtr);

	return 1;
}
示例#3
0
int WStrToHash(PERL_CALL HV *hash, PSTR idx, PWSTR str)
{
	if(!hash || !idx)
		return 0;

	PSTR strPtr = str ? W2S(str) : NULL;

	if(strPtr)
		hv_store(hash, idx, strlen(idx), newSVpv(strPtr, strlen(strPtr)), 0);
	
	FreeStr(strPtr);

	return 1;
}
示例#4
0
U0 Zoom(F64 d)
{
  F64 sx,sy,wx,wy;
  I64 i,x=ipx,y=ipy;
  d=Exp(Ln(d)/ZOOM_STEPS);
  for (i=0;i<ZOOM_STEPS;i++) {
    S2W(x,y,&wx,&wy);
    zoom=Limit(zoom*d,0.02,50);
    W2S(wx,wy,&sx,&sy);
    task->win_scroll_x=ipx-sx-task->win_pixel_left;
    task->win_scroll_y=ipy-sy-task->win_pixel_top;
    Sleep(10);
  }
}
示例#5
0
int WNStrToArray(PERL_CALL AV *array, PWSTR str, DWORD strLen)
{
	if(!array)
		return 0;

	PSTR strPtr = str ? W2S(str, strLen) : NULL;

	if(strPtr)
	{
		strPtr[strLen - 1] = 0;
		av_push(array, newSVpv(strPtr, strlen(strPtr)));
	}
	
	FreeStr(strPtr);

	return 1;
}
示例#6
0
int WNStrToHash(PERL_CALL HV *hash, PSTR idx, PWSTR str, DWORD strLen)
{
	if(!hash || !idx)
		return 0;

	PSTR strPtr = str ? W2S(str, strLen) : NULL;

	if(strPtr)
	{
		strPtr[strLen - 1] = 0;
		hv_store(hash, idx, strlen(idx), newSVpv(strPtr, strlen(strPtr)), 0);
	}
	
	FreeStr(strPtr);

	return 1;
}