repo_name
stringlengths 6
97
| path
stringlengths 3
341
| text
stringlengths 8
1.02M
|
|---|---|---|
helix-datasets/blind-helix
|
evaluation/data/manual-labels/semantic/gcj-2010-509101/Ferlon.c
|
#include <cstdio>
#include <cstring>
//#include <iostream>
using namespace std;
typedef long long ll;
const int c=1010;
int g[c];
ll ans;
bool b[c];
int nk[c];
ll eu[c];
int n,k,r,t,ii;
int main() {
int i,tmp,p,dp,nj;
bool q;
scanf("%d",&t);
for (ii=1; ii<=t; ++ii) {
printf("Case #%d: ",ii);
memset(b,0,sizeof(b));
scanf("%d%d%d",&r,&k,&n);
for (i=0; i<n; ++i) scanf("%d",&g[i]);
b[0]=1;
nk[1]=0;
eu[1]=0;
p=0;
q=0;
ans=0;
for (i=1; i<=r; ++i) {
tmp=0;
nj=0;
while (1) {
tmp+=g[p];
++nj;
p=(p+1)%n;
if (tmp>k || nj==n) break;
}
if (tmp>k) {
p=(p+n-1)%n;
tmp-=g[p];
}
// cerr << i << ' ' << p << ' ' << tmp << '\n';
ans+=tmp;
if (b[p] && !q) {
dp=(r-i)/(i-nk[p]);
ans+=(ans-eu[p])*dp;
i+=(i-nk[p])*dp;
q=1;
} else {
b[p]=1;
eu[p]=ans;
nk[p]=i;
}
}
printf("%I64Ld\n",ans);
}
return 0;
}
|
helix-datasets/blind-helix
|
evaluation/data/manual-labels/semantic/gcj-2014-5158144455999488/bwps.c
|
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <cfloat>
#include <numeric>
using namespace std;
const int oo = 0x3f3f3f3f;
const double eps = 1e-9;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii;
#define sz(c) int((c).size())
#define all(c) (c).begin(), (c).end()
#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define FORD(i,a,b) for (int i = int(b)-1; i >= (a); i--)
#define FORIT(i,c) for (__typeof__((c).begin()) i = (c).begin(); i != (c).end(); i++)
int T, W, H, B;
bool mark[110][510];
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
bool dfs(int x, int y, int d) {
if (x < 0 || x >= W) return false;
if (y < 0) return false;
if (y >= H) return true;
if (mark[x][y]) return false;
mark[x][y] = true;
FOR(i, -1, 2) {
int dd = (d + i + 4) % 4;
int xx = x + dx[dd], yy = y + dy[dd];
if (dfs(xx, yy, dd)) return true;
}
return false;
}
int main() {
cin >> T;
FOR(cs, 1, T+1) {
cin >> W >> H >> B;
memset(mark, 0, sizeof(mark));
FOR(i, 0, B) {
int x0, y0, x1, y1;
cin >> x0 >> y0 >> x1 >> y1;
FOR(j, x0, x1+1) FOR(k, y0, y1+1) mark[j][k] = true;
}
int res = 0;
FOR(i, 0, W) if (dfs(i, 0, 0)) res++;
cout << "Case #" << cs << ": " << res << endl;
}
return 0;
}
|
helix-datasets/blind-helix
|
evaluation/data/manual-labels/semantic/gcj-2012-1475486/yangzhe1991.c
|
<reponame>helix-datasets/blind-helix<gh_stars>1-10
#include<iostream>
#include<stdio.h>
#include<string>
#include<string.h>
#include<algorithm>
#include<vector>
#include<map>
using namespace std;
int l[2000],p[2000];
int b[2000];
int main()
{
int t;
cin>>t;
for(int tt=1;tt<=t;tt++)
{
int n;
cin>>n;
cout<<"Case #"<<tt<<":";
for(int i=0;i<n;i++)
cin>>l[i];
for(int i=0;i<n;i++)
{
cin>>p[i];
p[i]=100-p[i];
}
memset(b,0,sizeof(b));
for(int i=0;i<n;i++)
{
int min=100000,mini;
for(int j=0;j<n;j++)
{
if(!b[j]&&p[j]<min)
{
min=p[j];
mini=j;
}
}
cout<<" ";
cout<<mini;
b[mini]=1;
}
cout<<endl;
}
return 0;
}
|
helix-datasets/blind-helix
|
evaluation/data/manual-labels/semantic/gcj-2010-509101/Suyog.c
|
#include<iostream>
using namespace std;
int main()
{
int T, g[1004], next[1004], nsum[1004];
cin>>T;
for(int t = 1; t <= T; t++)
{
int R, K, N;
cin>>R>>K>>N;
long long sum = 0;
for(int i = 0; i < N; i++)
{
cin>>g[i];
sum += g[i];
}
if(sum <= K)
{
cout<<"Case #"<<t<<": "<<(sum * R)<<endl;
continue;
}
int j = 0;
sum = 0;
for(int i = 0; i < N; i++)
{
while(sum + g[j] <= K)
{
sum += g[j];
j++;
j %= N;
}
next[i] = j;
nsum[i] = sum;
sum -= g[i];
}
long long res = 0;
int cur = 0;
for(int r = 0; r < R; r++)
{
res += nsum[cur];
cur = next[cur];
}
cout<<"Case #"<<t<<": "<<res<<endl;
}
return 0;
}
|
helix-datasets/blind-helix
|
evaluation/data/manual-labels/semantic/gcj-2020-00000000003775e9/Bodo171.c
|
<reponame>helix-datasets/blind-helix<filename>evaluation/data/manual-labels/semantic/gcj-2020-00000000003775e9/Bodo171.c<gh_stars>1-10
#include <bits/stdc++.h>
using namespace std;
long long oldx[10],oldy[10],x[10],y[10];
long long area(long long X1,long long X2,long long Y1,long long Y2){
if(X1>X2||Y1>Y2)
return 0;
return (X2-X1)*(Y2-Y1);
}
long long gcd(long long A,long long B){
if((!A)||(!B)) return A+B;
return gcd(B,A%B);
}
void solve_testcase(int cnt){
int n;
long long d;
cin>>n>>d;
for(int i=0;i<n;i++){
cin>>oldx[i]>>oldy[i];
x[i]=oldx[i]-oldy[i];
y[i]=oldx[i]+oldy[i];
}
long long area1,area2;
area1=area(x[0]-d,x[0]+d,y[0]-d,y[0]+d);
area2=area(x[1]-d,x[1]+d,y[1]-d,y[1]+d);
long long rX=min(x[0]+d,x[1]+d),lX=max(x[0]-d,x[1]-d),rY=min(y[0]+d,y[1]+d),lY=max(y[0]-d,y[1]-d);
long long common=area(lX,rX,lY,rY);
long long dX=rX-lX,dY=rY-lY;
long long autoIntersect=area(2*d-dX,dX,2*d-dY,dY);
long long d1,d2;
d1=3*common-2*autoIntersect;
d2=area1+area2-common;
long long G=gcd(d1,d2);
d1/=G,d2/=G;
cout<<"Case #"<<cnt<<": "<<d1<<' '<<d2;
cout<<"\n";
}
int main()
{
//freopen("data.in","r",stdin);
int t=0;
cin>>t;
for(int cnt=1;cnt<=t;cnt++)
solve_testcase(cnt);
return 0;
}
|
helix-datasets/blind-helix
|
evaluation/data/manual-labels/semantic/gcj-2010-509101/Tommalla.c
|
/* Tomasz [Tommalla] Zakrzewski, Google Code Jam 2010 /
/ Qualification Round, Task 'Theme Park' */
/* Optimized approach, complexicity: O(T*R*NlogN) */
#include <cstdio>
#include <algorithm>
#define SIZE 1010
using namespace std;
unsigned int groups[SIZE];
unsigned int sum[SIZE];
unsigned int bsum; //beginning sum
inline bool cmp(const unsigned int &a, const unsigned int &b)
{
return a-bsum<=b;
}
int main()
{
unsigned int t,r,n,k,i,j,result,tempk;
unsigned int* ptr;
unsigned int* ptrEnd;
scanf("%u",&t);
for(i=1,result=0;i<=t;++i,result=0)
{
scanf("%u%u%u",&r,&k,&n);
for(j=0;j<n;++j)
scanf("%u",&groups[j]);
sum[0]=groups[0];
for(j=1;j<n;++j)
sum[j]=sum[j-1]+groups[j];
ptr=sum;
while(r--)
{
bsum=(ptr>sum)?(*(ptr-1)):0;
ptrEnd=lower_bound(ptr,sum+n,k,cmp);
if(ptrEnd==sum+n)
{
result+=*(ptrEnd-1)-bsum;
tempk=k-(*(ptrEnd-1)-bsum);
bsum=0;
ptrEnd=lower_bound(sum,ptr,tempk,cmp);
}
result+=*(ptrEnd-1)-bsum;
ptr=(ptrEnd<sum+n)?ptrEnd:sum;
}
printf("Case #%u: %u\n",i,result);
}
return 0;
}
|
helix-datasets/blind-helix
|
evaluation/data/manual-labels/semantic/gcj-2012-1475486/Xhark.c
|
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <string>
using namespace std;
class Lv{
public:
int L, P, num;
const bool operator < (const Lv l) const {
if (P == 0 && l.P != 0) return false;
if (P != 0 && l.P == 0) return true;
if (P == 0 && l.P == 0) return num < l.num;
// L/P < l.L / l.P
return L*l.P < l.L*P;
}
} dat[1010];
int main(){
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
freopen("A-small-attempt0.in","r",stdin);
freopen("A-small-attempt0.out","w",stdout);
int T;
scanf("%d",&T);
while(T-->0) {
//
int N;
scanf("%d",&N);
int i;
for(i=0;i<N;i++){
scanf("%d",&dat[i].L);
}
for(i=0;i<N;i++){
scanf("%d",&dat[i].P);
}
for(i=0;i<N;i++) dat[i].num = i;
sort(dat, dat+N);
static int cs = 1;
printf("Case #%d:", cs ++);
for(i=0;i<N;i++){
printf(" %d", dat[i].num);
}
printf("\n");
}
return 0;
}
|
helix-datasets/blind-helix
|
evaluation/data/manual-labels/semantic/gcj-2020-00000000003775e9/betrue12.c
|
#include <bits/stdc++.h>
using namespace std;
int64_t gcd(int64_t a, int64_t b){
return b==0 ? a : gcd(b, a%b);
}
void solve(int casenum){
cout << "Case #" << casenum << ": ";
int N;
int64_t D;
cin >> N >> D;
vector<int64_t> XX(N), YY(N);
for(int i=0; i<N; i++){
int x, y;
cin >> x >> y;
XX[i] = x+y, YY[i] = x-y;
}
int64_t X = abs(XX[0] - XX[1]), Y = abs(YY[0] - YY[1]);
if(X > Y) swap(X, Y);
if(Y >= 2*D){
cout << "0 1" << endl;
return;
}
int64_t dx = 2*D-X, dy = 2*D-Y;
int64_t ALL = 8*D*D - dx*dy, active;
if(dy <= D){
active = 3*dx*dy;
}else{
active = ALL - 4*(X-dx)*(Y-dy);
}
int64_t g = gcd(ALL, active);
ALL /= g;
active /= g;
cout << active << " " << ALL << endl;
}
int main() {
int T;
cin >> T;
for(int i=1; i<=T; i++) solve(i);
return 0;
}
|
helix-datasets/blind-helix
|
evaluation/data/manual-labels/semantic/gcj-2010-509101/johny500.c
|
<reponame>helix-datasets/blind-helix<filename>evaluation/data/manual-labels/semantic/gcj-2010-509101/johny500.c<gh_stars>1-10
#include <stdlib.h>
#include <cstdio>
using namespace std;
typedef long long ll;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define FOR(k, a, b) for (typeof(a) k = (a); k < (b); ++k)
#define SIZE(x) ((int)(x).size())
#define NEXT_POS(pos, n) ((pos + 1) % n)
int main() {
int t, r, k, n, pos, nextPos, nextGroup, count;
ll income = 0;
int* g = new int[1000];
scanf("%d\n", &t);
REP(i, t) {
scanf("%d %d %d\n", &r, &k, &n);
REP(j, n) scanf("%d", (g + j));
income = 0;
pos = 0;
REP(j, r) {
count = g[pos];
nextPos = NEXT_POS(pos, n);
nextGroup = g[nextPos];
while (nextPos != pos && count + nextGroup <= k) {
count += nextGroup;
nextPos = NEXT_POS(nextPos, n);
nextGroup = g[nextPos];
}
pos = nextPos;
income += count;
}
printf("Case #%d: %lld\n", i+1, income);
}
return 0;
}
|
helix-datasets/blind-helix
|
evaluation/data/manual-labels/semantic/gcj-2014-5158144455999488/Mosa.c
|
<reponame>helix-datasets/blind-helix
#include <bits/stdc++.h>
using namespace std;
int n, m;
int grid[505][101];
bool vis[505][101];
int di[] = {1, 0, 0, -1};
int dj[] = {0, 1, -1, 0};
int dfs(int i, int j) {
if(vis[i][j]) return 0;
if(i == n - 1) return 1;
vis[i][j] = 1;
for(int k = 0; k < 4; ++k) {
int ni = i + di[k];
int nj = j + dj[k];
if(ni < 0 || ni >= n || nj < 0 || nj >= m || grid[ni][nj] == -1)
continue;
if(dfs(ni, nj))
return 1;
}
return 0;
}
int main() {
freopen("C-small-attempt0.in", "rt", stdin);
freopen("C-small-attempt0.out", "wt", stdout);
int t; scanf("%d", &t);
for(int tst = 1; tst <= t; ++tst) {
int b; scanf("%d %d %d", &m, &n, &b);
memset(grid, 0, sizeof grid);
for(int k = 0; k < b; ++k) {
int i0, j0, i1, j1;
scanf("%d %d %d %d", &j0, &i0, &j1, &i1);
for(int i = i0; i <= i1; ++i)
for(int j = j0; j <= j1; ++j)
grid[i][j] = -1;
}
int ans = 0;
memset(vis, 0, sizeof vis);
for(int j = 0; j < m - 1; ++j) if(grid[0][j] != -1 && !vis[0][j]) {
ans += dfs(0, j);
}
printf("Case #%d: %d\n", tst, ans);
}
return 0;
}
|
helix-datasets/blind-helix
|
evaluation/data/manual-labels/semantic/gcj-2020-00000000003775e9/walnutwaldo20.c
|
#include <bits/stdc++.h>
#define F0R(i, a) for (int i = 0; i < (a); i++)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define R0F(i, a) for (int i = (a) - 1; i >= 0; i--)
#define ROF(i, a, b) for (int i = (b) - 1; i >= (a); i--)
#define ran() (rand() & 0x7FFF)
#define rand31() ((ran() << 16) | (ran() << 1) | (ran() & 1))
#define rand32() ((ran() << 17) | (ran() << 2) | (ran() & 3))
#define rand63() (((ll)ran() << 48) | ((ll)ran() << 33) | ((ll)ran() << 18) | ((ll)ran() << 3) | ((ll)ran() & 7))
#define rand64() (((ll)ran() << 49) | ((ll)ran() << 34) | ((ll)ran() << 19) | ((ll)ran() << 4) | ((ll)ran() & 15))
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define UB upper_bound
#define LB lower_bound
#define X real()
#define Y imag()
#define INF 1e18
#define PI acos(-1)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define SQ(x) ((x) * (x))
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<pii> vpii;
typedef vector<ll> vll;
typedef vector<ull> vul;
typedef complex<ld> point;
typedef complex<ld> cld;
typedef vector<cld> vcld;
struct solution {
int n;
ll d;
vector<pll> v;
solution() {
cin >> n >> d;
F0R(i, n) {
ll x, y;
cin >> x >> y;
v.PB(MP(x + y, x - y));
}
ll sharedx = max(0LL, 2 * d - abs(v[0].F - v[1].F));
ll sharedy = max(0LL, 2 * d - abs(v[0].S - v[1].S));
ll area = sharedx * sharedy;
ll overshare = max(0LL, sharedx - d) * max(0LL, sharedy - d);
print(3 * area - overshare, 8 * d * d - area);
}
ll gcd(ll a, ll b) {
if (a < b) { swap(a, b); }
while (b) {
ll tmp = a % b;
a = b;
b = tmp;
}
return a;
}
void print(ll num, ll den) {
ll g = gcd(num, den);
cout << num / g << " " << den / g << "\n";
}
};
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int testcases;
cin >> testcases;
F0R(i, testcases) {
cout << "Case #" << i + 1 << ": ";
solution s;
}
}
|
helix-datasets/blind-helix
|
evaluation/data/manual-labels/semantic/gcj-2014-5158144455999488/LeeSin.c
|
<gh_stars>1-10
#include <cstdio>
#include <algorithm>
#define N 505
#define M 105
#define fi(a, b, c) for(int a = (b); a < (c); a++)
#define fd(a, b, c) for(int a = (b); a > (c); a--)
#define FI(a, b, c) for(int a = (b); a <= (c); a++)
#define FD(a, b, c) for(int a = (b); a >= (c); a--)
#define fe(a, b, c) for(int a = (b); a; a = c[a])
using namespace std;
int t, n, m, b, dy[] = {1, 0, -1, 0}, dx[] = {0, 1, 0, -1};
bool map[N][M];
bool dfs(int y, int x, int d){
//printf("dfs %d %d %d\n", y, x, d);
map[y][x] = 1;
if(y == n - 1) return 1;
FI(i, -1, 1){
int dir = (d + i + 4) % 4, ny = y + dy[dir], nx = x + dx[dir];
//printf("dir %d\n", dir);
if(ny < 0 || ny >= n || nx < 0 || nx >= m || map[ny][nx]) continue;
if(dfs(ny, nx, dir)) return 1;
}
return 0;
}
void solve(){
scanf("%d %d %d", &m, &n, &b);
fi(i, 0, n) fi(j, 0, m) map[i][j] = 0;
fi(i, 0, b){
int x0, y0, x1, y1;
scanf("%d %d %d %d", &x0, &y0, &x1, &y1);
FI(j, y0, y1) FI(k, x0, x1) map[j][k] = 1;
}
int ans = 0;
fi(i, 0, m) if(!map[0][i]){
//printf("try %d\n", i);
ans += dfs(0, i, 0);
}
printf("%d\n", ans);
}
int main(){
freopen("C-small-attempt0.in", "r", stdin);
freopen("C-small-attempt0.out", "w", stdout);
scanf("%d", &t);
FI(z, 1, t){
printf("Case #%d: ", z);
solve();
}
scanf("\n");
}
|
helix-datasets/blind-helix
|
evaluation/data/manual-labels/semantic/gcj-2010-509101/Prahadeesh.c
|
<filename>evaluation/data/manual-labels/semantic/gcj-2010-509101/Prahadeesh.c
#include <iostream>
using namespace std;
long long g[1001],t[1001];
long long find(long long r,long long k,long long n)
{
long long res=0,temp,i,j,ptr,count=0,flag,car;
while(count < r)
{
//cout<<"\n inside start While 1 of FIND with count ="<<count<<" and res ="<<res;
count++;
temp = 0;
ptr = 0;
flag = 0;
while(temp <= k && flag == 0)
{
//cout<<"\n inside start While 2 of FIND with temp ="<<temp<<" and ptr ="<<ptr ;
if(ptr<n)
temp+=g[ptr++];
else
{
flag = 1;
}
//cout<<"\n inside end While 2 of FIND with temp ="<<temp<<" and ptr ="<<ptr ;
}
if(flag == 0 && temp > k)
{
temp-=g[--ptr];
}
//cout<<"\n tenp before res:"<<temp<<" and res:"<<res;
res += temp;
/*Array Modification*/
if(flag == 0)
{
//cout<<"\n In Array mod with ptr:"<<ptr;
for(i=0;(ptr+i)<n;i++)
{
t[i]= g[ptr+i];
}
car = i;
for(i=car;i<n;i++)
{
t[i]= g[i-car];
}
for(i=0;i<n;i++)
g[i]=t[i];
/* //Array printing
cout<<endl;
for(i=0;i<n;i++)
cout<<" "<<g[i];*/
}
//cout<<"\n inside end While 1 of FIND with count ="<<count<<" and res ="<<res;
}
return res;
}
int main()
{
long long t,r,n,k,i,cnt,ans,tans;
cin>>t;
cnt = 0;
// tans = find(4,6,4);
//cout<<"\n"<<tans;
while(cnt < t)
{
cnt++;
cin>>r>>k>>n;
for(i=0;i<n;i++)
cin>>g[i];
ans = find(r,k,n);
cout<<"\nCase #"<<cnt<<": "<<ans;
}
return 0;
}
|
helix-datasets/blind-helix
|
evaluation/data/manual-labels/semantic/gcj-2014-5158144455999488/daimi89.c
|
#include <iostream>
#include <algorithm>
using namespace std;
bool empty[100][500];
int dx[4] = { -1,0,1,0 };
int dy[4] = { 0,1,0,-1 };
int W,H;
int dfs(int x,int y,int d) {
// d = direction comming from: 0=down, 1=left, 2=up, 3=right
// cout << "Visit: " << x <<"," << y << " from " << d << endl;
if (x<0 || x>=W || y<0 || y>=H || ! empty[x][y] ) return false;
empty[x][y] = false;
if (y==H-1) return true; // found a flow
for (int i=1; i<=4; i++) {
int dir = (d+i) % 4;
if (dfs (x+dx[dir],y+dy[dir],(dir+2)%4 ))
return true;
}
return false;
};
int main () {
int T,B;
cin >> T;
for (int t=1; t<=T; t++) {
cin >> W >> H >> B;
for (int x=0; x<W; x++)
for (int y=0; y<H; y++)
empty[x][y] = true;
for (int i=0; i<B; i++) {
int x0,y0,x1,y1;
cin >> x0 >> y0 >> x1 >> y1;;
for (int x=x0; x<=x1; x++)
for (int y=y0; y<=y1; y++)
empty[x][y] = false;
}
int flow=0;
for (int x=0; x<W; x++)
if (dfs(x,0,0)) flow++;
cout << "Case #" << t << ": " << flow << endl;
};
};
|
helix-datasets/blind-helix
|
evaluation/data/manual-labels/semantic/gcj-2012-1475486/ytau.c
|
#include <iostream>
#include <iomanip>
#include <fstream>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <sstream>
#include <string>
#include <bitset>
#include <deque>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <utility>
using namespace std;
const int inf = 2000000000;
const long long linf = 9000000000000000000LL;
const double finf = 1.0e18;
const double eps = 1.0e-8;
int T, n, l[1005], p[1005], o[1005];
bool fo(int i, int j) {
return p[i]>p[j];
}
int main() {
scanf("%d",&T);
for (int tt=1; tt<=T; tt++) {
scanf("%d",&n);
for (int i=0; i<n; i++) {
scanf("%d",&l[i]);
}
for (int i=0; i<n; i++) {
scanf("%d",&p[i]);
}
for (int i=0; i<n; i++) {
o[i] = i;
}
stable_sort(o, o+n, fo);
printf("Case #%d:", tt);
for (int i=0; i<n; i++) {
printf(" %d", o[i]);
}
printf("\n");
}
return 0;
}
|
helix-datasets/blind-helix
|
evaluation/data/manual-labels/semantic/gcj-2012-1475486/Aleksei.c
|
#include <iostream>
#include <fstream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <string>
#include <cmath>
#include <stdlib.h>
#include <string.h>
#include <iomanip>
using namespace std;
struct str{
int num;
int prob;
int l;
bool operator<(const str& o)const{
if(prob!=o.prob) return prob>o.prob;
if(l!=o.l) return l>o.l;
return num<o.num;
}
};
str a[1100];
int main(){
ifstream cin("input.txt");
ofstream cout("output.txt");
int ntests;
cin>>ntests;
for(int testnum=0; testnum<ntests; testnum++){
int n;
cin>>n;
for(int i=0; i<n; i++){
a[i].num = i;
cin>>a[i].l;
}
for(int i=0; i<n; i++){
cin>>a[i].prob;
}
sort(&a[0],&a[n]);
cout<<"Case #"<<testnum+1<<":";
for(int i=0; i<n; i++) cout<<' '<<a[i].num;
cout<<endl;
}
return 0;
}
|
Balearica/tesseract
|
include/tesseract/ltrresultiterator.h
|
// SPDX-License-Identifier: Apache-2.0
// File: ltrresultiterator.h
// Description: Iterator for tesseract results in strict left-to-right
// order that avoids using tesseract internal data structures.
// Author: <NAME>
//
// (C) Copyright 2010, Google Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef TESSERACT_CCMAIN_LTR_RESULT_ITERATOR_H_
#define TESSERACT_CCMAIN_LTR_RESULT_ITERATOR_H_
#include "export.h" // for TESS_API
#include "pageiterator.h" // for PageIterator
#include "publictypes.h" // for PageIteratorLevel
#include "unichar.h" // for StrongScriptDirection
namespace tesseract {
class WERD_CHOICE_IT;
class BLOB_CHOICE_IT;
class PAGE_RES;
class WERD_RES;
class Tesseract;
// Class to iterate over tesseract results, providing access to all levels
// of the page hierarchy, without including any tesseract headers or having
// to handle any tesseract structures.
// WARNING! This class points to data held within the TessBaseAPI class, and
// therefore can only be used while the TessBaseAPI class still exists and
// has not been subjected to a call of Init, SetImage, Recognize, Clear, End
// DetectOS, or anything else that changes the internal PAGE_RES.
// See tesseract/publictypes.h for the definition of PageIteratorLevel.
// See also base class PageIterator, which contains the bulk of the interface.
// LTRResultIterator adds text-specific methods for access to OCR output.
class TESS_API LTRResultIterator : public PageIterator {
friend class ChoiceIterator;
friend class WordChoiceIterator;
public:
// page_res and tesseract come directly from the BaseAPI.
// The rectangle parameters are copied indirectly from the Thresholder,
// via the BaseAPI. They represent the coordinates of some rectangle in an
// original image (in top-left-origin coordinates) and therefore the top-left
// needs to be added to any output boxes in order to specify coordinates
// in the original image. See TessBaseAPI::SetRectangle.
// The scale and scaled_yres are in case the Thresholder scaled the image
// rectangle prior to thresholding. Any coordinates in tesseract's image
// must be divided by scale before adding (rect_left, rect_top).
// The scaled_yres indicates the effective resolution of the binary image
// that tesseract has been given by the Thresholder.
// After the constructor, Begin has already been called.
LTRResultIterator(PAGE_RES *page_res, Tesseract *tesseract, int scale,
int scaled_yres, int rect_left, int rect_top,
int rect_width, int rect_height);
~LTRResultIterator() override;
// LTRResultIterators may be copied! This makes it possible to iterate over
// all the objects at a lower level, while maintaining an iterator to
// objects at a higher level. These constructors DO NOT CALL Begin, so
// iterations will continue from the location of src.
// TODO: For now the copy constructor and operator= only need the base class
// versions, but if new data members are added, don't forget to add them!
// ============= Moving around within the page ============.
// See PageIterator.
// ============= Accessing data ==============.
// Returns the null terminated UTF-8 encoded text string for the current
// object at the given level. Use delete [] to free after use.
char *GetUTF8Text(PageIteratorLevel level) const;
// Set the string inserted at the end of each text line. "\n" by default.
void SetLineSeparator(const char *new_line);
// Set the string inserted at the end of each paragraph. "\n" by default.
void SetParagraphSeparator(const char *new_para);
// Returns the mean confidence of the current object at the given level.
// The number should be interpreted as a percent probability. (0.0f-100.0f)
float Confidence(PageIteratorLevel level) const;
// ============= Functions that refer to words only ============.
// Returns the font attributes of the current word. If iterating at a higher
// level object than words, eg textlines, then this will return the
// attributes of the first word in that textline.
// The actual return value is a string representing a font name. It points
// to an internal table and SHOULD NOT BE DELETED. Lifespan is the same as
// the iterator itself, ie rendered invalid by various members of
// TessBaseAPI, including Init, SetImage, End or deleting the TessBaseAPI.
// Pointsize is returned in printers points (1/72 inch.)
const char *WordFontAttributes(bool *is_bold, bool *is_italic,
bool *is_underlined, bool *is_monospace,
bool *is_serif, bool *is_smallcaps,
int *pointsize, int *font_id) const;
// Return the name of the language used to recognize this word.
// On error, nullptr. Do not delete this pointer.
const char *WordRecognitionLanguage() const;
// Return the overall directionality of this word.
StrongScriptDirection WordDirection() const;
// Returns true if the current word was found in a dictionary.
bool WordIsFromDictionary() const;
// Returns the number of blanks before the current word.
int BlanksBeforeWord() const;
// Returns true if the current word is numeric.
bool WordIsNumeric() const;
// Returns true if the word contains blamer information.
bool HasBlamerInfo() const;
// Returns the pointer to ParamsTrainingBundle stored in the BlamerBundle
// of the current word.
const void *GetParamsTrainingBundle() const;
// Returns a pointer to the string with blamer information for this word.
// Assumes that the word's blamer_bundle is not nullptr.
const char *GetBlamerDebug() const;
// Returns a pointer to the string with misadaption information for this word.
// Assumes that the word's blamer_bundle is not nullptr.
const char *GetBlamerMisadaptionDebug() const;
// Returns true if a truth string was recorded for the current word.
bool HasTruthString() const;
// Returns true if the given string is equivalent to the truth string for
// the current word.
bool EquivalentToTruth(const char *str) const;
// Returns a null terminated UTF-8 encoded truth string for the current word.
// Use delete [] to free after use.
char *WordTruthUTF8Text() const;
// Returns a null terminated UTF-8 encoded normalized OCR string for the
// current word. Use delete [] to free after use.
char *WordNormedUTF8Text() const;
// Returns a pointer to serialized choice lattice.
// Fills lattice_size with the number of bytes in lattice data.
const char *WordLattice(int *lattice_size) const;
// ============= Functions that refer to symbols only ============.
// Returns true if the current symbol is a superscript.
// If iterating at a higher level object than symbols, eg words, then
// this will return the attributes of the first symbol in that word.
bool SymbolIsSuperscript() const;
// Returns true if the current symbol is a subscript.
// If iterating at a higher level object than symbols, eg words, then
// this will return the attributes of the first symbol in that word.
bool SymbolIsSubscript() const;
// Returns true if the current symbol is a dropcap.
// If iterating at a higher level object than symbols, eg words, then
// this will return the attributes of the first symbol in that word.
bool SymbolIsDropcap() const;
protected:
const char *line_separator_;
const char *paragraph_separator_;
};
// Class to iterate over the classifier choices for a single RIL_SYMBOL.
class TESS_API ChoiceIterator {
public:
// Construction is from a LTRResultIterator that points to the symbol of
// interest. The ChoiceIterator allows a one-shot iteration over the
// choices for this symbol and after that is is useless.
explicit ChoiceIterator(const LTRResultIterator &result_it);
~ChoiceIterator();
// Moves to the next choice for the symbol and returns false if there
// are none left.
bool Next();
// ============= Accessing data ==============.
// Returns the null terminated UTF-8 encoded text string for the current
// choice.
// NOTE: Unlike LTRResultIterator::GetUTF8Text, the return points to an
// internal structure and should NOT be delete[]ed to free after use.
const char *GetUTF8Text() const;
// Returns the confidence of the current choice depending on the used language
// data. If only LSTM traineddata is used the value range is 0.0f - 1.0f. All
// choices for one symbol should roughly add up to 1.0f.
// If only traineddata of the legacy engine is used, the number should be
// interpreted as a percent probability. (0.0f-100.0f) In this case
// probabilities won't add up to 100. Each one stands on its own.
float Confidence() const;
// Returns a vector containing all timesteps, which belong to the currently
// selected symbol. A timestep is a vector containing pairs of symbols and
// floating point numbers. The number states the probability for the
// corresponding symbol.
std::vector<std::vector<std::pair<const char *, float>>> *Timesteps() const;
private:
// clears the remaining spaces out of the results and adapt the probabilities
void filterSpaces();
// Pointer to the WERD_RES object owned by the API.
WERD_RES *word_res_;
// Iterator over the blob choices.
BLOB_CHOICE_IT *choice_it_;
std::vector<std::pair<const char *, float>> *LSTM_choices_ = nullptr;
std::vector<std::pair<const char *, float>>::iterator LSTM_choice_it_;
const int *tstep_index_;
// regulates the rating granularity
double rating_coefficient_;
// leading blanks
int blanks_before_word_;
// true when there is lstm engine related trained data
bool oemLSTM_;
};
// Class to iterate over the classifier choices for a single RIL_SYMBOL.
class WordChoiceIterator {
public:
// Construction is from a LTRResultIterator that points to the symbol of
// interest. The WordChoiceIterator allows a one-shot iteration over the
// choices for this symbol and after that is is useless.
explicit WordChoiceIterator(const LTRResultIterator& result_it);
~WordChoiceIterator();
// Moves to the next choice for the symbol and returns false if there
// are none left.
bool Next();
// ============= Accessing data ==============.
// Returns the null terminated UTF-8 encoded text string for the current
// choice.
// NOTE: Unlike LTRResultIterator::GetUTF8Text, the return points to an
// internal structure and should NOT be delete[]ed to free after use.
const char* GetUTF8Text() const;
// Returns the confidence of the current choice.
// The number should be interpreted as a percent probability. (0.0f-100.0f)
float Confidence() const;
private:
// Pointer to the WERD_RES object owned by the API.
WERD_RES* word_res_;
// Iterator over the blob choices.
WERD_CHOICE_IT* choice_it_;
};
} // namespace tesseract.
#endif // TESSERACT_CCMAIN_LTR_RESULT_ITERATOR_H_
|
Conrekatsu/rawaccel
|
common/rawaccel-io-def.h
|
<filename>common/rawaccel-io-def.h
#pragma once
#define NOMINMAX
#ifdef _KERNEL_MODE
#include <ntddk.h>
#else
#include <Windows.h>
#endif
namespace rawaccel {
constexpr ULONG READ = (ULONG)CTL_CODE(0x8888u, 0x888, METHOD_BUFFERED, FILE_ANY_ACCESS);
constexpr ULONG WRITE = (ULONG)CTL_CODE(0x8888u, 0x889, METHOD_BUFFERED, FILE_ANY_ACCESS);
constexpr ULONG GET_VERSION = (ULONG)CTL_CODE(0x8888u, 0x88a, METHOD_BUFFERED, FILE_ANY_ACCESS);
}
|
Conrekatsu/rawaccel
|
driver/driver.h
|
#pragma once
#include "rawaccel.hpp"
#include "rawaccel-io-def.h"
#include <kbdmou.h>
#include <wdf.h>
#if DBG
#define DebugPrint(_x_) DbgPrint _x_
#else
#define DebugPrint(_x_)
#endif
#define NTDEVICE_NAME L"\\Device\\rawaccel"
#define SYMBOLIC_NAME_STRING L"\\DosDevices\\rawaccel"
using counter_t = long long;
namespace ra = rawaccel;
typedef struct _DEVICE_EXTENSION {
bool enable;
bool keep_time;
bool set_extra_info;
double dpi_factor;
counter_t counter;
ra::time_clamp clamp;
ra::modifier mod;
vec2d carry;
CONNECT_DATA UpperConnectData;
ra::modifier_settings mod_settings;
WCHAR dev_id[ra::MAX_DEV_ID_LEN];
} DEVICE_EXTENSION, *PDEVICE_EXTENSION;
WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(DEVICE_EXTENSION, FilterGetData)
EXTERN_C_START
DRIVER_INITIALIZE DriverEntry;
EVT_WDF_DRIVER_DEVICE_ADD EvtDeviceAdd;
EVT_WDF_IO_QUEUE_IO_INTERNAL_DEVICE_CONTROL EvtIoInternalDeviceControl;
EVT_WDF_IO_QUEUE_IO_DEVICE_CONTROL RawaccelControl;
EVT_WDF_OBJECT_CONTEXT_CLEANUP DeviceCleanup;
VOID DeviceSetup(WDFOBJECT);
VOID WriteDelay(VOID);
VOID RawaccelInit(WDFDRIVER);
NTSTATUS CreateControlDevice(WDFDRIVER);
EXTERN_C_END
VOID RawaccelCallback(
IN PDEVICE_OBJECT DeviceObject,
IN PMOUSE_INPUT_DATA InputDataStart,
IN PMOUSE_INPUT_DATA InputDataEnd,
IN OUT PULONG InputDataConsumed
);
VOID DispatchPassThrough(
_In_ WDFREQUEST Request,
_In_ WDFIOTARGET Target
);
|
Conrekatsu/rawaccel
|
wrapper/interop-exception.h
|
<filename>wrapper/interop-exception.h
#pragma once
#include <exception>
public ref struct InteropException : System::Exception {
InteropException(System::String^ what) :
Exception(what) {}
InteropException(const char* what) :
Exception(gcnew System::String(what)) {}
InteropException(const std::exception& e) :
InteropException(e.what()) {}
};
|
Conrekatsu/rawaccel
|
common/rawaccel-version.h
|
#pragma once
#define RA_VER_MAJOR 1
#define RA_VER_MINOR 6
#define RA_VER_PATCH 0
#define RA_OS "Win10+"
#define RA_M_STR_HELPER(x) #x
#define RA_M_STR(x) RA_M_STR_HELPER(x)
#define RA_VER_STRING RA_M_STR(RA_VER_MAJOR) "." RA_M_STR(RA_VER_MINOR) "." RA_M_STR(RA_VER_PATCH)
namespace rawaccel {
struct version_t {
int major;
int minor;
int patch;
};
constexpr bool operator<(const version_t& lhs, const version_t& rhs)
{
return (lhs.major != rhs.major) ?
(lhs.major < rhs.major) :
(lhs.minor != rhs.minor) ?
(lhs.minor < rhs.minor) :
(lhs.patch < rhs.patch) ;
}
inline constexpr version_t version = { RA_VER_MAJOR, RA_VER_MINOR, RA_VER_PATCH };
#ifndef _KERNEL_MODE
inline constexpr version_t min_driver_version = { 1, 6, 0 };
#endif
}
|
Conrekatsu/rawaccel
|
wrapper/input.h
|
#pragma once
#pragma comment(lib, "cfgmgr32.lib")
#pragma comment(lib, "hid.lib")
#pragma comment(lib, "User32.lib")
#include <string_view>
#include <vector>
#include <Windows.h>
#include <cfgmgr32.h>
#include <initguid.h> // needed for devpkey.h to parse properly
#include <devpkey.h>
#include <hidsdi.h>
inline constexpr size_t MAX_DEV_ID_LEN = 200;
inline constexpr size_t MAX_NAME_LEN = 256;
inline constexpr UINT RI_ERROR = -1;
struct rawinput_device {
HANDLE handle = nullptr; // rawinput handle
WCHAR name[MAX_NAME_LEN] = {}; // manufacturer + product
WCHAR id[MAX_DEV_ID_LEN] = {}; // hwid formatted device id
};
template <typename Func>
void rawinput_foreach(Func fn, DWORD device_type = RIM_TYPEMOUSE)
{
const size_t HID_STR_MAX_LEN = 127;
auto starts_with = [](auto&& a, auto&& b) {
return b.size() <= a.size() && std::equal(b.begin(), b.end(), a.begin());
};
auto get_dev_list = []() -> std::vector<RAWINPUTDEVICELIST> {
UINT elem_size = sizeof(RAWINPUTDEVICELIST);
UINT num_devs = 0;
if (GetRawInputDeviceList(NULL, &num_devs, elem_size) == 0) {
auto dev_list = std::vector<RAWINPUTDEVICELIST>(num_devs);
if (GetRawInputDeviceList(&dev_list[0], &num_devs, elem_size) != RI_ERROR) {
return dev_list;
}
}
return {};
};
std::wstring interface_name;
rawinput_device dev;
DEVPROPTYPE prop_type;
CONFIGRET cm_res;
WCHAR product_str_buf[HID_STR_MAX_LEN] = {};
for (auto [handle, dev_type] : get_dev_list()) {
if (dev_type != device_type) continue;
dev.handle = handle;
// get interface name
UINT name_len = 0;
if (GetRawInputDeviceInfoW(handle, RIDI_DEVICENAME, NULL, &name_len) == RI_ERROR) {
continue;
}
interface_name.resize(name_len);
if (GetRawInputDeviceInfoW(handle, RIDI_DEVICENAME, &interface_name[0], &name_len) == RI_ERROR) {
continue;
}
// make name from vendor + product
HANDLE hid_dev_object = CreateFileW(
&interface_name[0], 0, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
if (hid_dev_object != INVALID_HANDLE_VALUE) {
if (HidD_GetProductString(hid_dev_object, product_str_buf, HID_STR_MAX_LEN)) {
auto product_sv = std::wstring_view(product_str_buf);
if (HidD_GetManufacturerString(hid_dev_object, dev.name, HID_STR_MAX_LEN)) {
auto manufacturer_sv = std::wstring_view(dev.name);
if (starts_with(product_sv, manufacturer_sv)) {
wcsncpy_s(dev.name, product_str_buf, HID_STR_MAX_LEN);
}
else {
auto last = manufacturer_sv.size();
dev.name[last] = L' ';
wcsncpy_s(dev.name + last + 1, HID_STR_MAX_LEN, product_str_buf, HID_STR_MAX_LEN);
}
}
else {
wcsncpy_s(dev.name, product_str_buf, HID_STR_MAX_LEN);
}
}
else {
dev.name[0] = L'\0';
}
CloseHandle(hid_dev_object);
}
else {
dev.name[0] = L'\0';
}
// get device instance id
ULONG id_size = 0;
cm_res = CM_Get_Device_Interface_PropertyW(&interface_name[0], &DEVPKEY_Device_InstanceId,
&prop_type, NULL, &id_size, 0);
if (cm_res != CR_BUFFER_SMALL && cm_res != CR_SUCCESS) continue;
cm_res = CM_Get_Device_Interface_PropertyW(&interface_name[0], &DEVPKEY_Device_InstanceId,
&prop_type, reinterpret_cast<PBYTE>(&dev.id[0]), &id_size, 0);
if (cm_res != CR_SUCCESS) continue;
// pop instance id
auto instance_delim_pos = std::wstring_view(dev.id).find_last_of(L'\\');
if (instance_delim_pos != std::string::npos) {
dev.id[instance_delim_pos] = L'\0';
}
fn(dev);
}
}
|
BackupTheBerlios/ocarrot
|
include/ocarrot/ocarrot.h
|
#ifndef OCARROT_OCARROT_H_GUARD
#define OCARROT_OCARROT_H_GUARD
#include "pmc_caml_value.h"
#include "pmc_caml_block.h"
#define OCarrot_Value_is_boxed PObj_private0_FLAG
#define ocarrot_words(x) ((x + PTR_SIZE - 1) / PTR_SIZE)
#define No_scan_tag 255
#define Closure_tag (No_scan_tag + 1)
#define String_tag (No_scan_tag + 2)
#define Double_tag (No_scan_tag + 3)
#define Double_array_tag (No_scan_tag + 4)
#define Abstract_tag (No_scan_tag + 5)
#define Custom_tag (No_scan_tag + 6)
#endif /* OCARROT_OCARROT_H_GUARD */
|
alinamuliak/assembly
|
main_c2.c
|
<reponame>alinamuliak/assembly<filename>main_c2.c
#include <stdint.h>
#include <stdio.h>
void func (float* a, float* b, float* x, size_t size);
int main() {
printf("Hello world!\n");
float a1[] = {1, 2, 10};
float b1[] = {2, 1, 0};
float x1[] = {0, 0, 0};
size_t size1 = 3;
printf("\nExample #1:\n");
printf("array a: [%.2f, %.2f, %.2f]\n", a1[0], a1[1], a1[2]);
printf("array b: [%.2f, %.2f, %.2f]\n", b1[0], b1[1], b1[2]);
func(a1, b1, x1, size1);
printf("array x: [%.2f, %.2f, %.2f]\n", x1[0], x1[1], x1[2]);
float a2[] = {2.0, 6.0, -20.25, 1.0, 0.0};
float b2[] = {1.0, -3.0, 30.50, 5.77, 8.0};
float x2[] = {0, 0, 0, 0, 0};
size_t size2 = 5;
printf("\nExample #2:\n");
printf("array a: [%.2f, %.2f, %.2f, %.2f, %.2f]\n", a2[0], a2[1], a2[2], a2[3], a2[4]);
printf("array b: [%.2f, %.2f, %.2f, %.2f, %.2f]\n", b2[0], b2[1], b2[2], b2[3], b2[4]);
func(a2, b2, x2, size2);
printf("array x: [%.2f, %.2f, %.2f, %.2f, %.2f]\n", x2[0], x2[1], x2[2], x2[3], x2[4]);
float a3[] = {2.05, -1, -1819, 1.0, 0.0, -5.55};
float b3[] = {-1.025, 777.777, 3628, 12345654, -26.10};
float x3[] = {0, 0, 0, 0, 0};
size_t size3 = 6;
printf("\nExample #3:\n");
printf("array a: [%.3f, %.3f, %.3f, %.3f, %.3f, %.3f]\n", a3[0], a3[1], a3[2], a3[3], a3[4], a3[5]);
printf("array b: [%.3f, %.3f, %.3f, %.3f, %.3f, %.3f]\n", b3[0], b3[1], b3[2], b3[3], b3[4], b3[5]);
func(a3, b3, x3, size3);
printf("array x: [%.3f, %.3f, %.3f, %.3f, %.3f, %.3f]\n", x3[0], x3[1], x3[2], x3[3], x3[4], b3[5]);
printf("\nDone!:))\n");
return 0;
}
|
alinamuliak/assembly
|
main_c1.c
|
#include <stdint.h>
#include <stdio.h>
void func (int32_t* input_array, size_t size);
int main() {
printf("Hello world!\n");
int32_t a1[] = {4, -5, 3, 2, 7, 1, 6};
size_t size1 = 7;
printf("\nExample #1:\nstarting array: [%d, %d, %d, %d, %d, %d, %d]\n", size1, a1[0], a1[1], a1[2], a1[3], a1[4], a1[5], a1[6]);
func(a1, size1);
printf("sorted array: [%d, %d, %d, %d, %d, %d, %d]\n", a1[0], a1[1], a1[2], a1[3], a1[4], a1[5], a1[6]);
int32_t a2[] = {-10, -9, -8, -3456789, 98765, 567};
size_t size2 = 6;
printf("\nExample #2:\nstarting array: [%d, %d, %d, %d, %d, %d]\n", size2, a2[0], a2[1], a2[2], a2[3], a2[4], a2[5]);
func(a2, size2);
printf("sorted array: [%d, %d, %d, %d, %d, %d]\n", a2[0], a2[1], a2[2], a2[3], a2[4], a2[5]);
int32_t a3[] = {1000000, 9999, 777, -284531, 5, 0};
size_t size3 = 6;
printf("\nExample #3:\nstarting array: [%d, %d, %d, %d, %d, %d]\n", size3, a3[0], a3[1], a3[2], a3[3], a3[4], a3[5]);
func(a3, size3);
printf("sorted array: [%d, %d, %d, %d, %d, %d]\n", a3[0], a3[1], a3[2], a3[3], a3[4], a3[5]);
printf("\nDone!:)\n");
return 0;
}
|
akshaybabloo/qlistwidget-custom-widget
|
customwidget.h
|
<filename>customwidget.h
#ifndef CUSTOMWIDGET_H
#define CUSTOMWIDGET_H
#include <QWidget>
namespace Ui {
class CustomWidget;
}
class CustomWidget : public QWidget
{
Q_OBJECT
public:
explicit CustomWidget(QWidget *parent = nullptr);
~CustomWidget();
void setText(const QString &text);
QString getText();
signals:
void sendRemoveItem(const QString &text);
private slots:
void on_toolButton_clicked();
private:
Ui::CustomWidget *ui;
};
#endif // CUSTOMWIDGET_H
|
donaldschen/mynewt-nimble
|
nimble/drivers/nrf52/include/ble/palna.h
|
<reponame>donaldschen/mynewt-nimble
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef H_BLE_PALNA_
#define H_BLE_PALNA_
#ifdef __cplusplus
extern "C" {
#endif
#define PALNA_GPIOTE_CHANNEL 0
#define PALNA_PPI_CHANNEL_RADIO_READY 0
#define PALNA_PPI_CHANNEL_RADIO_DISABLED 1
#define PALNA_PPI_CHANNEL_MASK ((1 << PALNA_PPI_CHANNEL_RADIO_READY) | \
(1 << PALNA_PPI_CHANNEL_RADIO_DISABLED))
#ifdef __cplusplus
}
#endif
#endif /* H_BLE_PALNA_ */
|
donaldschen/mynewt-nimble
|
nimble/host/mesh/src/app_keys.c
|
/*
* Copyright (c) 2017 Intel Corporation
* Copyright (c) 2020 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <string.h>
#include <stdlib.h>
#include "mesh/mesh.h"
#include "mesh_priv.h"
#include "net.h"
#include "app_keys.h"
#include "rpl.h"
#include "settings.h"
#include "crypto.h"
#include "adv.h"
#include "proxy.h"
#include "friend.h"
#include "foundation.h"
#include "access.h"
#include "subnet.h"
#define MESH_LOG_MODULE BLE_MESH_LOG
#include "log/log.h"
static struct bt_mesh_app_key apps[CONFIG_BT_MESH_APP_KEY_COUNT] = {
[0 ... (CONFIG_BT_MESH_APP_KEY_COUNT - 1)] = {
.app_idx = BT_MESH_KEY_UNUSED,
.net_idx = BT_MESH_KEY_UNUSED,
}
};
static void app_key_evt(struct bt_mesh_app_key *app, enum bt_mesh_key_evt evt)
{
int i;
for (i = 0; i < (sizeof(bt_mesh_app_key_cb_list)/sizeof(void *)); i++) {
if (bt_mesh_app_key_cb_list[i]) {
BT_DBG("app_key_evt %d", i);
bt_mesh_app_key_cb_list[i] (app->app_idx, app->net_idx, evt);
}
}
}
struct bt_mesh_app_key *app_get(uint16_t app_idx)
{
for (int i = 0; i < ARRAY_SIZE(apps); i++) {
if (apps[i].app_idx == app_idx) {
return &apps[i];
}
}
return NULL;
}
static struct bt_mesh_app_key *app_key_alloc(uint16_t app_idx)
{
struct bt_mesh_app_key *app = NULL;
for (int i = 0; i < ARRAY_SIZE(apps); i++) {
/* Check for already existing app_key */
if (apps[i].app_idx == app_idx) {
return &apps[i];
}
if (!app && apps[i].app_idx == BT_MESH_KEY_UNUSED) {
app = &apps[i];
}
}
return app;
}
static void app_key_del(struct bt_mesh_app_key *app)
{
BT_DBG("AppIdx 0x%03x", app->app_idx);
if (IS_ENABLED(CONFIG_BT_SETTINGS)) {
bt_mesh_clear_app_key(app->app_idx);
}
app_key_evt(app, BT_MESH_KEY_DELETED);
app->net_idx = BT_MESH_KEY_UNUSED;
app->app_idx = BT_MESH_KEY_UNUSED;
(void)memset(app->keys, 0, sizeof(app->keys));
}
static void app_key_revoke(struct bt_mesh_app_key *app)
{
if (!app->updated) {
return;
}
memcpy(&app->keys[0], &app->keys[1], sizeof(app->keys[0]));
memset(&app->keys[1], 0, sizeof(app->keys[1]));
app->updated = false;
if (IS_ENABLED(CONFIG_BT_SETTINGS)) {
bt_mesh_store_app_key(app->app_idx);
}
app_key_evt(app, BT_MESH_KEY_REVOKED);
}
static void subnet_evt(struct bt_mesh_subnet *sub, enum bt_mesh_key_evt evt)
{
if (evt == BT_MESH_KEY_UPDATED || evt == BT_MESH_KEY_ADDED) {
return;
}
for (int i = 0; i < ARRAY_SIZE(apps); i++) {
struct bt_mesh_app_key *app = &apps[i];
if (app->app_idx == BT_MESH_KEY_UNUSED) {
continue;
}
if (app->net_idx != sub->net_idx) {
continue;
}
if (evt == BT_MESH_KEY_DELETED) {
app_key_del(app);
} else if (evt == BT_MESH_KEY_REVOKED) {
app_key_revoke(app);
} else if (evt == BT_MESH_KEY_SWAPPED && app->updated) {
app_key_evt(app, BT_MESH_KEY_SWAPPED);
}
}
}
uint8_t bt_mesh_app_key_add(uint16_t app_idx, uint16_t net_idx,
const uint8_t key[16])
{
if (!bt_mesh_subnet_cb_list[0]) {
bt_mesh_subnet_cb_list[0] = subnet_evt;
}
struct bt_mesh_app_key *app;
BT_DBG("net_idx 0x%04x app_idx %04x val %s", net_idx, app_idx,
bt_hex(key, 16));
if (!bt_mesh_subnet_get(net_idx)) {
return STATUS_INVALID_NETKEY;
}
app = app_key_alloc(app_idx);
if (!app) {
return STATUS_INSUFF_RESOURCES;
}
if (app->app_idx == app_idx) {
if (app->net_idx != net_idx) {
return STATUS_INVALID_BINDING;
}
if (memcmp(key, app->keys[0].val, 16)) {
return STATUS_IDX_ALREADY_STORED;
}
return STATUS_SUCCESS;
}
if (bt_mesh_app_id(key, &app->keys[0].id)) {
return STATUS_CANNOT_SET;
}
BT_DBG("AppIdx 0x%04x AID 0x%02x", app_idx, app->keys[0].id);
app->net_idx = net_idx;
app->app_idx = app_idx;
app->updated = false;
memcpy(app->keys[0].val, key, 16);
if (IS_ENABLED(CONFIG_BT_SETTINGS)) {
BT_DBG("Storing AppKey persistently");
bt_mesh_store_app_key(app->app_idx);
}
app_key_evt(app, BT_MESH_KEY_ADDED);
return STATUS_SUCCESS;
}
struct bt_mesh_app_key *bt_mesh_app_key_get(uint16_t app_idx)
{
struct bt_mesh_app_key *app;
app = app_get(app_idx);
if (app) {
return app;
}
return NULL;
}
uint8_t bt_mesh_app_key_update(uint16_t app_idx, uint16_t net_idx,
const uint8_t key[16])
{
struct bt_mesh_app_key *app;
struct bt_mesh_subnet *sub;
BT_DBG("net_idx 0x%04x app_idx %04x val %s", net_idx, app_idx,
bt_hex(key, 16));
app = app_get(app_idx);
if (!app) {
return STATUS_INVALID_APPKEY;
}
if (net_idx != BT_MESH_KEY_UNUSED && app->net_idx != net_idx) {
return STATUS_INVALID_BINDING;
}
sub = bt_mesh_subnet_get(app->net_idx);
if (!sub) {
return STATUS_INVALID_NETKEY;
}
/* The AppKey Update message shall generate an error when node
* is in normal operation, Phase 2, or Phase 3 or in Phase 1
* when the AppKey Update message on a valid AppKeyIndex when
* the AppKey value is different.
*/
if (sub->kr_phase != BT_MESH_KR_PHASE_1) {
return STATUS_CANNOT_UPDATE;
}
if (app->updated) {
if (memcmp(app->keys[1].val, key, 16)) {
return STATUS_IDX_ALREADY_STORED;
}
return STATUS_SUCCESS;
}
if (bt_mesh_app_id(key, &app->keys[1].id)) {
return STATUS_CANNOT_UPDATE;
}
BT_DBG("app_idx 0x%04x AID 0x%02x", app_idx, app->keys[1].id);
app->updated = true;
memcpy(app->keys[1].val, key, 16);
if (IS_ENABLED(CONFIG_BT_SETTINGS)) {
BT_DBG("Storing AppKey persistently");
bt_mesh_store_app_key(app->app_idx);
}
app_key_evt(app, BT_MESH_KEY_UPDATED);
return STATUS_SUCCESS;
}
uint8_t bt_mesh_app_key_del(uint16_t app_idx, uint16_t net_idx)
{
struct bt_mesh_app_key *app;
BT_DBG("AppIdx 0x%03x", app_idx);
if (net_idx != BT_MESH_KEY_UNUSED && !bt_mesh_subnet_get(net_idx)) {
return STATUS_INVALID_NETKEY;
}
app = app_get(app_idx);
if (!app) {
/* This could be a retry of a previous attempt that had its
* response lost, so pretend that it was a success.
*/
return STATUS_SUCCESS;
}
if (net_idx != BT_MESH_KEY_UNUSED && net_idx != app->net_idx) {
return STATUS_INVALID_BINDING;
}
app_key_del(app);
return STATUS_SUCCESS;
}
int bt_mesh_app_key_set(uint16_t app_idx, uint16_t net_idx,
const uint8_t old_key[16], const uint8_t new_key[16])
{
struct bt_mesh_app_key *app;
app = app_key_alloc(app_idx);
if (!app) {
return -ENOMEM;
}
if (app->app_idx == app_idx) {
return 0;
}
BT_DBG("AppIdx 0x%04x AID 0x%02x", app_idx, app->keys[0].id);
memcpy(app->keys[0].val, old_key, 16);
if (bt_mesh_app_id(old_key, &app->keys[0].id)) {
return -EIO;
}
if (new_key) {
memcpy(app->keys[1].val, new_key, 16);
if (bt_mesh_app_id(new_key, &app->keys[1].id)) {
return -EIO;
}
}
app->net_idx = net_idx;
app->app_idx = app_idx;
app->updated = !!new_key;
return 0;
}
bool bt_mesh_app_key_exists(uint16_t app_idx)
{
for (int i = 0; i < ARRAY_SIZE(apps); i++) {
if (apps[i].app_idx == app_idx) {
return true;
}
}
return false;
}
ssize_t bt_mesh_app_keys_get(uint16_t net_idx, uint16_t app_idxs[], size_t max,
off_t skip)
{
size_t count = 0;
for (int i = 0; i < ARRAY_SIZE(apps); i++) {
struct bt_mesh_app_key *app = &apps[i];
if (app->app_idx == BT_MESH_KEY_UNUSED) {
continue;
}
if (net_idx != BT_MESH_KEY_ANY && app->net_idx != net_idx) {
continue;
}
if (skip) {
skip--;
continue;
}
if (count >= max) {
return -ENOMEM;
}
app_idxs[count++] = app->app_idx;
}
return count;
}
int bt_mesh_keys_resolve(struct bt_mesh_msg_ctx *ctx,
struct bt_mesh_subnet **sub,
const uint8_t *app_key[16], uint8_t *aid)
{
struct bt_mesh_app_key *app = NULL;
if (BT_MESH_IS_DEV_KEY(ctx->app_idx)) {
/* With device keys, the application has to decide which subnet
* to send on.
*/
*sub = bt_mesh_subnet_get(ctx->net_idx);
if (!*sub) {
BT_WARN("Unknown NetKey 0x%03x", ctx->net_idx);
return -EINVAL;
}
if (ctx->app_idx == BT_MESH_KEY_DEV_REMOTE &&
!bt_mesh_elem_find(ctx->addr)) {
struct bt_mesh_cdb_node *node;
if (!IS_ENABLED(CONFIG_BT_MESH_CDB)) {
BT_WARN("No DevKey for 0x%04x", ctx->addr);
return -EINVAL;
}
node = bt_mesh_cdb_node_get(ctx->addr);
if (!node) {
BT_WARN("No DevKey for 0x%04x", ctx->addr);
return -EINVAL;
}
*app_key = node->dev_key;
} else {
*app_key = bt_mesh.dev_key;
}
*aid = 0;
return 0;
}
app = app_get(ctx->app_idx);
if (!app) {
BT_WARN("Unknown AppKey 0x%03x", ctx->app_idx);
return -EINVAL;
}
*sub = bt_mesh_subnet_get(app->net_idx);
if (!*sub) {
BT_WARN("Unknown NetKey 0x%03x", app->net_idx);
return -EINVAL;
}
if ((*sub)->kr_phase == BT_MESH_KR_PHASE_2 && app->updated) {
*aid = app->keys[1].id;
*app_key = app->keys[1].val;
} else {
*aid = app->keys[0].id;
*app_key = app->keys[0].val;
}
return 0;
}
uint16_t bt_mesh_app_key_find(bool dev_key, uint8_t aid,
struct bt_mesh_net_rx *rx,
int (*cb)(struct bt_mesh_net_rx *rx,
const uint8_t key[16], void *cb_data),
void *cb_data)
{
int err, i;
if (dev_key) {
/* Attempt remote dev key first, as that is only available for
* provisioner devices, which normally don't interact with nodes
* that know their local dev key.
*/
if (IS_ENABLED(CONFIG_BT_MESH_CDB) &&
rx->net_if != BT_MESH_NET_IF_LOCAL) {
struct bt_mesh_cdb_node *node;
node = bt_mesh_cdb_node_get(rx->ctx.addr);
if (node && !cb(rx, node->dev_key, cb_data)) {
return BT_MESH_KEY_DEV_REMOTE;
}
}
/** Bluetooth Mesh Specification v1.0.1, section 3.4.3:
* The Device key is only valid for unicast addresses.
*/
if (BT_MESH_ADDR_IS_UNICAST(rx->ctx.recv_dst)) {
err = cb(rx, bt_mesh.dev_key, cb_data);
if (!err) {
return BT_MESH_KEY_DEV_LOCAL;
}
}
return BT_MESH_KEY_UNUSED;
}
for (i = 0; i < ARRAY_SIZE(apps); i++) {
const struct bt_mesh_app_key *app = &apps[i];
const struct bt_mesh_app_cred *cred;
if (app->app_idx == BT_MESH_KEY_UNUSED) {
continue;
}
if (app->net_idx != rx->sub->net_idx) {
continue;
}
if (rx->new_key && app->updated) {
cred = &app->keys[1];
} else {
cred = &app->keys[0];
}
if (cred->id != aid) {
continue;
}
err = cb(rx, cred->val, cb_data);
if (err) {
continue;
}
return app->app_idx;
}
return BT_MESH_KEY_UNUSED;
}
void bt_mesh_app_keys_reset(void)
{
for (int i = 0; i < ARRAY_SIZE(apps); i++) {
struct bt_mesh_app_key *app = &apps[i];
if (app->app_idx != BT_MESH_KEY_UNUSED) {
app_key_del(app);
}
}
}
|
Wms5/IHS-Projeto
|
IHS_Projeto/app/app.c
|
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
//#include <cstdlib.h>
#include <time.h>
unsigned char hexdigit[] = {0x3F, 0x06, 0x5B, 0x4F,
0x66, 0x6D, 0x7D, 0x07,
0x7F, 0x6F, 0x77, 0x7C,
0x39, 0x5E, 0x79, 0x71};
typedef struct VECTOR
{
int option; //1: 7seg, 2: ledG, 3:ledR
unsigned data; //dados
}Vect;
int main() {
int i, j=100;
vect* k;
k->
int dev = open("/dev/de2i150_altera", O_RDWR);
int var=90;
//var=read(dev, &j, 1);
printf("%d %d\n",j,var);
var = write(dev, &k, 1);
close(dev);
return 0;
}
|
Wms5/IHS-Projeto
|
IHS_Projeto/driver/altera_driver.mod.c
|
<reponame>Wms5/IHS-Projeto<filename>IHS_Projeto/driver/altera_driver.mod.c
#include <linux/module.h>
#include <linux/vermagic.h>
#include <linux/compiler.h>
MODULE_INFO(vermagic, VERMAGIC_STRING);
struct module __this_module
__attribute__((section(".gnu.linkonce.this_module"))) = {
.name = KBUILD_MODNAME,
.init = init_module,
#ifdef CONFIG_MODULE_UNLOAD
.exit = cleanup_module,
#endif
.arch = MODULE_ARCH_INIT,
};
static const struct modversion_info ____versions[]
__used
__attribute__((section("__versions"))) = {
{ 0x6ffcc1a3, "module_layout" },
{ 0xb3fe3e99, "pci_unregister_driver" },
{ 0x6bc3fbc0, "__unregister_chrdev" },
{ 0x926bdeb2, "__pci_register_driver" },
{ 0xd224f665, "__register_chrdev" },
{ 0x3af98f9e, "ioremap_nocache" },
{ 0xef237555, "pci_bus_read_config_dword" },
{ 0xecf47114, "pci_bus_read_config_byte" },
{ 0xf9e546fe, "pci_enable_device" },
{ 0xc3aaf0a9, "__put_user_1" },
{ 0xa1c76e0a, "_cond_resched" },
{ 0xc5534d64, "ioread16" },
{ 0x436c2179, "iowrite32" },
{ 0xedc03953, "iounmap" },
{ 0x50eedeb8, "printk" },
{ 0xb4390f9a, "mcount" },
};
static const char __module_depends[]
__used
__attribute__((section(".modinfo"))) =
"depends=";
MODULE_ALIAS("pci:v00001172d00000004sv*sd*bc*sc*i*");
MODULE_INFO(srcversion, "ACB07781E7D088E274A1EC8");
|
Wms5/IHS-Projeto
|
IHS_Projeto/driver/altera_driver.c
|
<reponame>Wms5/IHS-Projeto<gh_stars>0
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <asm/uaccess.h>
MODULE_LICENSE("Dual BSD/GPL");
MODULE_DESCRIPTION("PCIHello");
MODULE_AUTHOR("HUE");
typedef struct VECTOR
{
int option;
unsigned data;
}Vect;
//-- Hardware Handles
static void *hexport;
static void *inport;
static void *ledverde;
static void *ledvermelho;
static void *button0;
static void *ledextra;
static void *cool;
//-- Char Driver Interface
static int access_count = 0;
static int MAJOR_NUMBER = 91;
static int char_device_open ( struct inode * , struct file *);
static int char_device_release ( struct inode * , struct file *);
static ssize_t char_device_read ( struct file * , char *, size_t , loff_t *);
static ssize_t char_device_write ( struct file * , const char *, size_t , loff_t *);
char dados[5];
static struct file_operations file_opts = {
.read = char_device_read,
.open = char_device_open,
.write = char_device_write,
.release = char_device_release
};
static int char_device_open(struct inode *inodep, struct file *filep) {
access_count++;
printk(KERN_ALERT "altera_driver: opened %d time(s)\n", access_count);
return 0;
}
static int char_device_release(struct inode *inodep, struct file *filep) {
printk(KERN_ALERT "altera_driver: device closed.\n");
return 0;
}
static ssize_t char_device_read(struct file *filep, char *buf, size_t len, loff_t *off) {
/////////////////////////////////////
size_t count = len;
short switches;
while (len > 0) {
switches = ioread16(inport);
put_user(switches & 0xFF, buf++);
put_user((switches >> 8) & 0xFF, buf++);
len -= 2;
}
return count;
}
static ssize_t char_device_write(struct file *filep, const char *buf, size_t len, loff_t *off)
{
Vect* ptr = (Vect*) buf;
size_t count = len;
unsigned k = ((unsigned)ptr->data);
switch(ptr->option){
case 1:
count = iowrite32(k,hexport);
break;
case 2:
count = iowrite32(k,ledverde);
break;
case 3:
count = iowrite32(k,ledvermelho);
break;
case 4:
count = iowrite32(k,ledextra);
break;
case 5:
count = iowrite32(k,cool);
}
return count;
}
//-- PCI Device Interface
static struct pci_device_id pci_ids[] = {
{ PCI_DEVICE(0x1172, 0x0004), },
{ 0, }
};
MODULE_DEVICE_TABLE(pci, pci_ids);
static int pci_probe(struct pci_dev *dev, const struct pci_device_id *id);
static void pci_remove(struct pci_dev *dev);
static struct pci_driver pci_driver = {
.name = "alterahello",
.id_table = pci_ids,
.probe = pci_probe,
.remove = pci_remove,
};
static unsigned char pci_get_revision(struct pci_dev *dev) {
u8 revision;
pci_read_config_byte(dev, PCI_REVISION_ID, &revision);
return revision;
}
static int pci_probe(struct pci_dev *dev, const struct pci_device_id *id) {
int vendor;
int retval;
unsigned long resource;
retval = pci_enable_device(dev);
if (pci_get_revision(dev) != 0x01) {
printk(KERN_ALERT "altera_driver: cannot find pci device\n");
return -ENODEV;
}
pci_read_config_dword(dev, 0, &vendor);
printk(KERN_ALERT "altera_driver: Found Vendor id: %x\n", vendor);
resource = pci_resource_start(dev, 0);
printk(KERN_ALERT "altera_driver: Resource start at bar 0: %lx\n", resource);
hexport = ioremap_nocache(resource + 0XC000, 0x20);//Mapeando memória
inport = ioremap_nocache(resource + 0XC020, 0x20);//Mapeando memória
ledverde = ioremap_nocache(resource + 0XC040, 0x20);//Mapeando memória
ledvermelho = ioremap_nocache(resource + 0XC060, 0x20);//Mapeando memória
button0 = ioremap_nocache(resource + 0XC080, 0x20);//Mapeando memória
ledextra = ioremap_nocache(resource + 0XC100, 0x20);
cool = ioremap_nocache(resource + 0XC120, 0x20);
return 0;
}
static void pci_remove(struct pci_dev *dev) {
iounmap(hexport);
iounmap(inport);
iounmap(ledverde);
iounmap(ledvermelho);
iounmap(button0);
iounmap(ledextra);
iounmap(cool);
}
//-- Global module registration
static int __init altera_driver_init(void) {
int t = register_chrdev(MAJOR_NUMBER, "de2i150_altera", &file_opts);
t = t | pci_register_driver(&pci_driver);
if(t<0)
printk(KERN_ALERT "altera_driver: error: cannot register char or pci.\n");
else
printk(KERN_ALERT "altera_driver: char+pci drivers registered.\n");
return t;
}
static void __exit altera_driver_exit(void) {
printk(KERN_ALERT "Goodbye from de2i150_altera.\n");
unregister_chrdev(MAJOR_NUMBER, "de2i150_altera");
pci_unregister_driver(&pci_driver);
}
module_init(altera_driver_init);
module_exit(altera_driver_exit);
|
shibin1984/MVDownloader
|
MVDownloader/MVDownloader.h
|
//
// MVDownloader.h
// MVDownloader
//
// Created by <NAME> on 1/18/18.
// Copyright © 2018 <NAME>. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for MVDownloader.
FOUNDATION_EXPORT double MVDownloaderVersionNumber;
//! Project version string for MVDownloader.
FOUNDATION_EXPORT const unsigned char MVDownloaderVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <MVDownloader/PublicHeader.h>
|
jixingcn/ZipPlatformFile
|
Source/ZipPlatformFile/Private/ZipPlatformFileModule.h
|
<filename>Source/ZipPlatformFile/Private/ZipPlatformFileModule.h
#pragma once
#include <CoreMinimal.h>
DECLARE_LOG_CATEGORY_EXTERN(LogZipPlatformFile, Log, All);
|
jixingcn/ZipPlatformFile
|
Source/ZipPlatformFile/Private/ZipPlatformFileGameInstanceSubsystem.h
|
<gh_stars>1-10
#pragma once
#include "IZipPlatformFile.h"
#include <Subsystems/GameInstanceSubsystem.h>
#include "ZipPlatformFileGameInstanceSubsystem.generated.h"
UCLASS()
class UZipPlatformFileGameInstanceSubsystem : public UGameInstanceSubsystem
{
GENERATED_BODY()
public:
UZipPlatformFileGameInstanceSubsystem();
public:
virtual void Initialize(FSubsystemCollectionBase& Collection) override;
virtual void Deinitialize() override;
public:
FORCEINLINE IZipPlatformFile* GetZipPlatformFile() const
{
return ZipPlatformFilePtr.Get();
}
private:
TUniquePtr<IZipPlatformFile> ZipPlatformFilePtr;
};
|
jixingcn/ZipPlatformFile
|
Source/ZipPlatformFile/Classes/ZipPlatformFileSettings.h
|
#pragma once
#include <UObject/Object.h>
#include "ZipPlatformFileSettings.generated.h"
UCLASS(config = ZipPlatformFileSettings, defaultconfig)
class ZIPPLATFORMFILE_API UZipPlatformFileSettings : public UObject
{
GENERATED_BODY()
public:
UZipPlatformFileSettings();
public:
UPROPERTY(EditAnywhere, Category = "ZipPlatformFile")
bool bSetPlatformFile;
};
|
jixingcn/ZipPlatformFile
|
Source/ZipPlatformFile/Private/ZipPlatformFile.h
|
#pragma once
#include "IZipPlatformFile.h"
class FZipPlatformFile : public IZipPlatformFile
{
public:
FZipPlatformFile();
virtual ~FZipPlatformFile();
public:
virtual bool Initialize(IPlatformFile* Inner, const TCHAR* CmdLine) override;
virtual IPlatformFile* GetLowerLevel() override;
virtual void SetLowerLevel(IPlatformFile* NewLowerLevel) override;
virtual const TCHAR* GetName() const override;
public:
virtual bool FileExists(const TCHAR* Filename) override;
virtual int64 FileSize(const TCHAR* Filename) override;
virtual bool DeleteFile(const TCHAR* Filename) override;
virtual bool IsReadOnly(const TCHAR* Filename) override;
virtual bool MoveFile(const TCHAR* To, const TCHAR* From) override;
virtual bool SetReadOnly(const TCHAR* Filename, bool bNewReadOnlyValue) override;
virtual FDateTime GetTimeStamp(const TCHAR* Filename) override;
virtual void SetTimeStamp(const TCHAR* Filename, FDateTime DateTime) override;
virtual FDateTime GetAccessTimeStamp(const TCHAR* Filename) override;
virtual FString GetFilenameOnDisk(const TCHAR* Filename) override;
virtual IFileHandle* OpenRead(const TCHAR* Filename, bool bAllowWrite = false) override;
virtual IFileHandle* OpenWrite(const TCHAR* Filename, bool bAppend = false, bool bAllowRead = false) override;
virtual bool DirectoryExists(const TCHAR* Directory) override;
virtual bool CreateDirectory(const TCHAR* Directory) override;
virtual bool DeleteDirectory(const TCHAR* Directory) override;
virtual FFileStatData GetStatData(const TCHAR* FilenameOrDirectory) override;
virtual bool IterateDirectory(const TCHAR* Directory, IPlatformFile::FDirectoryVisitor& Visitor) override;
virtual bool IterateDirectoryStat(const TCHAR* Directory, IPlatformFile::FDirectoryStatVisitor& Visitor) override;
public:
virtual bool IsMounted(const TCHAR* Filename) const override;
virtual bool Mount(const TCHAR* MountPoint, const TCHAR* Filename, const TCHAR* Password = nullptr) override;
virtual bool Unmount(const TCHAR* Filename) override;
protected:
TSharedPtr<class FZipFileHandle> GetZipFileHandle(const TCHAR* Filename, FString& OutZipFilename) const;
private:
IPlatformFile* LowerLevelPtr;
TMap<FString, TSharedPtr<class FZipFileHandle>> ZipFileHandlePtrs;
};
|
jixingcn/ZipPlatformFile
|
Source/ZipPlatformFile/Private/ZipFileHandle.h
|
<gh_stars>1-10
#pragma once
#include "minizip/zip.h"
#include "minizip/unzip.h"
#include <GenericPlatform/GenericPlatformFile.h>
class FZipFileHandle
{
class FFileHandle : public IFileHandle
{
friend FZipFileHandle;
public:
explicit FFileHandle();
virtual ~FFileHandle();
public:
virtual int64 Tell() override;
virtual bool Seek(int64 NewPosition) override;
virtual bool SeekFromEnd(int64 NewPositionRelativeToEnd = 0) override;
virtual bool Read(uint8* Destination, int64 BytesToRead) override;
virtual bool Write(const uint8* Source, int64 BytesToWrite) override;
virtual bool Flush(const bool bFullFlush = false) override;
virtual bool Truncate(int64 NewSize) override;
private:
TArray64<uint8> UncompressedData;
int64 CurrentPos;
};
public:
explicit FZipFileHandle(IPlatformFile* PlatformFilePtr, const TCHAR* MountPoint, const TCHAR* Filename, const TCHAR* Password = nullptr);
virtual ~FZipFileHandle();
public:
FORCEINLINE const FString& GetFilename() { return TheFilename; }
FORCEINLINE bool IsValid() const { return (ZLibHandle != 0); }
bool GetFilename(const TCHAR* Filename, FString& OutFilename) const;
public:
bool FileExists(const TCHAR* Filename) const;
bool DirectoryExists(const TCHAR* Directory) const;
int64 FileSize(const TCHAR* Filename) const;
FDateTime GetTimeStamp(const TCHAR* Filename) const;
IFileHandle* OpenRead(const TCHAR* Filename, bool bAllowWrite = false);
FFileStatData GetStatData(const TCHAR* FilenameOrDirectory) const;
bool IterateDirectory(const TCHAR* Directory, IPlatformFile::FDirectoryVisitor& Visitor);
bool IterateDirectoryStat(const TCHAR* Directory, IPlatformFile::FDirectoryStatVisitor& Visitor);
private:
FString TheMountPoint;
FString TheFilename;
FString ThePassword;
IFileHandle* FileHandlePtr;
unzFile ZLibHandle;
struct FZLibFileInfo
{
unz_file_info Info;
unz_file_pos Pos;
bool IsDirectory;
FDateTime GetDateTime() const;
};
TMap<FString, FZLibFileInfo> ZLibFileInfoMap;
public:
static FString FormatAsDirectoryPath(const TCHAR* Filename);
};
|
jixingcn/ZipPlatformFile
|
Source/ZipPlatformFileEd/Private/ZipPlatformFileEdModule.h
|
#pragma once
#include <CoreMinimal.h>
DECLARE_LOG_CATEGORY_EXTERN(LogZipPlatformFileEd, Verbose, All);
|
jixingcn/ZipPlatformFile
|
Source/ZipPlatformFile/Classes/ZipPlatformFileBlueprintFunctionLibrary.h
|
<reponame>jixingcn/ZipPlatformFile
#pragma once
#include <Kismet/BlueprintFunctionLibrary.h>
#include "ZipPlatformFileBlueprintFunctionLibrary.generated.h"
UCLASS()
class ZIPPLATFORMFILE_API UZipPlatformFileBlueprintFunctionLibrary : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
/// Check the mount status of a file
UFUNCTION(BlueprintCallable, Category = "ZipPlatformFile", meta = (WorldContext = "WorldContextObject"))
static bool IsMounted(UObject* WorldContextObject, const FString& Filename);
/// Mount a file, you need pass the password if the file was encrypt
UFUNCTION(BlueprintCallable, Category = "ZipPlatformFile", meta = (WorldContext = "WorldContextObject"))
static bool Mount(UObject* WorldContextObject, const FString& MountPoint, const FString& Filename, const FString& Password);
/// Unmount the file and free the memory
UFUNCTION(BlueprintCallable, Category = "ZipPlatformFile", meta = (WorldContext = "WorldContextObject"))
static bool Unmount(UObject* WorldContextObject, const FString& Filename);
/// Check the status of a file in your zip files
UFUNCTION(BlueprintCallable, Category = "ZipPlatformFile", meta = (WorldContext = "WorldContextObject"))
static bool FileExists(UObject* WorldContextObject, const FString& Filename);
/// Check the status of a directory in your zip files
UFUNCTION(BlueprintCallable, Category = "ZipPlatformFile", meta = (WorldContext = "WorldContextObject"))
static bool DirectoryExists(UObject* WorldContextObject, const FString& Directory);
/// Get the status of file or directory
static bool GetFileStatData(UObject* WorldContextObject, const FString& FilenameOrDirectory, struct FFileStatData& OutFileStatData);
/// Get the creation and access times of file or directory
UFUNCTION(BlueprintCallable, Category = "ZipPlatformFile", meta = (WorldContext = "WorldContextObject"))
static bool GetTimeStamp(UObject* WorldContextObject, const FString& FilenameOrDirectory, FDateTime& OutCreationTime, FDateTime& OutAccessTimeStamp);
/// Load a file to array from your zip files
static bool LoadFileToArray(UObject* WorldContextObject, const FString& Filename, TArray<uint8>& Result);
/// Load a file to string from your zip files
UFUNCTION(BlueprintCallable, Category = "ZipPlatformFile", meta = (WorldContext = "WorldContextObject"))
static bool LoadFileToString(UObject* WorldContextObject, const FString& Filename, FString& Result);
};
|
jixingcn/ZipPlatformFile
|
Source/ZipPlatformFile/Public/IZipPlatformFile.h
|
#pragma once
#include <GenericPlatform/GenericPlatformFile.h>
class ZIPPLATFORMFILE_API IZipPlatformFile : public IPlatformFile
{
public:
virtual bool IsMounted(const TCHAR* Filename) const = 0;
virtual bool Mount(const TCHAR* MountPoint, const TCHAR* Filename, const TCHAR* Password) = 0;
virtual bool Unmount(const TCHAR* Filename) = 0;
};
|
kanecoin1/kanecoin
|
src/qt/qtipcserver.h
|
#ifndef QTIPCSERVER_H
#define QTIPCSERVER_H
// Define KaneCoin-Qt message queue name
#define BITCOINURI_QUEUE_NAME "KaneCoinURI"
void ipcScanRelay(int argc, char *argv[]);
void ipcInit(int argc, char *argv[]);
#endif // QTIPCSERVER_H
|
REgonLevy/shady-crypt
|
crush_tests.c
|
#include <stdio.h>
#include "unif01.h"
#include "bbattery.h"
static int state[4827], c = 1234;
static int lcg = 123456789, xors = 987654321;
static int s1, s2, ast, stream;
static int j = 4827, k = 1024;
static int spread[1024], table[1024];
void fill(){
for(int i = 0; i < 4827; i++){
lcg = 69069 * lcg + 13579;
xors ^= xors << 13;
xors ^= (unsigned int) xors >> 17;
xors ^= xors << 5;
state[i] = lcg + xors;
}
for(int i = 0; i < 32; i++){
for(int l = 0; l < 32; l++){
spread[32 * l + i] = 32 * i + l;
table[32 * i + l] = 32 * l + i;
}
}
ast = (lcg + xors) & 1023;
int flip = 1 << 31;
int t, x, v, w, g;
for (int i = 0; i < 30030; i++){
j = (j < 4826) ? j + 1 : 0;
k = (k < 1023) ? k + 1 : 0;
x = state[j];
t = (x << 12) + c;
c = ((unsigned int) x >> 20) - ((t ^ flip) < (x ^ flip));
state[j] = ~(t - x);
lcg = 69069 * lcg + 13579;
xors ^= xors << 13;
xors ^= (unsigned int) xors >> 17;
xors ^= xors << 5;
x = state[j] + lcg + xors;
s1 = x & 31;
s2 = (unsigned int) x >> 27;
stream <<= 5;
stream += ast & 31;
ast = table[(s2 << 5) + (ast >> 5)];
if((w = spread[k]) >> 5 != s1){
v = (state[j] & 15) + (s1 << 5);
g = table[v];
table[w] = g;
table[v] = k;
spread[k] = v;
spread[g] = w;
}
}
}
int tansgen(){
int t, x, v, w, g;
int flip = 1 << 31;
j = (j < 4826) ? j + 1 : 0;
k = (k < 1023) ? k + 1 : 0;
x = state[j];
t = (x << 12) + c;
c = ((unsigned int) x >> 20) - ((t ^ flip) < (x ^ flip));
state[j] = ~(t - x);
lcg = 69069 * lcg + 13579;
xors ^= xors << 13;
xors ^= (unsigned int) xors >> 17;
xors ^= xors << 5;
x = state[j] + lcg + xors;
s1 = x & 31;
s2 = (unsigned int) x >> 27;
stream <<= 5;
stream += ast & 31;
ast = table[(s2 << 5) + (ast >> 5)];
if((w = spread[k]) >> 5 != s1){
v = (state[j] & 15) + (s1 << 5);
g = table[v];
table[w] = g;
table[v] = k;
spread[k] = v;
spread[g] = w;
}
return x ^ stream;
}
int main() {
fill();
int rep[107];
int test, nr, tn;
char nums[10];
int full = 1;
printf("Enter 1 for TestU01 Small Crush, 2 for TestU01 Crush, 3 for TestU01 Big Crush: ");
scanf("%d", &test);
if(test > 3 || test < 1){
printf("Please pick a valid test.\n");
return 0;
}
printf("\nEnter 0 to run the full test suite, or enter 'R' to repeat individual tests: ");
scanf("%s", &nums);
if (nums[0] == 114 || nums[0] == 82){
for(int i = 0; i < 107; i++){
rep[i] = 0;
}
printf("\nEnter the number of the test you wish to repeat: ");
scanf("%d", &tn);
while(tn){
printf("\nHow many times do you wish to repeat test %d? ", tn);
scanf("%d", &nr);
rep[tn] = nr;
printf("\nTo repeat another test, enter the test number, or enter 0 to if you are finished: ");
scanf("%d", &tn);
}
full = 0;
}
printf("\nEnter 'C' to choose seeds, or any other key to use the defaults: ");
scanf("%s", &nums);
if(nums[0] == 99 || nums[0] == 67){
printf("\nEnter an integer between -2147483648 and 2147483647, inclusive, for Seeds 1 and 2, and an integer between 0 and 4095, inclusive, for Seed 3. \n\n");
printf("Seed 1: ");
scanf("%d", &xors);
printf("Seed 2: ");
scanf("%d", &lcg);
printf("Seed 3: ");
scanf("%d", &c);
c &= 4095;
}
unif01_Gen* gen = unif01_CreateExternGenBits("Shady tANS Generator", tansgen);
if (full){
if (test == 1) {
bbattery_SmallCrush(gen);
} else if (test == 2) {
bbattery_Crush(gen);
} else {
bbattery_BigCrush(gen);
}
} else {
if (test == 1) {
bbattery_RepeatSmallCrush(gen, rep);
} else if (test == 2) {
bbattery_RepeatCrush(gen, rep);
} else {
bbattery_RepeatBigCrush(gen, rep);
}
}
unif01_DeleteExternGenBits(gen);
return 0;
}
|
REgonLevy/shady-crypt
|
rabbit_test_on_digests.c
|
<reponame>REgonLevy/shady-crypt<filename>rabbit_test_on_digests.c
#include <stdio.h>
#include "gdef.h"
#include "swrite.h"
#include "bbattery.h"
int main(){
FILE* fp = fopen("hashes.bin", "r");
if(fp == NULL){
printf("Hashes File Not Found!\n");
return -1;
}
fseek(fp, 0L, SEEK_END);
int res = ftell(fp);
fclose(fp);
swrite_Basic = FALSE;
bbattery_RabbitFile ("hashes.bin", res * 8);
return 0;
}
|
OpenIMSDK/Open-IM-SDK-iOS
|
OpenIMSDKiOS/Classes/PictureInfo.h
|
//
// PictureInfo.h
// Open-IM-SDK-iOS
//
// Created by xpg on 2021/11/5.
//
#import <Foundation/Foundation.h>
#import "BaseModal.h"
NS_ASSUME_NONNULL_BEGIN
@interface PictureInfo : BaseModal
/**
* 唯一ID
*/
@property(nullable) NSString *uuID;
/**
* 图片类型
*/
@property(nullable) NSString *type;
/**
* 图片大小
*/
@property long size;
/**
* 图片宽度
*/
@property int width;
/**
* 图片高度
*/
@property int height;
/**
* 图片oss地址
*/
@property(nullable) NSString *url;
@end
NS_ASSUME_NONNULL_END
|
OpenIMSDK/Open-IM-SDK-iOS
|
OpenIMSDKiOS/Classes/GroupMemberRole.h
|
<reponame>OpenIMSDK/Open-IM-SDK-iOS
//
// GroupMemberRole.h
// Open-IM-SDK-iOS
//
// Created by xpg on 2021/11/5.
//
#import <Foundation/Foundation.h>
#import "BaseModal.h"
NS_ASSUME_NONNULL_BEGIN
@interface GroupMemberRole : BaseModal
@property(nullable) NSString *uid;
@property int setRole;
@end
NS_ASSUME_NONNULL_END
|
OpenIMSDK/Open-IM-SDK-iOS
|
OpenIMSDKiOS/Classes/NotDisturbInfo.h
|
//
// NotDisturbInfo.h
// OpenIMSDKiOS
//
// Created by xpg on 2022/1/5.
//
#import <Foundation/Foundation.h>
#import "BaseModal.h"
NS_ASSUME_NONNULL_BEGIN
@interface NotDisturbInfo : BaseModal
// {"conversationId":"single_13922222222","result":0}
/*
* 会话id
* */
@property(nullable) NSString *conversationId;
/*
* 免打扰状态
* 1:屏蔽消息; 2:接收消息但不提示; 3:正常
* */
@property int result;
@end
NS_ASSUME_NONNULL_END
|
OpenIMSDK/Open-IM-SDK-iOS
|
OpenIMSDKiOS/Classes/QuoteElem.h
|
//
// QuoteElem.h
// Open-IM-SDK-iOS
//
// Created by xpg on 2021/11/5.
//
#import <Foundation/Foundation.h>
#import "BaseModal.h"
@class Message;
NS_ASSUME_NONNULL_BEGIN
@interface QuoteElem : BaseModal
@property(nullable) NSString *text;
@property(nullable) Message *quoteMessage;
@end
NS_ASSUME_NONNULL_END
|
OpenIMSDK/Open-IM-SDK-iOS
|
OpenIMSDKiOS/Classes/GroupApplicationInfo.h
|
<reponame>OpenIMSDK/Open-IM-SDK-iOS
//
// GroupApplicationInfo.h
// Open-IM-SDK-iOS
//
// Created by xpg on 2021/11/5.
//
#import <Foundation/Foundation.h>
#import "BaseModal.h"
NS_ASSUME_NONNULL_BEGIN
@interface GroupApplicationInfo : BaseModal
/**
*
*/
@property(nullable) NSString *id;
/**
* 群组ID
*/
@property(nullable) NSString *groupID;
/**
* 申请用户的ID
*/
@property(nullable) NSString *fromUserID;
/**
* 接收用户的ID
*/
@property(nullable) NSString *toUserID;
/**
* 0:未处理,1:拒绝,2:同意
*/
@property int flag; //INIT = 0, REFUSE = -1, AGREE = 1
/**
* 原因
*/
@property(nullable) NSString *reqMsg;
/**
* 处理反馈
*/
@property(nullable) NSString *handledMsg;
/**
* 时间
*/
@property int createTime;
/**
* 申请用户的昵称
*/
@property(nullable) NSString *fromUserNickName;
/**
* 接收用户的昵称
*/
@property(nullable) NSString *toUserNickName;
/**
* 申请用户的头像
*/
@property(nullable) NSString *fromUserFaceURL;
/**
* 接收用户的昵称
*/
@property(nullable) NSString *toUserFaceURL;
/**
* 处理人
*/
@property(nullable) NSString *handledUser;
/**
* 0:申请进群, 1:邀请进群
*/
@property int type; //APPLICATION = 0, INVITE = 1
/**
* 0:未处理, 1:被其他人处理, 2:被自己处理
*/
@property int handleStatus; //UNHANDLED = 0, BY_OTHER = 1, BY_SELF = 2
/**
* 0:拒绝,1:同意
*/
@property int handleResult; //REFUSE = 0, AGREE = 1
@end
NS_ASSUME_NONNULL_END
|
OpenIMSDK/Open-IM-SDK-iOS
|
OpenIMSDKiOS/Classes/GroupInfo.h
|
<gh_stars>10-100
//
// GroupInfo.h
// Open-IM-SDK-iOS
//
// Created by xpg on 2021/11/5.
//
#import <Foundation/Foundation.h>
#import "BaseModal.h"
NS_ASSUME_NONNULL_BEGIN
@interface GroupInfo : BaseModal
/**
* 组ID
*/
@property(nullable) NSString *groupID;
/**
* 群名
*/
@property(nullable) NSString *groupName;
/**
* 群公告
*/
@property(nullable) NSString *notification;
/**
* 群简介
*/
@property(nullable) NSString *introduction;
/**
* 群头像
*/
@property(nullable) NSString *faceUrl;
/**
* 群主id
*/
@property(nullable) NSString *ownerId;
/**
* 创建时间
*/
@property long createTime;
/**
* 群成员数量
*/
@property int memberCount;
@end
NS_ASSUME_NONNULL_END
|
OpenIMSDK/Open-IM-SDK-iOS
|
OpenIMSDKiOS/Classes/HaveReadInfo.h
|
//
// HaveReadInfo.h
// Open-IM-SDK-iOS
//
// Created by xpg on 2021/11/5.
//
#import <Foundation/Foundation.h>
#import "BaseModal.h"
NS_ASSUME_NONNULL_BEGIN
@interface HaveReadInfo : BaseModal
/**
* 用户id
*/
@property(nullable) NSString *uid;
/**
* 已读消息id
*/
@property(nullable) NSArray<NSString*>/*List<String>*/ *msgIDList;
/**
* 阅读时间
*/
@property int readTime;
/**
* 标识消息是用户级别还是系统级别 100:用户 200:系统
*/
@property int msgFrom;
/**
* 消息类型:
* 101:文本消息
* 102:图片消息
* 103:语音消息
* 104:视频消息
* 105:文件消息
* 106:@消息
* 107:合并消息
* 108:转发消息
* 109:位置消息
* 110:自定义消息
* 111:撤回消息回执
* 112:C2C已读回执
* 113:正在输入状态
*/
@property int contentType;
/**
* 会话类型 1:单聊 2:群聊
*/
@property int sessionType;
@end
NS_ASSUME_NONNULL_END
|
OpenIMSDK/Open-IM-SDK-iOS
|
OpenIMSDKiOS/Classes/PictureElem.h
|
<gh_stars>10-100
//
// PictureElem.h
// Open-IM-SDK-iOS
//
// Created by xpg on 2021/11/5.
//
#import <Foundation/Foundation.h>
#import "BaseModal.h"
#import "PictureInfo.h"
NS_ASSUME_NONNULL_BEGIN
@interface PictureElem : BaseModal
/**
* 本地资源地址
*/
@property(nullable) NSString *sourcePath;
/**
* 本地图片详情
*/
@property(nullable) PictureInfo *sourcePicture;
/**
* 大图详情
*/
@property(nullable) PictureInfo *bigPicture;
/**
* 缩略图详情
*/
@property(nullable) PictureInfo *snapshotPicture;
@end
NS_ASSUME_NONNULL_END
|
OpenIMSDK/Open-IM-SDK-iOS
|
OpenIMSDKiOS/Classes/SendMessageCallbackProxy.h
|
//
// SendMessageCallbackProxy.h
// OpenIMUniPlugin
//
// Created by Snow on 2021/6/24.
//
#import <Foundation/Foundation.h>
#import "OpenIMiOSSDK.h"
@import OpenIMCore;
NS_ASSUME_NONNULL_BEGIN
@interface SendMessageCallbackProxy : NSObject <Open_im_sdkSendMsgCallBack>
- (id)initWithMessage:(onSuccess)onSuccess onProgress:(void(^)(long progress))onProgress onError:(onError)onError;
@end
NS_ASSUME_NONNULL_END
|
OpenIMSDK/Open-IM-SDK-iOS
|
OpenIMSDKiOS/Classes/GroupMembersList.h
|
//
// GroupMembersList.h
// Open-IM-SDK-iOS
//
// Created by xpg on 2021/11/5.
//
#import <Foundation/Foundation.h>
#import "BaseModal.h"
@class GroupMembersInfo;
NS_ASSUME_NONNULL_BEGIN
@interface GroupMembersList : BaseModal
@property int nextSeq;
@property(nullable) NSArray<GroupMembersInfo*> /*List<GroupMembersInfo>*/ *data;
@end
NS_ASSUME_NONNULL_END
|
OpenIMSDK/Open-IM-SDK-iOS
|
OpenIMSDKiOS/Classes/FileElem.h
|
<reponame>OpenIMSDK/Open-IM-SDK-iOS
//
// FileElem.h
// Open-IM-SDK-iOS
//
// Created by xpg on 2021/11/5.
//
#import <Foundation/Foundation.h>
#import "BaseModal.h"
NS_ASSUME_NONNULL_BEGIN
@interface FileElem : BaseModal
/**
* 文件本地资源地址
*/
@property(nullable) NSString *filePath;
/**
*
*/
@property(nullable) NSString *uuID;
/**
* oss地址
*/
@property(nullable) NSString *sourceUrl;
/**
* 文件名称
*/
@property(nullable) NSString *fileName;
/**
* 文件大小
*/
@property long fileSize;
@end
NS_ASSUME_NONNULL_END
|
OpenIMSDK/Open-IM-SDK-iOS
|
OpenIMSDKiOS/Classes/UserInfo.h
|
<filename>OpenIMSDKiOS/Classes/UserInfo.h
//
// UserInfo.h
// Open-IM-SDK-iOS
//
// Created by xpg on 2021/11/4.
//
#import <Foundation/Foundation.h>
#import "BaseModal.h"
NS_ASSUME_NONNULL_BEGIN
@interface UserInfo : BaseModal
/**
* 用户id
*/
@property(nullable) NSString *uid;
/**
* 用户名
*/
@property(nullable) NSString *name;
/**
* 用户头像
*/
@property(nullable) NSString *icon;
/**
* 性别:1男,2女
*/
@property int gender;
/**
* 手机号
*/
@property(nullable) NSString *mobile;
/**
* 生日
*/
@property(nullable) NSString *birth;
/**
* 邮箱
*/
@property(nullable) NSString *email;
/**
* 扩展字段
*/
@property(nullable) NSString *ex;
/**
* 备注
*/
@property(nullable) NSString *comment;
/**
* 黑名单:1已拉入黑名单
*/
@property int isInBlackList;
/**
* 验证消息
*/
@property(nullable) NSString *reqMessage;
/**
* 申请时间
*/
@property(nullable) NSString *applyTime;
/**
* 好友申请列表:0等待处理;1已同意;2已拒绝<br />
* 好友关系:1已经是好友
*/
@property int flag;
@end
NS_ASSUME_NONNULL_END
|
OpenIMSDK/Open-IM-SDK-iOS
|
OpenIMSDKiOS/Classes/CustomElem.h
|
<gh_stars>10-100
//
// CustomElem.h
// Open-IM-SDK-iOS
//
// Created by xpg on 2021/11/5.
//
#import <Foundation/Foundation.h>
#import "BaseModal.h"
NS_ASSUME_NONNULL_BEGIN
@interface CustomElem : BaseModal
@property(nullable) NSString *data;
@property(nullable) NSString *extension;
@property(nullable) NSString *description;
@end
NS_ASSUME_NONNULL_END
|
OpenIMSDK/Open-IM-SDK-iOS
|
OpenIMSDKiOS/Classes/VideoElem.h
|
<filename>OpenIMSDKiOS/Classes/VideoElem.h<gh_stars>10-100
//
// VideoElem.h
// Open-IM-SDK-iOS
//
// Created by xpg on 2021/11/5.
//
#import <Foundation/Foundation.h>
#import "BaseModal.h"
NS_ASSUME_NONNULL_BEGIN
@interface VideoElem : BaseModal
/**
* 视频本地资源地址
*/
@property(nullable) NSString *videoPath;
/**
* 视频唯一ID
*/
@property(nullable) NSString *videoUUID;
/**
* 视频oss地址
*/
@property(nullable) NSString *videoUrl;
/**
* 视频类型
*/
@property(nullable) NSString *videoType;
/**
* 视频大小
*/
@property long videoSize;
/**
* 视频时长
*/
@property long duration;
/**
* 视频快照本地地址
*/
@property(nullable) NSString *snapshotPath;
/**
* 视频快照唯一ID
*/
@property(nullable) NSString *snapshotUUID;
/**
* 视频快照大小
*/
@property long snapshotSize;
/**
* 视频快照oss地址
*/
@property(nullable) NSString *snapshotUrl;
/**
* 视频快照宽度
*/
@property int snapshotWidth;
/**
* 视频快照高度
*/
@property int snapshotHeight;
@end
NS_ASSUME_NONNULL_END
|
OpenIMSDK/Open-IM-SDK-iOS
|
OpenIMSDKiOS/Classes/CallbackProxy.h
|
<filename>OpenIMSDKiOS/Classes/CallbackProxy.h
//
// CallbackProxy.h
// OpenIMUniPlugin
//
// Created by Snow on 2021/6/24.
//
#import <Foundation/Foundation.h>
@import OpenIMCore;
NS_ASSUME_NONNULL_BEGIN
typedef void (^onError)(long ErrCode,NSString* _Nullable ErrMsg);
typedef void (^onSuccess)(NSString* _Nullable data);
@interface CallbackProxy : NSObject <Open_im_sdkBase>
- (id)initWithCallback:(onSuccess)onSuccess onError:(onError)onError;
@end
NS_ASSUME_NONNULL_END
|
OpenIMSDK/Open-IM-SDK-iOS
|
OpenIMSDKiOS/Classes/GroupApplicationList.h
|
<reponame>OpenIMSDK/Open-IM-SDK-iOS
//
// GroupApplicationList.h
// Open-IM-SDK-iOS
//
// Created by xpg on 2021/11/5.
//
#import <Foundation/Foundation.h>
#import "BaseModal.h"
#import "GroupApplicationInfo.h"
NS_ASSUME_NONNULL_BEGIN
@interface GroupApplicationList : BaseModal
/**
* 未处理数量
*/
@property int count;
/**
* 申请记录
*/
@property(nullable) NSArray<GroupApplicationInfo*>/*List<GroupApplicationInfo>*/ *user;
@end
NS_ASSUME_NONNULL_END
|
OpenIMSDK/Open-IM-SDK-iOS
|
OpenIMSDKiOS/Classes/GroupMembersInfo.h
|
//
// GroupMembersInfo.h
// Open-IM-SDK-iOS
//
// Created by xpg on 2021/11/5.
//
#import <Foundation/Foundation.h>
#import "BaseModal.h"
NS_ASSUME_NONNULL_BEGIN
@interface GroupMembersInfo : BaseModal
/**
* 群id
*/
@property(nullable) NSString *groupID;
/**
* 用户id
*/
@property(nullable) NSString *userId;
/**
* 群角色
*/
@property int role;
/**
* 入群时间
*/
@property int joinTime;
/**
* 群内昵称
*/
@property(nullable) NSString *nickName;
/**
* 头像
*/
@property(nullable) NSString *faceUrl;
@property(nullable) id ext;
@end
NS_ASSUME_NONNULL_END
|
OpenIMSDK/Open-IM-SDK-iOS
|
OpenIMSDKiOS/Classes/MergeElem.h
|
//
// MergeElem.h
// Open-IM-SDK-iOS
//
// Created by xpg on 2021/11/5.
//
#import <Foundation/Foundation.h>
#import "BaseModal.h"
@class Message;
NS_ASSUME_NONNULL_BEGIN
@interface MergeElem : BaseModal
@property(nullable) NSString *title;
@property(nullable) NSArray<NSString*>/*List<String>*/ *abstractList;
@property(nullable) NSArray<Message*>/*List<Message>*/ *multiMessage;
@end
NS_ASSUME_NONNULL_END
|
OpenIMSDK/Open-IM-SDK-iOS
|
OpenIMSDKiOS/Classes/LocationElem.h
|
//
// LocationElem.h
// Open-IM-SDK-iOS
//
// Created by xpg on 2021/11/5.
//
#import <Foundation/Foundation.h>
#import "BaseModal.h"
NS_ASSUME_NONNULL_BEGIN
@interface LocationElem : BaseModal
@property(nullable) NSString *description;
@property double longitude;
@property double latitude;
@end
NS_ASSUME_NONNULL_END
|
OpenIMSDK/Open-IM-SDK-iOS
|
OpenIMSDKiOS/Classes/GroupInviteResult.h
|
//
// GroupInviteResult.h
// Open-IM-SDK-iOS
//
// Created by xpg on 2021/11/5.
//
#import <Foundation/Foundation.h>
#import "BaseModal.h"
NS_ASSUME_NONNULL_BEGIN
@interface GroupInviteResult : BaseModal
@property(nullable) NSString *uid;
@property int result;
@end
NS_ASSUME_NONNULL_END
|
OpenIMSDK/Open-IM-SDK-iOS
|
OpenIMSDKiOS/Classes/SoundElem.h
|
//
// SoundElem.h
// Open-IM-SDK-iOS
//
// Created by xpg on 2021/11/5.
//
#import <Foundation/Foundation.h>
#import "BaseModal.h"
NS_ASSUME_NONNULL_BEGIN
@interface SoundElem : BaseModal
/**
* 唯一ID
*/
@property(nullable) NSString *uuID;
/**
* 本地资源地址
*/
@property(nullable) NSString *soundPath;
/**
* oss地址
*/
@property(nullable) NSString *sourceUrl;
/**
* 音频大小
*/
@property long dataSize;
/**
* 音频时长
*/
@property long duration;
@end
NS_ASSUME_NONNULL_END
|
OpenIMSDK/Open-IM-SDK-iOS
|
Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/A/Headers/Open_im_sdk.objc.h
|
// Objective-C API for talking to open_im_sdk/open_im_sdk Go package.
// gobind -lang=objc open_im_sdk/open_im_sdk
//
// File is generated by gobind. Do not edit.
#ifndef __Open_im_sdk_H__
#define __Open_im_sdk_H__
@import Foundation;
#include "ref.h"
#include "Universe.objc.h"
@class Open_im_sdkAgreeOrRejectGroupMember;
@class Open_im_sdkArrMsg;
@class Open_im_sdkChatLog;
@class Open_im_sdkConversationListener;
@class Open_im_sdkConversationStruct;
@class Open_im_sdkFileBaseInfo;
@class Open_im_sdkFriend;
@class Open_im_sdkGatherFormat;
@class Open_im_sdkGeneralWsReq;
@class Open_im_sdkGeneralWsResp;
@class Open_im_sdkGetMaxAndMinSeqReq;
@class Open_im_sdkGetMaxAndMinSeqResp;
@class Open_im_sdkGroupApplicationInfo;
@class Open_im_sdkGroupApplicationResponseReq;
@class Open_im_sdkGroupReqListInfo;
@class Open_im_sdkIMConfig;
@class Open_im_sdkIMManager;
@class Open_im_sdkLogInfo;
@class Open_im_sdkLogger;
@class Open_im_sdkMessageReceipt;
@class Open_im_sdkMsgData;
@class Open_im_sdkMsgFormat;
@class Open_im_sdkMsgStruct;
@class Open_im_sdkNotificationContent;
@class Open_im_sdkPictureBaseInfo;
@class Open_im_sdkPullMessageBySeqListReq;
@class Open_im_sdkPullMessageBySeqListResp;
@class Open_im_sdkPullMsgReq;
@class Open_im_sdkPullUserMsgResp;
@class Open_im_sdkSendMsgRespFromServer;
@class Open_im_sdkSliceMock;
@class Open_im_sdkSoundBaseInfo;
@class Open_im_sdkSoundElem;
@class Open_im_sdkTransferGroupOwnerReq;
@class Open_im_sdkUid2Flag;
@class Open_im_sdkUserRelated;
@class Open_im_sdkUserSendMsgReq;
@class Open_im_sdkUserSendMsgResp;
@class Open_im_sdkVideoBaseInfo;
@class Open_im_sdkWsMsgData;
@class Open_im_sdkWsSendMsgResp;
@class Open_im_sdkWsSubMsg;
@class Open_im_sdkXBase;
@protocol Open_im_sdkBase;
@class Open_im_sdkBase;
@protocol Open_im_sdkIMSDKListener;
@class Open_im_sdkIMSDKListener;
@protocol Open_im_sdkOnAdvancedMsgListener;
@class Open_im_sdkOnAdvancedMsgListener;
@protocol Open_im_sdkOnConversationListener;
@class Open_im_sdkOnConversationListener;
@protocol Open_im_sdkOnFriendshipListener;
@class Open_im_sdkOnFriendshipListener;
@protocol Open_im_sdkOnGroupListener;
@class Open_im_sdkOnGroupListener;
@protocol Open_im_sdkSendMsgCallBack;
@class Open_im_sdkSendMsgCallBack;
@protocol Open_im_sdkBase <NSObject>
- (void)onError:(long)errCode errMsg:(NSString* _Nullable)errMsg;
- (void)onSuccess:(NSString* _Nullable)data;
@end
@protocol Open_im_sdkIMSDKListener <NSObject>
- (void)onConnectFailed:(long)ErrCode ErrMsg:(NSString* _Nullable)ErrMsg;
- (void)onConnectSuccess;
- (void)onConnecting;
- (void)onKickedOffline;
- (void)onSelfInfoUpdated:(NSString* _Nullable)userInfo;
- (void)onUserTokenExpired;
@end
@protocol Open_im_sdkOnAdvancedMsgListener <NSObject>
- (void)onRecvC2CReadReceipt:(NSString* _Nullable)msgReceiptList;
- (void)onRecvMessageRevoked:(NSString* _Nullable)msgId;
- (void)onRecvNewMessage:(NSString* _Nullable)message;
@end
@protocol Open_im_sdkOnConversationListener <NSObject>
- (void)onConversationChanged:(NSString* _Nullable)conversationList;
- (void)onNewConversation:(NSString* _Nullable)conversationList;
- (void)onSyncServerFailed;
- (void)onSyncServerFinish;
- (void)onSyncServerStart;
- (void)onTotalUnreadMessageCountChanged:(int32_t)totalUnreadCount;
@end
@protocol Open_im_sdkOnFriendshipListener <NSObject>
- (void)onBlackListAdd:(NSString* _Nullable)userInfo;
- (void)onBlackListDeleted:(NSString* _Nullable)userInfo;
- (void)onFriendApplicationListAccept:(NSString* _Nullable)applyUserInfo;
- (void)onFriendApplicationListAdded:(NSString* _Nullable)applyUserInfo;
- (void)onFriendApplicationListDeleted:(NSString* _Nullable)applyUserInfo;
- (void)onFriendApplicationListReject:(NSString* _Nullable)applyUserInfo;
- (void)onFriendInfoChanged:(NSString* _Nullable)friendInfo;
- (void)onFriendListAdded:(NSString* _Nullable)friendInfo;
- (void)onFriendListDeleted:(NSString* _Nullable)friendInfo;
@end
@protocol Open_im_sdkOnGroupListener <NSObject>
- (void)onApplicationProcessed:(NSString* _Nullable)groupId opUser:(NSString* _Nullable)opUser AgreeOrReject:(int32_t)AgreeOrReject opReason:(NSString* _Nullable)opReason;
- (void)onGroupCreated:(NSString* _Nullable)groupId;
- (void)onGroupInfoChanged:(NSString* _Nullable)groupId groupInfo:(NSString* _Nullable)groupInfo;
- (void)onMemberEnter:(NSString* _Nullable)groupId memberList:(NSString* _Nullable)memberList;
- (void)onMemberInvited:(NSString* _Nullable)groupId opUser:(NSString* _Nullable)opUser memberList:(NSString* _Nullable)memberList;
- (void)onMemberKicked:(NSString* _Nullable)groupId opUser:(NSString* _Nullable)opUser memberList:(NSString* _Nullable)memberList;
- (void)onMemberLeave:(NSString* _Nullable)groupId member:(NSString* _Nullable)member;
- (void)onReceiveJoinApplication:(NSString* _Nullable)groupId member:(NSString* _Nullable)member opReason:(NSString* _Nullable)opReason;
@end
@protocol Open_im_sdkSendMsgCallBack <NSObject>
- (void)onError:(long)errCode errMsg:(NSString* _Nullable)errMsg;
- (void)onProgress:(long)progress;
- (void)onSuccess:(NSString* _Nullable)data;
@end
@interface Open_im_sdkAgreeOrRejectGroupMember : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) NSString* _Nonnull groupId;
@property (nonatomic) NSString* _Nonnull userId;
@property (nonatomic) long role;
// skipped field AgreeOrRejectGroupMember.JoinTime with unsupported type: uint64
@property (nonatomic) NSString* _Nonnull nickName;
@property (nonatomic) NSString* _Nonnull faceUrl;
@property (nonatomic) NSString* _Nonnull reason;
@end
@interface Open_im_sdkArrMsg : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
// skipped field ArrMsg.SingleData with unsupported type: []open_im_sdk/open_im_sdk.MsgData
// skipped field ArrMsg.GroupData with unsupported type: []open_im_sdk/open_im_sdk.MsgData
@end
@interface Open_im_sdkChatLog : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) NSString* _Nonnull msgId;
@property (nonatomic) NSString* _Nonnull sendID;
@property (nonatomic) int32_t isRead;
@property (nonatomic) int64_t seq;
@property (nonatomic) int32_t status;
@property (nonatomic) int32_t sessionType;
@property (nonatomic) NSString* _Nonnull recvID;
@property (nonatomic) int32_t contentType;
@property (nonatomic) int32_t msgFrom;
@property (nonatomic) NSString* _Nonnull content;
// skipped field ChatLog.Remark with unsupported type: database/sql.NullString
@property (nonatomic) int32_t senderPlatformID;
@property (nonatomic) int64_t sendTime;
@property (nonatomic) int64_t createTime;
@end
@interface Open_im_sdkConversationListener : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) id<Open_im_sdkOnConversationListener> _Nullable conversationListenerx;
// skipped field ConversationListener.MsgListenerList with unsupported type: []open_im_sdk/open_im_sdk.OnAdvancedMsgListener
@end
@interface Open_im_sdkConversationStruct : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) NSString* _Nonnull conversationID;
@property (nonatomic) long conversationType;
@property (nonatomic) NSString* _Nonnull userID;
@property (nonatomic) NSString* _Nonnull groupID;
@property (nonatomic) NSString* _Nonnull showName;
@property (nonatomic) NSString* _Nonnull faceURL;
@property (nonatomic) long recvMsgOpt;
@property (nonatomic) long unreadCount;
@property (nonatomic) NSString* _Nonnull latestMsg;
@property (nonatomic) int64_t latestMsgSendTime;
@property (nonatomic) NSString* _Nonnull draftText;
@property (nonatomic) int64_t draftTimestamp;
@property (nonatomic) long isPinned;
@end
@interface Open_im_sdkFileBaseInfo : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) NSString* _Nonnull filePath;
@property (nonatomic) NSString* _Nonnull uuid;
@property (nonatomic) NSString* _Nonnull sourceURL;
@property (nonatomic) NSString* _Nonnull fileName;
@property (nonatomic) int64_t fileSize;
@end
@interface Open_im_sdkFriend : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@end
@interface Open_im_sdkGatherFormat : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
/**
* @inject_tag: json:"id"
*/
@property (nonatomic) NSString* _Nonnull id_;
// skipped field GatherFormat.List with unsupported type: []*open_im_sdk/open_im_sdk.MsgFormat
// skipped field GatherFormat.XXX_NoUnkeyedLiteral with unsupported type: struct{}
@property (nonatomic) NSData* _Nullable xxX_unrecognized;
@property (nonatomic) int32_t xxX_sizecache;
// skipped method GatherFormat.Descriptor with unsupported parameter or return types
- (void)protoMessage;
- (void)reset;
- (NSString* _Nonnull)string;
- (void)xxX_DiscardUnknown;
- (NSData* _Nullable)xxX_Marshal:(NSData* _Nullable)b deterministic:(BOOL)deterministic error:(NSError* _Nullable* _Nullable)error;
// skipped method GatherFormat.XXX_Merge with unsupported parameter or return types
- (long)xxX_Size;
- (BOOL)xxX_Unmarshal:(NSData* _Nullable)b error:(NSError* _Nullable* _Nullable)error;
@end
@interface Open_im_sdkGeneralWsReq : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) int32_t reqIdentifier;
@property (nonatomic) NSString* _Nonnull token;
@property (nonatomic) NSString* _Nonnull sendID;
@property (nonatomic) NSString* _Nonnull operationID;
@property (nonatomic) NSString* _Nonnull msgIncr;
@property (nonatomic) NSData* _Nullable data;
@end
@interface Open_im_sdkGeneralWsResp : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) long reqIdentifier;
@property (nonatomic) long errCode;
@property (nonatomic) NSString* _Nonnull errMsg;
@property (nonatomic) NSString* _Nonnull msgIncr;
@property (nonatomic) NSString* _Nonnull operationID;
@property (nonatomic) NSData* _Nullable data;
@end
@interface Open_im_sdkGetMaxAndMinSeqReq : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
// skipped field GetMaxAndMinSeqReq.XXX_NoUnkeyedLiteral with unsupported type: struct{}
@property (nonatomic) NSData* _Nullable xxX_unrecognized;
@property (nonatomic) int32_t xxX_sizecache;
// skipped method GetMaxAndMinSeqReq.Descriptor with unsupported parameter or return types
- (void)protoMessage;
- (void)reset;
- (NSString* _Nonnull)string;
- (void)xxX_DiscardUnknown;
- (NSData* _Nullable)xxX_Marshal:(NSData* _Nullable)b deterministic:(BOOL)deterministic error:(NSError* _Nullable* _Nullable)error;
// skipped method GetMaxAndMinSeqReq.XXX_Merge with unsupported parameter or return types
- (long)xxX_Size;
- (BOOL)xxX_Unmarshal:(NSData* _Nullable)b error:(NSError* _Nullable* _Nullable)error;
@end
@interface Open_im_sdkGetMaxAndMinSeqResp : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) int64_t maxSeq;
@property (nonatomic) int64_t minSeq;
// skipped field GetMaxAndMinSeqResp.XXX_NoUnkeyedLiteral with unsupported type: struct{}
@property (nonatomic) NSData* _Nullable xxX_unrecognized;
@property (nonatomic) int32_t xxX_sizecache;
// skipped method GetMaxAndMinSeqResp.Descriptor with unsupported parameter or return types
- (void)protoMessage;
- (void)reset;
- (NSString* _Nonnull)string;
- (void)xxX_DiscardUnknown;
- (NSData* _Nullable)xxX_Marshal:(NSData* _Nullable)b deterministic:(BOOL)deterministic error:(NSError* _Nullable* _Nullable)error;
// skipped method GetMaxAndMinSeqResp.XXX_Merge with unsupported parameter or return types
- (long)xxX_Size;
- (BOOL)xxX_Unmarshal:(NSData* _Nullable)b error:(NSError* _Nullable* _Nullable)error;
@end
@interface Open_im_sdkGroupApplicationInfo : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
// skipped field GroupApplicationInfo.Info with unsupported type: open_im_sdk/open_im_sdk.accessOrRefuseGroupApplicationReq
@property (nonatomic) NSString* _Nonnull handUserID;
@property (nonatomic) NSString* _Nonnull handUserName;
@property (nonatomic) NSString* _Nonnull handUserIcon;
@end
@interface Open_im_sdkGroupApplicationResponseReq : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) NSString* _Nonnull operationID;
@property (nonatomic) NSString* _Nonnull ownerID;
@property (nonatomic) NSString* _Nonnull groupID;
@property (nonatomic) NSString* _Nonnull fromUserID;
@property (nonatomic) NSString* _Nonnull fromUserNickName;
@property (nonatomic) NSString* _Nonnull fromUserFaceUrl;
@property (nonatomic) NSString* _Nonnull toUserID;
@property (nonatomic) NSString* _Nonnull toUserNickName;
@property (nonatomic) NSString* _Nonnull toUserFaceUrl;
@property (nonatomic) int64_t addTime;
@property (nonatomic) NSString* _Nonnull requestMsg;
@property (nonatomic) NSString* _Nonnull handledMsg;
@property (nonatomic) int32_t type;
@property (nonatomic) int32_t handleStatus;
@property (nonatomic) int32_t handleResult;
@end
@interface Open_im_sdkGroupReqListInfo : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) NSString* _Nonnull id_;
@property (nonatomic) NSString* _Nonnull groupID;
@property (nonatomic) NSString* _Nonnull fromUserID;
@property (nonatomic) NSString* _Nonnull toUserID;
@property (nonatomic) int32_t flag;
@property (nonatomic) NSString* _Nonnull requestMsg;
@property (nonatomic) NSString* _Nonnull handledMsg;
@property (nonatomic) int64_t addTime;
@property (nonatomic) NSString* _Nonnull fromUserNickname;
@property (nonatomic) NSString* _Nonnull toUserNickname;
@property (nonatomic) NSString* _Nonnull fromUserFaceUrl;
@property (nonatomic) NSString* _Nonnull toUserFaceUrl;
@property (nonatomic) NSString* _Nonnull handledUser;
@property (nonatomic) int32_t type;
@property (nonatomic) int32_t handleStatus;
@property (nonatomic) int32_t handleResult;
- (NSString* _Nonnull)key;
// skipped method GroupReqListInfo.Value with unsupported parameter or return types
@end
@interface Open_im_sdkIMConfig : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) int32_t platform;
@property (nonatomic) NSString* _Nonnull ipApiAddr;
@property (nonatomic) NSString* _Nonnull ipWsAddr;
@property (nonatomic) NSString* _Nonnull dbDir;
@end
@interface Open_im_sdkIMManager : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) long loginState;
@end
@interface Open_im_sdkLogInfo : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) NSString* _Nonnull info;
@end
@interface Open_im_sdkLogger : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
// skipped field Logger.Logger with unsupported type: *github.com/sirupsen/logrus.Logger
@property (nonatomic) long pid;
// skipped method Logger.AddHook with unsupported parameter or return types
// skipped method Logger.Debug with unsupported parameter or return types
// skipped method Logger.Debugf with unsupported parameter or return types
// skipped method Logger.Debugln with unsupported parameter or return types
// skipped method Logger.Error with unsupported parameter or return types
// skipped method Logger.Errorf with unsupported parameter or return types
// skipped method Logger.Errorln with unsupported parameter or return types
- (void)exit:(long)code;
// skipped method Logger.Fatal with unsupported parameter or return types
// skipped method Logger.Fatalf with unsupported parameter or return types
// skipped method Logger.Fatalln with unsupported parameter or return types
// skipped method Logger.GetLevel with unsupported parameter or return types
// skipped method Logger.Info with unsupported parameter or return types
// skipped method Logger.Infof with unsupported parameter or return types
// skipped method Logger.Infoln with unsupported parameter or return types
// skipped method Logger.IsLevelEnabled with unsupported parameter or return types
// skipped method Logger.Log with unsupported parameter or return types
// skipped method Logger.Logf with unsupported parameter or return types
// skipped method Logger.Logln with unsupported parameter or return types
// skipped method Logger.Panic with unsupported parameter or return types
// skipped method Logger.Panicf with unsupported parameter or return types
// skipped method Logger.Panicln with unsupported parameter or return types
// skipped method Logger.Print with unsupported parameter or return types
// skipped method Logger.Printf with unsupported parameter or return types
// skipped method Logger.Println with unsupported parameter or return types
// skipped method Logger.ReplaceHooks with unsupported parameter or return types
// skipped method Logger.SetFormatter with unsupported parameter or return types
// skipped method Logger.SetLevel with unsupported parameter or return types
- (void)setNoLock;
// skipped method Logger.SetOutput with unsupported parameter or return types
- (void)setReportCaller:(BOOL)reportCaller;
// skipped method Logger.Trace with unsupported parameter or return types
// skipped method Logger.Tracef with unsupported parameter or return types
// skipped method Logger.Traceln with unsupported parameter or return types
// skipped method Logger.Warn with unsupported parameter or return types
// skipped method Logger.Warnf with unsupported parameter or return types
// skipped method Logger.Warning with unsupported parameter or return types
// skipped method Logger.Warningf with unsupported parameter or return types
// skipped method Logger.Warningln with unsupported parameter or return types
// skipped method Logger.Warnln with unsupported parameter or return types
// skipped method Logger.WithContext with unsupported parameter or return types
// skipped method Logger.WithError with unsupported parameter or return types
// skipped method Logger.WithField with unsupported parameter or return types
// skipped method Logger.WithFields with unsupported parameter or return types
// skipped method Logger.WithTime with unsupported parameter or return types
// skipped method Logger.Writer with unsupported parameter or return types
// skipped method Logger.WriterLevel with unsupported parameter or return types
@end
@interface Open_im_sdkMessageReceipt : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) NSString* _Nonnull userID;
// skipped field MessageReceipt.MsgIdList with unsupported type: []string
@property (nonatomic) int64_t readTime;
@property (nonatomic) int32_t msgFrom;
@property (nonatomic) int32_t contentType;
@property (nonatomic) int32_t sessionType;
@end
@interface Open_im_sdkMsgData : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) NSString* _Nonnull sendID;
@property (nonatomic) NSString* _Nonnull recvID;
@property (nonatomic) int32_t sessionType;
@property (nonatomic) int32_t msgFrom;
@property (nonatomic) int32_t contentType;
@property (nonatomic) NSString* _Nonnull serverMsgID;
@property (nonatomic) NSString* _Nonnull content;
@property (nonatomic) int64_t sendTime;
@property (nonatomic) int64_t seq;
@property (nonatomic) int32_t senderPlatformID;
@property (nonatomic) NSString* _Nonnull senderNickName;
@property (nonatomic) NSString* _Nonnull senderFaceURL;
@property (nonatomic) NSString* _Nonnull clientMsgID;
// skipped field MsgData.XXX_NoUnkeyedLiteral with unsupported type: struct{}
@property (nonatomic) NSData* _Nullable xxX_unrecognized;
@property (nonatomic) int32_t xxX_sizecache;
// skipped method MsgData.Descriptor with unsupported parameter or return types
- (void)protoMessage;
- (void)reset;
- (NSString* _Nonnull)string;
- (void)xxX_DiscardUnknown;
- (NSData* _Nullable)xxX_Marshal:(NSData* _Nullable)b deterministic:(BOOL)deterministic error:(NSError* _Nullable* _Nullable)error;
// skipped method MsgData.XXX_Merge with unsupported parameter or return types
- (long)xxX_Size;
- (BOOL)xxX_Unmarshal:(NSData* _Nullable)b error:(NSError* _Nullable* _Nullable)error;
@end
@interface Open_im_sdkMsgFormat : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
/**
* @inject_tag: json:"sendID"
*/
@property (nonatomic) NSString* _Nonnull sendID;
/**
* @inject_tag: json:"recvID"
*/
@property (nonatomic) NSString* _Nonnull recvID;
/**
* @inject_tag: json:"msgFrom"
*/
@property (nonatomic) int32_t msgFrom;
/**
* @inject_tag: json:"contentType"
*/
@property (nonatomic) int32_t contentType;
/**
* @inject_tag: json:"serverMsgID"
*/
@property (nonatomic) NSString* _Nonnull serverMsgID;
/**
* @inject_tag: json:"content"
*/
@property (nonatomic) NSString* _Nonnull content;
/**
* @inject_tag: json:"seq"
*/
@property (nonatomic) int64_t seq;
/**
* @inject_tag: json:"sendTime"
*/
@property (nonatomic) int64_t sendTime;
/**
* @inject_tag: json:"senderPlatformID"
*/
@property (nonatomic) int32_t senderPlatformID;
/**
* @inject_tag: json:"senderNickName"
*/
@property (nonatomic) NSString* _Nonnull senderNickName;
/**
* @inject_tag: json:"senderFaceUrl"
*/
@property (nonatomic) NSString* _Nonnull senderFaceURL;
/**
* @inject_tag: json:"clientMsgID"
*/
@property (nonatomic) NSString* _Nonnull clientMsgID;
// skipped field MsgFormat.XXX_NoUnkeyedLiteral with unsupported type: struct{}
@property (nonatomic) NSData* _Nullable xxX_unrecognized;
@property (nonatomic) int32_t xxX_sizecache;
// skipped method MsgFormat.Descriptor with unsupported parameter or return types
- (void)protoMessage;
- (void)reset;
- (NSString* _Nonnull)string;
- (void)xxX_DiscardUnknown;
- (NSData* _Nullable)xxX_Marshal:(NSData* _Nullable)b deterministic:(BOOL)deterministic error:(NSError* _Nullable* _Nullable)error;
// skipped method MsgFormat.XXX_Merge with unsupported parameter or return types
- (long)xxX_Size;
- (BOOL)xxX_Unmarshal:(NSData* _Nullable)b error:(NSError* _Nullable* _Nullable)error;
@end
@interface Open_im_sdkMsgStruct : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) NSString* _Nonnull clientMsgID;
@property (nonatomic) NSString* _Nonnull serverMsgID;
@property (nonatomic) int64_t createTime;
@property (nonatomic) int64_t sendTime;
@property (nonatomic) int32_t sessionType;
@property (nonatomic) NSString* _Nonnull sendID;
@property (nonatomic) NSString* _Nonnull recvID;
@property (nonatomic) int32_t msgFrom;
@property (nonatomic) int32_t contentType;
@property (nonatomic) int32_t platformID;
// skipped field MsgStruct.ForceList with unsupported type: []string
@property (nonatomic) NSString* _Nonnull senderNickName;
@property (nonatomic) NSString* _Nonnull senderFaceURL;
@property (nonatomic) NSString* _Nonnull groupID;
@property (nonatomic) NSString* _Nonnull content;
@property (nonatomic) int64_t seq;
@property (nonatomic) BOOL isRead;
@property (nonatomic) int32_t status;
@property (nonatomic) NSString* _Nonnull remark;
// skipped field MsgStruct.PictureElem with unsupported type: struct{SourcePath string "json:\"sourcePath\""; SourcePicture open_im_sdk/open_im_sdk.PictureBaseInfo "json:\"sourcePicture\""; BigPicture open_im_sdk/open_im_sdk.PictureBaseInfo "json:\"bigPicture\""; SnapshotPicture open_im_sdk/open_im_sdk.PictureBaseInfo "json:\"snapshotPicture\""}
// skipped field MsgStruct.SoundElem with unsupported type: struct{UUID string "json:\"uuid\""; SoundPath string "json:\"soundPath\""; SourceURL string "json:\"sourceUrl\""; DataSize int64 "json:\"dataSize\""; Duration int64 "json:\"duration\""}
// skipped field MsgStruct.VideoElem with unsupported type: struct{VideoPath string "json:\"videoPath\""; VideoUUID string "json:\"videoUUID\""; VideoURL string "json:\"videoUrl\""; VideoType string "json:\"videoType\""; VideoSize int64 "json:\"videoSize\""; Duration int64 "json:\"duration\""; SnapshotPath string "json:\"snapshotPath\""; SnapshotUUID string "json:\"snapshotUUID\""; SnapshotSize int64 "json:\"snapshotSize\""; SnapshotURL string "json:\"snapshotUrl\""; SnapshotWidth int32 "json:\"snapshotWidth\""; SnapshotHeight int32 "json:\"snapshotHeight\""}
// skipped field MsgStruct.FileElem with unsupported type: struct{FilePath string "json:\"filePath\""; UUID string "json:\"uuid\""; SourceURL string "json:\"sourceUrl\""; FileName string "json:\"fileName\""; FileSize int64 "json:\"fileSize\""}
// skipped field MsgStruct.MergeElem with unsupported type: struct{Title string "json:\"title\""; AbstractList []string "json:\"abstractList\""; MultiMessage []*open_im_sdk/open_im_sdk.MsgStruct "json:\"multiMessage\""}
// skipped field MsgStruct.AtElem with unsupported type: struct{Text string "json:\"text\""; AtUserList []string "json:\"atUserList\""; IsAtSelf bool "json:\"isAtSelf\""}
// skipped field MsgStruct.LocationElem with unsupported type: struct{Description string "json:\"description\""; Longitude float64 "json:\"longitude\""; Latitude float64 "json:\"latitude\""}
// skipped field MsgStruct.CustomElem with unsupported type: struct{Data string "json:\"data\""; Description string "json:\"description\""; Extension string "json:\"extension\""}
// skipped field MsgStruct.QuoteElem with unsupported type: struct{Text string "json:\"text\""; QuoteMessage *open_im_sdk/open_im_sdk.MsgStruct "json:\"quoteMessage\""}
@end
@interface Open_im_sdkNotificationContent : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) int32_t isDisplay;
@property (nonatomic) NSString* _Nonnull defaultTips;
@property (nonatomic) NSString* _Nonnull detail;
@end
@interface Open_im_sdkPictureBaseInfo : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) NSString* _Nonnull uuid;
@property (nonatomic) NSString* _Nonnull type;
@property (nonatomic) int64_t size;
@property (nonatomic) int32_t width;
@property (nonatomic) int32_t height;
@property (nonatomic) NSString* _Nonnull url;
@end
@interface Open_im_sdkPullMessageBySeqListReq : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
// skipped field PullMessageBySeqListReq.SeqList with unsupported type: []int64
// skipped field PullMessageBySeqListReq.XXX_NoUnkeyedLiteral with unsupported type: struct{}
@property (nonatomic) NSData* _Nullable xxX_unrecognized;
@property (nonatomic) int32_t xxX_sizecache;
// skipped method PullMessageBySeqListReq.Descriptor with unsupported parameter or return types
- (void)protoMessage;
- (void)reset;
- (NSString* _Nonnull)string;
- (void)xxX_DiscardUnknown;
- (NSData* _Nullable)xxX_Marshal:(NSData* _Nullable)b deterministic:(BOOL)deterministic error:(NSError* _Nullable* _Nullable)error;
// skipped method PullMessageBySeqListReq.XXX_Merge with unsupported parameter or return types
- (long)xxX_Size;
- (BOOL)xxX_Unmarshal:(NSData* _Nullable)b error:(NSError* _Nullable* _Nullable)error;
@end
@interface Open_im_sdkPullMessageBySeqListResp : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) int64_t maxSeq;
@property (nonatomic) int64_t minSeq;
// skipped field PullMessageBySeqListResp.SingleUserMsg with unsupported type: []*open_im_sdk/open_im_sdk.GatherFormat
// skipped field PullMessageBySeqListResp.GroupUserMsg with unsupported type: []*open_im_sdk/open_im_sdk.GatherFormat
// skipped field PullMessageBySeqListResp.XXX_NoUnkeyedLiteral with unsupported type: struct{}
@property (nonatomic) NSData* _Nullable xxX_unrecognized;
@property (nonatomic) int32_t xxX_sizecache;
// skipped method PullMessageBySeqListResp.Descriptor with unsupported parameter or return types
- (void)protoMessage;
- (void)reset;
- (NSString* _Nonnull)string;
- (void)xxX_DiscardUnknown;
- (NSData* _Nullable)xxX_Marshal:(NSData* _Nullable)b deterministic:(BOOL)deterministic error:(NSError* _Nullable* _Nullable)error;
// skipped method PullMessageBySeqListResp.XXX_Merge with unsupported parameter or return types
- (long)xxX_Size;
- (BOOL)xxX_Unmarshal:(NSData* _Nullable)b error:(NSError* _Nullable* _Nullable)error;
@end
@interface Open_im_sdkPullMsgReq : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) NSString* _Nonnull userID;
@property (nonatomic) NSString* _Nonnull groupID;
@property (nonatomic) Open_im_sdkMsgStruct* _Nullable startMsg;
@property (nonatomic) long count;
@end
@interface Open_im_sdkPullUserMsgResp : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) long errCode;
@property (nonatomic) NSString* _Nonnull errMsg;
@property (nonatomic) long reqIdentifier;
@property (nonatomic) long msgIncr;
// skipped field PullUserMsgResp.Data with unsupported type: open_im_sdk/open_im_sdk.paramsPullUserMsgDataResp
@end
@interface Open_im_sdkSendMsgRespFromServer : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) long errCode;
@property (nonatomic) NSString* _Nonnull errMsg;
@property (nonatomic) long reqIdentifier;
// skipped field SendMsgRespFromServer.Data with unsupported type: struct{ServerMsgID string "json:\"serverMsgID\""; ClientMsgID string "json:\"clientMsgID\""; SendTime int64 "json:\"sendTime\""}
@end
@interface Open_im_sdkSliceMock : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@end
@interface Open_im_sdkSoundBaseInfo : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) NSString* _Nonnull uuid;
@property (nonatomic) NSString* _Nonnull soundPath;
@property (nonatomic) NSString* _Nonnull sourceURL;
@property (nonatomic) int64_t dataSize;
@property (nonatomic) int64_t duration;
@end
@interface Open_im_sdkSoundElem : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) NSString* _Nonnull uuid;
@property (nonatomic) NSString* _Nonnull soundPath;
@property (nonatomic) NSString* _Nonnull sourceURL;
@property (nonatomic) int64_t dataSize;
@property (nonatomic) int64_t duration;
@end
@interface Open_im_sdkTransferGroupOwnerReq : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) NSString* _Nonnull groupID;
@property (nonatomic) NSString* _Nonnull oldOwner;
@property (nonatomic) NSString* _Nonnull newOwner;
@property (nonatomic) NSString* _Nonnull operationID;
@end
@interface Open_im_sdkUid2Flag : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) NSString* _Nonnull uid;
@property (nonatomic) int32_t flag;
@end
@interface Open_im_sdkUserRelated : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
// skipped field UserRelated.ConversationCh with unsupported type: chan open_im_sdk/open_im_sdk.cmd2Value
// skipped field UserRelated.SvrConf with unsupported type: open_im_sdk/open_im_sdk.IMConfig
@property (nonatomic) NSString* _Nonnull loginUid;
// skipped field UserRelated.IMManager with unsupported type: open_im_sdk/open_im_sdk.IMManager
// skipped field UserRelated.Friend with unsupported type: open_im_sdk/open_im_sdk.Friend
// skipped field UserRelated.ConversationListener with unsupported type: open_im_sdk/open_im_sdk.ConversationListener
- (void)acceptFriendApplication:(id<Open_im_sdkBase> _Nullable)callback uid:(NSString* _Nullable)uid;
- (void)acceptGroupApplication:(NSString* _Nullable)application reason:(NSString* _Nullable)reason callback:(id<Open_im_sdkBase> _Nullable)callback;
- (void)addAdvancedMsgListener:(id<Open_im_sdkOnAdvancedMsgListener> _Nullable)listener;
// skipped method UserRelated.AddCh with unsupported parameter or return types
- (void)addFriend:(id<Open_im_sdkBase> _Nullable)callback paramsReq:(NSString* _Nullable)paramsReq;
- (void)addToBlackList:(id<Open_im_sdkBase> _Nullable)callback blackUid:(NSString* _Nullable)blackUid;
- (void)checkFriend:(id<Open_im_sdkBase> _Nullable)callback uidList:(NSString* _Nullable)uidList;
- (void)clearC2CHistoryMessage:(id<Open_im_sdkBase> _Nullable)callback userID:(NSString* _Nullable)userID;
- (void)clearGroupHistoryMessage:(id<Open_im_sdkBase> _Nullable)callback groupID:(NSString* _Nullable)groupID;
- (NSString* _Nonnull)createCardMessage:(NSString* _Nullable)cardInfo;
- (NSString* _Nonnull)createCustomMessage:(NSString* _Nullable)data extension:(NSString* _Nullable)extension description:(NSString* _Nullable)description;
- (NSString* _Nonnull)createFileMessage:(NSString* _Nullable)filePath fileName:(NSString* _Nullable)fileName;
- (NSString* _Nonnull)createFileMessageByURL:(NSString* _Nullable)fileBaseInfo;
- (NSString* _Nonnull)createFileMessageFromFullPath:(NSString* _Nullable)fileFullPath fileName:(NSString* _Nullable)fileName;
- (NSString* _Nonnull)createForwardMessage:(NSString* _Nullable)m;
- (void)createGroup:(NSString* _Nullable)gInfo memberList:(NSString* _Nullable)memberList callback:(id<Open_im_sdkBase> _Nullable)callback;
- (NSString* _Nonnull)createImageMessage:(NSString* _Nullable)imagePath;
- (NSString* _Nonnull)createImageMessageByURL:(NSString* _Nullable)sourcePicture bigPicture:(NSString* _Nullable)bigPicture snapshotPicture:(NSString* _Nullable)snapshotPicture;
- (NSString* _Nonnull)createImageMessageFromFullPath:(NSString* _Nullable)imageFullPath;
- (NSString* _Nonnull)createLocationMessage:(NSString* _Nullable)description longitude:(double)longitude latitude:(double)latitude;
- (NSString* _Nonnull)createMergerMessage:(NSString* _Nullable)messageList title:(NSString* _Nullable)title summaryList:(NSString* _Nullable)summaryList;
- (NSString* _Nonnull)createQuoteMessage:(NSString* _Nullable)text message:(NSString* _Nullable)message;
- (NSString* _Nonnull)createSoundMessage:(NSString* _Nullable)soundPath duration:(int64_t)duration;
- (NSString* _Nonnull)createSoundMessageByURL:(NSString* _Nullable)soundBaseInfo;
- (NSString* _Nonnull)createSoundMessageFromFullPath:(NSString* _Nullable)soundPath duration:(int64_t)duration;
- (NSString* _Nonnull)createTextAtMessage:(NSString* _Nullable)text atUserList:(NSString* _Nullable)atUserList;
- (NSString* _Nonnull)createTextMessage:(NSString* _Nullable)text;
- (NSString* _Nonnull)createVideoMessage:(NSString* _Nullable)videoPath videoType:(NSString* _Nullable)videoType duration:(int64_t)duration snapshotPath:(NSString* _Nullable)snapshotPath;
- (NSString* _Nonnull)createVideoMessageByURL:(NSString* _Nullable)videoBaseInfo;
- (NSString* _Nonnull)createVideoMessageFromFullPath:(NSString* _Nullable)videoFullPath videoType:(NSString* _Nullable)videoType duration:(int64_t)duration snapshotFullPath:(NSString* _Nullable)snapshotFullPath;
- (void)delCh:(NSString* _Nullable)msgIncr;
- (void)deleteConversation:(NSString* _Nullable)conversationID callback:(id<Open_im_sdkBase> _Nullable)callback;
- (void)deleteFromBlackList:(id<Open_im_sdkBase> _Nullable)callback deleteUid:(NSString* _Nullable)deleteUid;
- (void)deleteFromFriendList:(NSString* _Nullable)deleteUid callback:(id<Open_im_sdkBase> _Nullable)callback;
- (void)deleteMessageFromLocalStorage:(id<Open_im_sdkBase> _Nullable)callback message:(NSString* _Nullable)message;
- (void)findMessages:(id<Open_im_sdkBase> _Nullable)callback messageIDList:(NSString* _Nullable)messageIDList;
- (void)forceReConn;
- (void)forceSyncApplyGroupRequest;
- (void)forceSyncBlackList;
- (void)forceSyncFriend;
- (void)forceSyncFriendApplication;
- (void)forceSyncGroupRequest;
- (void)forceSyncJoinedGroup;
- (void)forceSyncJoinedGroupMember;
- (void)forceSyncLoginUserInfo;
- (BOOL)forceSyncMsg;
- (NSString* _Nonnull)genMsgIncr;
- (void)getAllConversationList:(id<Open_im_sdkBase> _Nullable)callback;
- (void)getBlackList:(id<Open_im_sdkBase> _Nullable)callback;
// skipped method UserRelated.GetCh with unsupported parameter or return types
- (void)getConversationListSplit:(id<Open_im_sdkBase> _Nullable)callback offset:(long)offset count:(long)count;
- (void)getConversationRecvMessageOpt:(id<Open_im_sdkBase> _Nullable)callback conversationIDList:(NSString* _Nullable)conversationIDList;
- (void)getFriendApplicationList:(id<Open_im_sdkBase> _Nullable)callback;
- (void)getFriendList:(id<Open_im_sdkBase> _Nullable)callback;
- (void)getFriendsInfo:(id<Open_im_sdkBase> _Nullable)callback uidList:(NSString* _Nullable)uidList;
- (void)getGroupApplicationList:(id<Open_im_sdkBase> _Nullable)callback;
- (void)getGroupMemberList:(NSString* _Nullable)groupId filter:(int32_t)filter next:(int32_t)next callback:(id<Open_im_sdkBase> _Nullable)callback;
- (void)getGroupMembersInfo:(NSString* _Nullable)groupId userList:(NSString* _Nullable)userList callback:(id<Open_im_sdkBase> _Nullable)callback;
- (void)getGroupsInfo:(NSString* _Nullable)groupIdList callback:(id<Open_im_sdkBase> _Nullable)callback;
- (void)getHistoryMessageList:(id<Open_im_sdkBase> _Nullable)callback getMessageOptions:(NSString* _Nullable)getMessageOptions;
- (void)getJoinedGroupList:(id<Open_im_sdkBase> _Nullable)callback;
- (long)getLoginStatus;
- (NSString* _Nonnull)getLoginUser;
- (int64_t)getMinSeqSvr;
- (void)getMultipleConversation:(NSString* _Nullable)conversationIDList callback:(id<Open_im_sdkBase> _Nullable)callback;
- (void)getOneConversation:(NSString* _Nullable)sourceID sessionType:(long)sessionType callback:(id<Open_im_sdkBase> _Nullable)callback;
- (void)getTotalUnreadMsgCount:(id<Open_im_sdkBase> _Nullable)callback;
- (void)getUsersInfo:(NSString* _Nullable)uIDList cb:(id<Open_im_sdkBase> _Nullable)cb;
// skipped method UserRelated.GroupApplicationProcessedCallback with unsupported parameter or return types
- (BOOL)initSDK:(NSString* _Nullable)config cb:(id<Open_im_sdkIMSDKListener> _Nullable)cb;
- (NSString* _Nonnull)insertGroupMessageToLocalStorage:(id<Open_im_sdkBase> _Nullable)callback message:(NSString* _Nullable)message groupID:(NSString* _Nullable)groupID sender:(NSString* _Nullable)sender;
- (NSString* _Nonnull)insertSingleMessageToLocalStorage:(id<Open_im_sdkBase> _Nullable)callback message:(NSString* _Nullable)message userID:(NSString* _Nullable)userID sender:(NSString* _Nullable)sender;
- (void)inviteUserToGroup:(NSString* _Nullable)groupId reason:(NSString* _Nullable)reason userList:(NSString* _Nullable)userList callback:(id<Open_im_sdkBase> _Nullable)callback;
- (void)joinGroup:(NSString* _Nullable)groupId message:(NSString* _Nullable)message callback:(id<Open_im_sdkBase> _Nullable)callback;
- (void)kickGroupMember:(NSString* _Nullable)groupId reason:(NSString* _Nullable)reason userList:(NSString* _Nullable)userList callback:(id<Open_im_sdkBase> _Nullable)callback;
- (void)login:(NSString* _Nullable)uid tk:(NSString* _Nullable)tk callback:(id<Open_im_sdkBase> _Nullable)callback;
- (void)logout:(id<Open_im_sdkBase> _Nullable)callback;
- (void)markC2CMessageAsRead:(id<Open_im_sdkBase> _Nullable)callback receiver:(NSString* _Nullable)receiver msgIDList:(NSString* _Nullable)msgIDList;
- (void)markGroupMessageHasRead:(id<Open_im_sdkBase> _Nullable)callback groupID:(NSString* _Nullable)groupID;
/**
* Deprecated
*/
- (void)markSingleMessageHasRead:(id<Open_im_sdkBase> _Nullable)callback userID:(NSString* _Nullable)userID;
// skipped method UserRelated.OnMemberInvited with unsupported parameter or return types
// skipped method UserRelated.OnMemberKicked with unsupported parameter or return types
- (void)pinConversation:(NSString* _Nullable)conversationID isPinned:(BOOL)isPinned callback:(id<Open_im_sdkBase> _Nullable)callback;
// skipped method UserRelated.Prepare with unsupported parameter or return types
// skipped method UserRelated.Query with unsupported parameter or return types
- (void)quitGroup:(NSString* _Nullable)groupId callback:(id<Open_im_sdkBase> _Nullable)callback;
- (void)refuseFriendApplication:(id<Open_im_sdkBase> _Nullable)callback uid:(NSString* _Nullable)uid;
- (void)refuseGroupApplication:(NSString* _Nullable)application reason:(NSString* _Nullable)reason callback:(id<Open_im_sdkBase> _Nullable)callback;
- (BOOL)resetConversation:(NSString* _Nullable)conversationID error:(NSError* _Nullable* _Nullable)error;
- (void)revokeMessage:(id<Open_im_sdkBase> _Nullable)callback message:(NSString* _Nullable)message;
- (NSString* _Nonnull)sendMessage:(id<Open_im_sdkSendMsgCallBack> _Nullable)callback message:(NSString* _Nullable)message receiver:(NSString* _Nullable)receiver groupID:(NSString* _Nullable)groupID onlineUserOnly:(BOOL)onlineUserOnly;
- (NSString* _Nonnull)sendMessageNotOss:(id<Open_im_sdkSendMsgCallBack> _Nullable)callback message:(NSString* _Nullable)message receiver:(NSString* _Nullable)receiver groupID:(NSString* _Nullable)groupID onlineUserOnly:(BOOL)onlineUserOnly;
- (void)setConversationDraft:(NSString* _Nullable)conversationID draftText:(NSString* _Nullable)draftText callback:(id<Open_im_sdkBase> _Nullable)callback;
- (void)setConversationListener:(id<Open_im_sdkOnConversationListener> _Nullable)listener;
- (void)setConversationRecvMessageOpt:(id<Open_im_sdkBase> _Nullable)callback conversationIDList:(NSString* _Nullable)conversationIDList opt:(long)opt;
- (void)setFriendInfo:(NSString* _Nullable)comment callback:(id<Open_im_sdkBase> _Nullable)callback;
- (BOOL)setFriendListener:(id<Open_im_sdkOnFriendshipListener> _Nullable)listener;
- (void)setGroupInfo:(NSString* _Nullable)jsonGroupInfo callback:(id<Open_im_sdkBase> _Nullable)callback;
- (void)setGroupListener:(id<Open_im_sdkOnGroupListener> _Nullable)callback;
- (void)setMinSeqSvr:(int64_t)minSeqSvr;
- (void)setSelfInfo:(NSString* _Nullable)info cb:(id<Open_im_sdkBase> _Nullable)cb;
- (void)transferGroupOwner:(NSString* _Nullable)groupId userId:(NSString* _Nullable)userId callback:(id<Open_im_sdkBase> _Nullable)callback;
- (void)typingStatusUpdate:(NSString* _Nullable)receiver msgTip:(NSString* _Nullable)msgTip;
- (void)unInitSDK;
// skipped method UserRelated.WriteMsg with unsupported parameter or return types
@end
@interface Open_im_sdkUserSendMsgReq : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
// skipped field UserSendMsgReq.Options with unsupported type: map[string]int32
@property (nonatomic) NSString* _Nonnull senderNickName;
@property (nonatomic) NSString* _Nonnull senderFaceURL;
@property (nonatomic) int32_t platformID;
@property (nonatomic) int32_t sessionType;
@property (nonatomic) int32_t msgFrom;
@property (nonatomic) int32_t contentType;
@property (nonatomic) NSString* _Nonnull recvID;
// skipped field UserSendMsgReq.ForceList with unsupported type: []string
@property (nonatomic) NSString* _Nonnull content;
@property (nonatomic) NSString* _Nonnull clientMsgID;
// skipped field UserSendMsgReq.XXX_NoUnkeyedLiteral with unsupported type: struct{}
@property (nonatomic) NSData* _Nullable xxX_unrecognized;
@property (nonatomic) int32_t xxX_sizecache;
// skipped method UserSendMsgReq.Descriptor with unsupported parameter or return types
- (void)protoMessage;
- (void)reset;
- (NSString* _Nonnull)string;
- (void)xxX_DiscardUnknown;
- (NSData* _Nullable)xxX_Marshal:(NSData* _Nullable)b deterministic:(BOOL)deterministic error:(NSError* _Nullable* _Nullable)error;
// skipped method UserSendMsgReq.XXX_Merge with unsupported parameter or return types
- (long)xxX_Size;
- (BOOL)xxX_Unmarshal:(NSData* _Nullable)b error:(NSError* _Nullable* _Nullable)error;
@end
@interface Open_im_sdkUserSendMsgResp : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) NSString* _Nonnull serverMsgID;
@property (nonatomic) NSString* _Nonnull clientMsgID;
@property (nonatomic) int64_t sendTime;
// skipped field UserSendMsgResp.XXX_NoUnkeyedLiteral with unsupported type: struct{}
@property (nonatomic) NSData* _Nullable xxX_unrecognized;
@property (nonatomic) int32_t xxX_sizecache;
// skipped method UserSendMsgResp.Descriptor with unsupported parameter or return types
- (void)protoMessage;
- (void)reset;
- (NSString* _Nonnull)string;
- (void)xxX_DiscardUnknown;
- (NSData* _Nullable)xxX_Marshal:(NSData* _Nullable)b deterministic:(BOOL)deterministic error:(NSError* _Nullable* _Nullable)error;
// skipped method UserSendMsgResp.XXX_Merge with unsupported parameter or return types
- (long)xxX_Size;
- (BOOL)xxX_Unmarshal:(NSData* _Nullable)b error:(NSError* _Nullable* _Nullable)error;
@end
@interface Open_im_sdkVideoBaseInfo : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) NSString* _Nonnull videoPath;
@property (nonatomic) NSString* _Nonnull videoUUID;
@property (nonatomic) NSString* _Nonnull videoURL;
@property (nonatomic) NSString* _Nonnull videoType;
@property (nonatomic) int64_t videoSize;
@property (nonatomic) int64_t duration;
@property (nonatomic) NSString* _Nonnull snapshotPath;
@property (nonatomic) NSString* _Nonnull snapshotUUID;
@property (nonatomic) int64_t snapshotSize;
@property (nonatomic) NSString* _Nonnull snapshotURL;
@property (nonatomic) int32_t snapshotWidth;
@property (nonatomic) int32_t snapshotHeight;
@end
@interface Open_im_sdkWsMsgData : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) int32_t platformID;
@property (nonatomic) int32_t sessionType;
@property (nonatomic) int32_t msgFrom;
@property (nonatomic) int32_t contentType;
@property (nonatomic) NSString* _Nonnull recvID;
// skipped field WsMsgData.ForceList with unsupported type: []string
@property (nonatomic) NSString* _Nonnull content;
// skipped field WsMsgData.Options with unsupported type: map[string]interface{}
@property (nonatomic) NSString* _Nonnull clientMsgID;
// skipped field WsMsgData.OfflineInfo with unsupported type: map[string]interface{}
// skipped field WsMsgData.Ext with unsupported type: map[string]interface{}
@end
@interface Open_im_sdkWsSendMsgResp : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) NSString* _Nonnull serverMsgID;
@property (nonatomic) NSString* _Nonnull clientMsgID;
@property (nonatomic) int64_t sendTime;
@end
@interface Open_im_sdkWsSubMsg : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) int64_t sendTime;
@property (nonatomic) NSString* _Nonnull serverMsgID;
@property (nonatomic) NSString* _Nonnull clientMsgID;
@end
@interface Open_im_sdkXBase : NSObject <goSeqRefInterface, Open_im_sdkBase, Open_im_sdkSendMsgCallBack> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
- (void)onError:(long)errCode errMsg:(NSString* _Nullable)errMsg;
- (void)onProgress:(long)progress;
- (void)onSuccess:(NSString* _Nullable)data;
@end
FOUNDATION_EXPORT const int64_t Open_im_sdkAcceptFriendApplicationTip;
FOUNDATION_EXPORT const int64_t Open_im_sdkAcceptGroupApplicationTip;
FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkAcceptGroupTip;
FOUNDATION_EXPORT const int64_t Open_im_sdkAddConOrUpLatMsg;
FOUNDATION_EXPORT const int64_t Open_im_sdkAddFriendTip;
FOUNDATION_EXPORT const int64_t Open_im_sdkAtText;
FOUNDATION_EXPORT const int64_t Open_im_sdkCard;
FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdAcceptFriend;
FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdAddFriend;
FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdBlackList;
FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdDeleteConversation;
FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdForceSyncFriend;
FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdForceSyncFriendApplication;
FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdForceSyncLoginUerInfo;
FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdForceSyncMsg;
FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdFriend;
FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdFriendApplication;
FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdFroceSyncBlackList;
FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdGeyLoginUserInfo;
FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdNewMsgCome;
FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdReLogin;
FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdRefuseFriend;
FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdUnInit;
FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdUpdateConversation;
FOUNDATION_EXPORT const int64_t Open_im_sdkCreateGroupTip;
FOUNDATION_EXPORT const int64_t Open_im_sdkCustom;
FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkDeFaultSuccessMsg;
FOUNDATION_EXPORT const int64_t Open_im_sdkErrCodeConversation;
FOUNDATION_EXPORT const int64_t Open_im_sdkErrCodeFriend;
FOUNDATION_EXPORT const int64_t Open_im_sdkErrCodeGroup;
FOUNDATION_EXPORT const int64_t Open_im_sdkErrCodeInitLogin;
FOUNDATION_EXPORT const int64_t Open_im_sdkErrCodeUserInfo;
FOUNDATION_EXPORT const int64_t Open_im_sdkFile;
FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkFriendAcceptTip;
FOUNDATION_EXPORT const int64_t Open_im_sdkGroupActionAcceptGroupApplication;
FOUNDATION_EXPORT const int64_t Open_im_sdkGroupActionApplyJoinGroup;
FOUNDATION_EXPORT const int64_t Open_im_sdkGroupActionCreateGroup;
FOUNDATION_EXPORT const int64_t Open_im_sdkGroupActionInviteUserToGroup;
FOUNDATION_EXPORT const int64_t Open_im_sdkGroupActionKickGroupMember;
FOUNDATION_EXPORT const int64_t Open_im_sdkGroupActionQuitGroup;
FOUNDATION_EXPORT const int64_t Open_im_sdkGroupActionRefuseGroupApplication;
FOUNDATION_EXPORT const int64_t Open_im_sdkGroupActionSetGroupInfo;
FOUNDATION_EXPORT const int64_t Open_im_sdkGroupActionTransferGroupOwner;
FOUNDATION_EXPORT const int64_t Open_im_sdkGroupChatType;
/**
* ///////////////////////////////////////
*/
FOUNDATION_EXPORT const int64_t Open_im_sdkGroupTipBegin;
FOUNDATION_EXPORT const int64_t Open_im_sdkGroupTipEnd;
FOUNDATION_EXPORT const int64_t Open_im_sdkHasRead;
FOUNDATION_EXPORT const int64_t Open_im_sdkHasReadReceipt;
FOUNDATION_EXPORT const int64_t Open_im_sdkIncrUnread;
FOUNDATION_EXPORT const int64_t Open_im_sdkInviteUserToGroupTip;
FOUNDATION_EXPORT const int64_t Open_im_sdkJoinGroupTip;
FOUNDATION_EXPORT const int64_t Open_im_sdkKickGroupMemberTip;
FOUNDATION_EXPORT const int64_t Open_im_sdkLocation;
FOUNDATION_EXPORT const int64_t Open_im_sdkLoginFailed;
FOUNDATION_EXPORT const int64_t Open_im_sdkLoginSuccess;
FOUNDATION_EXPORT const int64_t Open_im_sdkLogining;
FOUNDATION_EXPORT const int64_t Open_im_sdkLogoutCmd;
FOUNDATION_EXPORT const int64_t Open_im_sdkMaxTotalMsgLen;
FOUNDATION_EXPORT const int64_t Open_im_sdkMerger;
FOUNDATION_EXPORT const int64_t Open_im_sdkMsgStatusHasDeleted;
FOUNDATION_EXPORT const int64_t Open_im_sdkMsgStatusRevoked;
FOUNDATION_EXPORT const int64_t Open_im_sdkMsgStatusSendFailed;
FOUNDATION_EXPORT const int64_t Open_im_sdkMsgStatusSendSuccess;
/**
* MsgStatus
*/
FOUNDATION_EXPORT const int64_t Open_im_sdkMsgStatusSending;
FOUNDATION_EXPORT const int64_t Open_im_sdkNewCon;
FOUNDATION_EXPORT const int64_t Open_im_sdkNewConChange;
FOUNDATION_EXPORT const int64_t Open_im_sdkNotPinned;
FOUNDATION_EXPORT const int64_t Open_im_sdkNotRead;
FOUNDATION_EXPORT const int64_t Open_im_sdkNotReceiveMessage;
FOUNDATION_EXPORT const int64_t Open_im_sdkPicture;
FOUNDATION_EXPORT const int64_t Open_im_sdkPinned;
FOUNDATION_EXPORT const int64_t Open_im_sdkQuitGroupTip;
FOUNDATION_EXPORT const int64_t Open_im_sdkQuote;
/**
* MsgReceiveOpt
*/
FOUNDATION_EXPORT const int64_t Open_im_sdkReceiveMessage;
FOUNDATION_EXPORT const int64_t Open_im_sdkReceiveNotNotifyMessage;
FOUNDATION_EXPORT const int64_t Open_im_sdkRefuseFriendApplicationTip;
FOUNDATION_EXPORT const int64_t Open_im_sdkRefuseGroupApplicationTip;
FOUNDATION_EXPORT const int64_t Open_im_sdkRevoke;
FOUNDATION_EXPORT const int64_t Open_im_sdkSdkInit;
FOUNDATION_EXPORT const int64_t Open_im_sdkSetGroupInfoTip;
FOUNDATION_EXPORT const int64_t Open_im_sdkSetSelfInfoTip;
/**
* ///////////////////////////////////
SessionType
*/
FOUNDATION_EXPORT const int64_t Open_im_sdkSingleChatType;
/**
* ////////////////////////////////////////
*/
FOUNDATION_EXPORT const int64_t Open_im_sdkSingleTipBegin;
FOUNDATION_EXPORT const int64_t Open_im_sdkSingleTipEnd;
FOUNDATION_EXPORT const int64_t Open_im_sdkSysMsgType;
/**
* ContentType
*/
FOUNDATION_EXPORT const int64_t Open_im_sdkText;
FOUNDATION_EXPORT const int64_t Open_im_sdkTimeOffset;
FOUNDATION_EXPORT const int64_t Open_im_sdkTokenFailedExpired;
FOUNDATION_EXPORT const int64_t Open_im_sdkTokenFailedInvalid;
FOUNDATION_EXPORT const int64_t Open_im_sdkTokenFailedKickedOffline;
FOUNDATION_EXPORT const int64_t Open_im_sdkTotalUnreadMessageChanged;
FOUNDATION_EXPORT const int64_t Open_im_sdkTransferGroupOwnerTip;
FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkTransferGroupTip;
FOUNDATION_EXPORT const int64_t Open_im_sdkTyping;
FOUNDATION_EXPORT const int64_t Open_im_sdkUnreadCountSetZero;
FOUNDATION_EXPORT const int64_t Open_im_sdkUpdateFaceUrlAndNickName;
FOUNDATION_EXPORT const int64_t Open_im_sdkUpdateLatestMessageChange;
/**
* //////////////////////////////////////
MsgFrom
*/
FOUNDATION_EXPORT const int64_t Open_im_sdkUserMsgType;
FOUNDATION_EXPORT const int64_t Open_im_sdkVideo;
FOUNDATION_EXPORT const int64_t Open_im_sdkVoice;
FOUNDATION_EXPORT const int64_t Open_im_sdkWSDataError;
FOUNDATION_EXPORT const int64_t Open_im_sdkWSGetNewestSeq;
FOUNDATION_EXPORT const int64_t Open_im_sdkWSKickOnlineMsg;
FOUNDATION_EXPORT const int64_t Open_im_sdkWSPullMsg;
FOUNDATION_EXPORT const int64_t Open_im_sdkWSPullMsgBySeqList;
FOUNDATION_EXPORT const int64_t Open_im_sdkWSPushMsg;
FOUNDATION_EXPORT const int64_t Open_im_sdkWSSendMsg;
FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkZoomScale;
@interface Open_im_sdk : NSObject
+ (int32_t) sdkLogFlag;
+ (void) setSdkLogFlag:(int32_t)v;
// skipped variable SvrConf with unsupported type: open_im_sdk/open_im_sdk.IMConfig
// skipped variable UserRouterMap with unsupported type: map[string]*open_im_sdk/open_im_sdk.UserRelated
// skipped variable UserSDKRwLock with unsupported type: sync.RWMutex
@end
FOUNDATION_EXPORT void Open_im_sdkAcceptFriendApplication(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable uid);
FOUNDATION_EXPORT void Open_im_sdkAcceptGroupApplication(NSString* _Nullable application, NSString* _Nullable reason, id<Open_im_sdkBase> _Nullable callback);
FOUNDATION_EXPORT void Open_im_sdkAddAdvancedMsgListener(id<Open_im_sdkOnAdvancedMsgListener> _Nullable listener);
FOUNDATION_EXPORT void Open_im_sdkAddFriend(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable paramsReq);
FOUNDATION_EXPORT void Open_im_sdkAddToBlackList(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable blackUid);
FOUNDATION_EXPORT void Open_im_sdkCheckFriend(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable uidList);
/**
* func (u *UserRelated) pullOldMsgAndMergeNewMsgByWs(beginSeq int64, endSeq int64) (err error) {
LogBegin(beginSeq, endSeq)
if beginSeq > endSeq {
LogSReturn(nil)
return nil
}
LogBegin("AddCh")
msgIncr, ch := u.AddCh()
var wsReq GeneralWsReq
wsReq.ReqIdentifier = WSPullMsgBySeqList
wsReq.OperationID = operationIDGenerator()
wsReq.SendID = u.LoginUid
//wsReq.Token = u.token
wsReq.MsgIncr = msgIncr
var pullMsgReq PullMessageBySeqListReq
LogBegin("getNoInSeq ", beginSeq, endSeq)
pullMsgReq.SeqList = u.getNotInSeq(beginSeq, endSeq)
LogEnd("getNoInSeq ", pullMsgReq.SeqList)
wsReq.Data, err = proto.Marshal(&pullMsgReq)
if err != nil {
sdkLog("Marshl failed ")
LogFReturn(err.Error())
u.DelCh(msgIncr)
return err
}
LogBegin("WriteMsg ", wsReq.OperationID)
err, _ = u.WriteMsg(wsReq)
LogEnd("WriteMsg ", wsReq.OperationID, err)
if err != nil {
sdkLog("close conn, WriteMsg failed ", err.Error())
u.DelCh(msgIncr)
return err
}
timeout := 10
select {
case r := <-ch:
sdkLog("ws ch recvMsg success: ", wsReq.OperationID)
if r.ErrCode != 0 {
sdkLog("pull msg failed ", r.ErrCode, r.ErrMsg, wsReq.OperationID)
u.DelCh(msgIncr)
return errors.New(r.ErrMsg)
} else {
sdkLog("pull msg success ", wsReq.OperationID)
var pullMsg PullUserMsgResp
pullMsg.ErrCode = 0
var pullMsgResp PullMessageBySeqListResp
err := proto.Unmarshal(r.Data, &pullMsgResp)
if err != nil {
sdkLog("Unmarshal failed ", err.Error())
LogFReturn(err.Error())
return err
}
pullMsg.Data.Group = pullMsgResp.GroupUserMsg
pullMsg.Data.Single = pullMsgResp.SingleUserMsg
pullMsg.Data.MaxSeq = pullMsgResp.MaxSeq
pullMsg.Data.MinSeq = pullMsgResp.MinSeq
u.seqMsgMutex.Lock()
arrMsg := ArrMsg{}
isInmap := false
for i := 0; i < len(pullMsg.Data.Single); i++ {
for j := 0; j < len(pullMsg.Data.Single[i].List); j++ {
sdkLog("open_im pull one msg: |", pullMsg.Data.Single[i].List[j].ClientMsgID, "|")
singleMsg := MsgData{
SendID: pullMsg.Data.Single[i].List[j].SendID,
RecvID: pullMsg.Data.Single[i].List[j].RecvID,
SessionType: SingleChatType,
MsgFrom: pullMsg.Data.Single[i].List[j].MsgFrom,
ContentType: pullMsg.Data.Single[i].List[j].ContentType,
ServerMsgID: pullMsg.Data.Single[i].List[j].ServerMsgID,
Content: pullMsg.Data.Single[i].List[j].Content,
SendTime: pullMsg.Data.Single[i].List[j].SendTime,
Seq: pullMsg.Data.Single[i].List[j].Seq,
SenderNickName: pullMsg.Data.Single[i].List[j].SenderNickName,
SenderFaceURL: pullMsg.Data.Single[i].List[j].SenderFaceURL,
ClientMsgID: pullMsg.Data.Single[i].List[j].ClientMsgID,
SenderPlatformID: pullMsg.Data.Single[i].List[j].SenderPlatformID,
}
// arrMsg.SingleData = append(arrMsg.SingleData, singleMsg)
u.seqMsg[pullMsg.Data.Single[i].List[j].Seq] = singleMsg
sdkLog("into map, seq: ", pullMsg.Data.Single[i].List[j].Seq, pullMsg.Data.Single[i].List[j].ClientMsgID, pullMsg.Data.Single[i].List[j].ServerMsgID)
}
}
for i := 0; i < len(pullMsg.Data.Group); i++ {
for j := 0; j < len(pullMsg.Data.Group[i].List); j++ {
groupMsg := MsgData{
SendID: pullMsg.Data.Group[i].List[j].SendID,
RecvID: pullMsg.Data.Group[i].List[j].RecvID,
SessionType: GroupChatType,
MsgFrom: pullMsg.Data.Group[i].List[j].MsgFrom,
ContentType: pullMsg.Data.Group[i].List[j].ContentType,
ServerMsgID: pullMsg.Data.Group[i].List[j].ServerMsgID,
Content: pullMsg.Data.Group[i].List[j].Content,
SendTime: pullMsg.Data.Group[i].List[j].SendTime,
Seq: pullMsg.Data.Group[i].List[j].Seq,
SenderNickName: pullMsg.Data.Group[i].List[j].SenderNickName,
SenderFaceURL: pullMsg.Data.Group[i].List[j].SenderFaceURL,
ClientMsgID: pullMsg.Data.Group[i].List[j].ClientMsgID,
SenderPlatformID: pullMsg.Data.Group[i].List[j].SenderPlatformID,
}
// arrMsg.GroupData = append(arrMsg.GroupData, groupMsg)
u.seqMsg[pullMsg.Data.Group[i].List[j].Seq] = groupMsg
sdkLog("into map, seq: ", pullMsg.Data.Group[i].List[j].Seq, pullMsg.Data.Group[i].List[j].ClientMsgID, pullMsg.Data.Group[i].List[j].ServerMsgID)
}
}
u.seqMsgMutex.Unlock()
u.seqMsgMutex.RLock()
for i := beginSeq; i <= endSeq; i++ {
v, ok := u.seqMsg[i]
if ok {
if v.SessionType == SingleChatType {
arrMsg.SingleData = append(arrMsg.SingleData, v)
sdkLog("pull seq: ", v.Seq, v)
if v.ContentType > SingleTipBegin && v.ContentType < SingleTipEnd {
var msgRecv MsgData
msgRecv.ContentType = v.ContentType
msgRecv.Content = v.Content
msgRecv.SendID = v.SendID
msgRecv.RecvID = v.RecvID
LogBegin("doFriendMsg ", msgRecv)
u.doFriendMsg(msgRecv)
LogEnd("doFriendMsg ", msgRecv)
}
} else if v.SessionType == GroupChatType {
sdkLog("pull seq: ", v.Seq, v)
arrMsg.GroupData = append(arrMsg.GroupData, v)
if v.ContentType > GroupTipBegin && v.ContentType < GroupTipEnd {
LogBegin("doGroupMsg ", v)
u.doGroupMsg(v)
LogEnd("doGroupMsg ", v)
}
} else {
sdkLog("type failed, ", v.SessionType, v)
}
} else {
sdkLog("seq no in map, failed, seq: ", i)
}
}
u.seqMsgMutex.RUnlock()
sdkLog("triggerCmdNewMsgCome len: ", len(arrMsg.SingleData), len(arrMsg.GroupData))
err = u.triggerCmdNewMsgCome(arrMsg)
if err != nil {
sdkLog("triggerCmdNewMsgCome failed, ", err.Error())
}
u.DelCh(msgIncr)
}
case <-time.After(time.Second * time.Duration(timeout)):
sdkLog("ws ch recvMsg timeout,", wsReq.OperationID)
u.DelCh(msgIncr)
}
return nil
}
*/
FOUNDATION_EXPORT long Open_im_sdkCheckToken(NSString* _Nullable uId, NSString* _Nullable token);
FOUNDATION_EXPORT void Open_im_sdkClearC2CHistoryMessage(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable userID);
FOUNDATION_EXPORT void Open_im_sdkClearGroupHistoryMessage(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable groupID);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCardMessage(NSString* _Nullable cardInfo);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCustomMessage(NSString* _Nullable data, NSString* _Nullable extension, NSString* _Nullable description);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessage(NSString* _Nullable filePath, NSString* _Nullable fileName);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageByURL(NSString* _Nullable fileBaseInfo);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageFromFullPath(NSString* _Nullable fileFullPath, NSString* _Nullable fileName);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateForwardMessage(NSString* _Nullable m);
FOUNDATION_EXPORT void Open_im_sdkCreateGroup(NSString* _Nullable gInfo, NSString* _Nullable memberList, id<Open_im_sdkBase> _Nullable callback);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessage(NSString* _Nullable imagePath);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageByURL(NSString* _Nullable sourcePicture, NSString* _Nullable bigPicture, NSString* _Nullable snapshotPicture);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageFromFullPath(NSString* _Nullable imageFullPath);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateLocationMessage(NSString* _Nullable description, double longitude, double latitude);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateMergerMessage(NSString* _Nullable messageList, NSString* _Nullable title, NSString* _Nullable summaryList);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateQuoteMessage(NSString* _Nullable text, NSString* _Nullable message);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessage(NSString* _Nullable soundPath, int64_t duration);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageByURL(NSString* _Nullable soundBaseInfo);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageFromFullPath(NSString* _Nullable soundPath, int64_t duration);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextAtMessage(NSString* _Nullable text, NSString* _Nullable atUserList);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextMessage(NSString* _Nullable text);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessage(NSString* _Nullable videoPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotPath);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageByURL(NSString* _Nullable videoBaseInfo);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageFromFullPath(NSString* _Nullable videoFullPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotFullPath);
// skipped function Debug with unsupported parameter or return types
// skipped function DebugByKv with unsupported parameter or return types
FOUNDATION_EXPORT void Open_im_sdkDeleteConversation(NSString* _Nullable conversationID, id<Open_im_sdkBase> _Nullable callback);
FOUNDATION_EXPORT void Open_im_sdkDeleteFromBlackList(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable deleteUid);
FOUNDATION_EXPORT void Open_im_sdkDeleteFromFriendList(NSString* _Nullable deleteUid, id<Open_im_sdkBase> _Nullable callback);
FOUNDATION_EXPORT void Open_im_sdkDeleteMessageFromLocalStorage(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable message);
FOUNDATION_EXPORT void Open_im_sdkDoAcceptGroupApplication(NSString* _Nullable uid);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkDoGetGroupApplicationList(void);
FOUNDATION_EXPORT void Open_im_sdkDoGetGroupsInfo(void);
FOUNDATION_EXPORT void Open_im_sdkDoGroupApplicationList(void);
FOUNDATION_EXPORT void Open_im_sdkDoJoinGroup(void);
FOUNDATION_EXPORT void Open_im_sdkDoQuitGroup(void);
FOUNDATION_EXPORT void Open_im_sdkDoRefuseGroupApplication(NSString* _Nullable uid);
FOUNDATION_EXPORT void Open_im_sdkDoSetGroupInfo(void);
FOUNDATION_EXPORT void Open_im_sdkDoTestCreateGroup(void);
FOUNDATION_EXPORT void Open_im_sdkDoTransferGroupOwner(NSString* _Nullable groupid, NSString* _Nullable userid);
FOUNDATION_EXPORT void Open_im_sdkDotestGetGroupMemberList(void);
FOUNDATION_EXPORT void Open_im_sdkDotestGetGroupMembersInfo(void);
FOUNDATION_EXPORT void Open_im_sdkDotestGetJoinedGroupList(void);
FOUNDATION_EXPORT void Open_im_sdkDotestKickGroupMember(void);
FOUNDATION_EXPORT void Open_im_sdkDotesttestInviteUserToGroup(void);
// skipped function Error with unsupported parameter or return types
// skipped function ErrorByArgs with unsupported parameter or return types
// skipped function ErrorByKv with unsupported parameter or return types
FOUNDATION_EXPORT void Open_im_sdkFindMessages(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable messageIDList);
FOUNDATION_EXPORT void Open_im_sdkForceSyncLoginUerInfo(void);
FOUNDATION_EXPORT BOOL Open_im_sdkForceSyncMsg(void);
FOUNDATION_EXPORT void Open_im_sdkGetAllConversationList(id<Open_im_sdkBase> _Nullable callback);
FOUNDATION_EXPORT void Open_im_sdkGetBlackList(id<Open_im_sdkBase> _Nullable callback);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetConversationIDBySessionType(NSString* _Nullable sourceID, long sessionType);
FOUNDATION_EXPORT void Open_im_sdkGetConversationListSplit(id<Open_im_sdkBase> _Nullable callback, long offset, long count);
FOUNDATION_EXPORT void Open_im_sdkGetConversationRecvMessageOpt(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable conversationIDList);
/**
* Get the current timestamp by Mill
*/
FOUNDATION_EXPORT int64_t Open_im_sdkGetCurrentTimestampByMill(void);
FOUNDATION_EXPORT void Open_im_sdkGetFriendApplicationList(id<Open_im_sdkBase> _Nullable callback);
FOUNDATION_EXPORT void Open_im_sdkGetFriendList(id<Open_im_sdkBase> _Nullable callback);
FOUNDATION_EXPORT void Open_im_sdkGetFriendsInfo(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable uidList);
FOUNDATION_EXPORT void Open_im_sdkGetGroupApplicationList(id<Open_im_sdkBase> _Nullable callback);
FOUNDATION_EXPORT void Open_im_sdkGetGroupMemberList(NSString* _Nullable groupId, int32_t filter, int32_t next, id<Open_im_sdkBase> _Nullable callback);
FOUNDATION_EXPORT void Open_im_sdkGetGroupMembersInfo(NSString* _Nullable groupId, NSString* _Nullable userList, id<Open_im_sdkBase> _Nullable callback);
FOUNDATION_EXPORT void Open_im_sdkGetGroupsInfo(NSString* _Nullable groupIdList, id<Open_im_sdkBase> _Nullable callback);
FOUNDATION_EXPORT void Open_im_sdkGetHistoryMessageList(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable getMessageOptions);
FOUNDATION_EXPORT void Open_im_sdkGetJoinedGroupList(id<Open_im_sdkBase> _Nullable callback);
FOUNDATION_EXPORT long Open_im_sdkGetLoginStatus(void);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetLoginUser(void);
FOUNDATION_EXPORT void Open_im_sdkGetMultipleConversation(NSString* _Nullable conversationIDList, id<Open_im_sdkBase> _Nullable callback);
FOUNDATION_EXPORT void Open_im_sdkGetOneConversation(NSString* _Nullable sourceID, long sessionType, id<Open_im_sdkBase> _Nullable callback);
FOUNDATION_EXPORT void Open_im_sdkGetTotalUnreadMsgCount(id<Open_im_sdkBase> _Nullable callback);
FOUNDATION_EXPORT Open_im_sdkUserRelated* _Nullable Open_im_sdkGetUserWorker(NSString* _Nullable uid);
FOUNDATION_EXPORT void Open_im_sdkGetUsersInfo(NSString* _Nullable uIDList, id<Open_im_sdkBase> _Nullable cb);
// skipped function Info with unsupported parameter or return types
// skipped function InfoByArgs with unsupported parameter or return types
// skipped function InfoByKv with unsupported parameter or return types
FOUNDATION_EXPORT BOOL Open_im_sdkInitOnce(Open_im_sdkIMConfig* _Nullable config);
FOUNDATION_EXPORT BOOL Open_im_sdkInitSDK(NSString* _Nullable config, id<Open_im_sdkIMSDKListener> _Nullable cb);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkInsertSingleMessageToLocalStorage(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable message, NSString* _Nullable userID, NSString* _Nullable sender);
FOUNDATION_EXPORT void Open_im_sdkInviteUserToGroup(NSString* _Nullable groupId, NSString* _Nullable reason, NSString* _Nullable userList, id<Open_im_sdkBase> _Nullable callback);
FOUNDATION_EXPORT BOOL Open_im_sdkIsNil(void);
FOUNDATION_EXPORT void Open_im_sdkJoinGroup(NSString* _Nullable groupId, NSString* _Nullable message, id<Open_im_sdkBase> _Nullable callback);
FOUNDATION_EXPORT void Open_im_sdkKickGroupMember(NSString* _Nullable groupId, NSString* _Nullable reason, NSString* _Nullable userList, id<Open_im_sdkBase> _Nullable callback);
// skipped function LogBegin with unsupported parameter or return types
// skipped function LogEnd with unsupported parameter or return types
// skipped function LogFReturn with unsupported parameter or return types
// skipped function LogSReturn with unsupported parameter or return types
// skipped function LogStart with unsupported parameter or return types
FOUNDATION_EXPORT void Open_im_sdkLogin(NSString* _Nullable uid, NSString* _Nullable tk, id<Open_im_sdkBase> _Nullable callback);
FOUNDATION_EXPORT void Open_im_sdkLogout(id<Open_im_sdkBase> _Nullable callback);
FOUNDATION_EXPORT void Open_im_sdkMarkC2CMessageAsRead(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable receiver, NSString* _Nullable msgIDList);
FOUNDATION_EXPORT void Open_im_sdkMarkGroupMessageHasRead(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable groupID);
/**
* Deprecated
*/
FOUNDATION_EXPORT void Open_im_sdkMarkSingleMessageHasRead(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable userID);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkMd5(NSString* _Nullable s);
// skipped function NewDebug with unsupported parameter or return types
// skipped function NewError with unsupported parameter or return types
// skipped function NewInfo with unsupported parameter or return types
// skipped function NewLfsHook with unsupported parameter or return types
/**
* func init() {
logger = loggerInit("")
}
*/
FOUNDATION_EXPORT void Open_im_sdkNewPrivateLog(NSString* _Nullable moduleName);
// skipped function NewWarn with unsupported parameter or return types
FOUNDATION_EXPORT void Open_im_sdkPinConversation(NSString* _Nullable conversationID, BOOL isPinned, id<Open_im_sdkBase> _Nullable callback);
// skipped function Post2Api with unsupported parameter or return types
FOUNDATION_EXPORT void Open_im_sdkQuitGroup(NSString* _Nullable groupId, id<Open_im_sdkBase> _Nullable callback);
FOUNDATION_EXPORT void Open_im_sdkRefuseFriendApplication(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable uid);
FOUNDATION_EXPORT void Open_im_sdkRefuseGroupApplication(NSString* _Nullable application, NSString* _Nullable reason, id<Open_im_sdkBase> _Nullable callback);
FOUNDATION_EXPORT void Open_im_sdkRevokeMessage(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable message);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkRunFuncName(void);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkSdkVersion(void);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkSendMessage(id<Open_im_sdkSendMsgCallBack> _Nullable callback, NSString* _Nullable message, NSString* _Nullable receiver, NSString* _Nullable groupID, BOOL onlineUserOnly);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkSendMessageNotOss(id<Open_im_sdkSendMsgCallBack> _Nullable callback, NSString* _Nullable message, NSString* _Nullable receiver, NSString* _Nullable groupID, BOOL onlineUserOnly);
FOUNDATION_EXPORT void Open_im_sdkSetConversationDraft(NSString* _Nullable conversationID, NSString* _Nullable draftText, id<Open_im_sdkBase> _Nullable callback);
FOUNDATION_EXPORT void Open_im_sdkSetConversationListener(id<Open_im_sdkOnConversationListener> _Nullable listener);
FOUNDATION_EXPORT void Open_im_sdkSetConversationRecvMessageOpt(id<Open_im_sdkBase> _Nullable callback, NSString* _Nullable conversationIDList, long opt);
FOUNDATION_EXPORT void Open_im_sdkSetFriendInfo(NSString* _Nullable comment, id<Open_im_sdkBase> _Nullable callback);
FOUNDATION_EXPORT BOOL Open_im_sdkSetFriendListener(id<Open_im_sdkOnFriendshipListener> _Nullable listener);
FOUNDATION_EXPORT void Open_im_sdkSetGroupInfo(NSString* _Nullable jsonGroupInfo, id<Open_im_sdkBase> _Nullable callback);
FOUNDATION_EXPORT void Open_im_sdkSetGroupListener(id<Open_im_sdkOnGroupListener> _Nullable callback);
FOUNDATION_EXPORT void Open_im_sdkSetHearbeatInterval(int32_t interval);
/**
* 1 no print
*/
FOUNDATION_EXPORT void Open_im_sdkSetSdkLog(int32_t flag);
FOUNDATION_EXPORT void Open_im_sdkSetSelfInfo(NSString* _Nullable info, id<Open_im_sdkBase> _Nullable cb);
FOUNDATION_EXPORT int64_t Open_im_sdkStringToInt64(NSString* _Nullable i);
FOUNDATION_EXPORT void Open_im_sdkTransferGroupOwner(NSString* _Nullable groupId, NSString* _Nullable userId, id<Open_im_sdkBase> _Nullable callback);
FOUNDATION_EXPORT void Open_im_sdkTypingStatusUpdate(NSString* _Nullable receiver, NSString* _Nullable msgTip);
FOUNDATION_EXPORT void Open_im_sdkUnInitSDK(void);
// skipped function UnixSecondToTime with unsupported parameter or return types
// skipped function WarnByKv with unsupported parameter or return types
// skipped function Warning with unsupported parameter or return types
@class Open_im_sdkBase;
@class Open_im_sdkIMSDKListener;
@class Open_im_sdkOnAdvancedMsgListener;
@class Open_im_sdkOnConversationListener;
@class Open_im_sdkOnFriendshipListener;
@class Open_im_sdkOnGroupListener;
@class Open_im_sdkSendMsgCallBack;
@interface Open_im_sdkBase : NSObject <goSeqRefInterface, Open_im_sdkBase> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (void)onError:(long)errCode errMsg:(NSString* _Nullable)errMsg;
- (void)onSuccess:(NSString* _Nullable)data;
@end
@interface Open_im_sdkIMSDKListener : NSObject <goSeqRefInterface, Open_im_sdkIMSDKListener> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (void)onConnectFailed:(long)ErrCode ErrMsg:(NSString* _Nullable)ErrMsg;
- (void)onConnectSuccess;
- (void)onConnecting;
- (void)onKickedOffline;
- (void)onSelfInfoUpdated:(NSString* _Nullable)userInfo;
- (void)onUserTokenExpired;
@end
@interface Open_im_sdkOnAdvancedMsgListener : NSObject <goSeqRefInterface, Open_im_sdkOnAdvancedMsgListener> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (void)onRecvC2CReadReceipt:(NSString* _Nullable)msgReceiptList;
- (void)onRecvMessageRevoked:(NSString* _Nullable)msgId;
- (void)onRecvNewMessage:(NSString* _Nullable)message;
@end
@interface Open_im_sdkOnConversationListener : NSObject <goSeqRefInterface, Open_im_sdkOnConversationListener> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (void)onConversationChanged:(NSString* _Nullable)conversationList;
- (void)onNewConversation:(NSString* _Nullable)conversationList;
- (void)onSyncServerFailed;
- (void)onSyncServerFinish;
- (void)onSyncServerStart;
- (void)onTotalUnreadMessageCountChanged:(int32_t)totalUnreadCount;
@end
@interface Open_im_sdkOnFriendshipListener : NSObject <goSeqRefInterface, Open_im_sdkOnFriendshipListener> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (void)onBlackListAdd:(NSString* _Nullable)userInfo;
- (void)onBlackListDeleted:(NSString* _Nullable)userInfo;
- (void)onFriendApplicationListAccept:(NSString* _Nullable)applyUserInfo;
- (void)onFriendApplicationListAdded:(NSString* _Nullable)applyUserInfo;
- (void)onFriendApplicationListDeleted:(NSString* _Nullable)applyUserInfo;
- (void)onFriendApplicationListReject:(NSString* _Nullable)applyUserInfo;
- (void)onFriendInfoChanged:(NSString* _Nullable)friendInfo;
- (void)onFriendListAdded:(NSString* _Nullable)friendInfo;
- (void)onFriendListDeleted:(NSString* _Nullable)friendInfo;
@end
@interface Open_im_sdkOnGroupListener : NSObject <goSeqRefInterface, Open_im_sdkOnGroupListener> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (void)onApplicationProcessed:(NSString* _Nullable)groupId opUser:(NSString* _Nullable)opUser AgreeOrReject:(int32_t)AgreeOrReject opReason:(NSString* _Nullable)opReason;
- (void)onGroupCreated:(NSString* _Nullable)groupId;
- (void)onGroupInfoChanged:(NSString* _Nullable)groupId groupInfo:(NSString* _Nullable)groupInfo;
- (void)onMemberEnter:(NSString* _Nullable)groupId memberList:(NSString* _Nullable)memberList;
- (void)onMemberInvited:(NSString* _Nullable)groupId opUser:(NSString* _Nullable)opUser memberList:(NSString* _Nullable)memberList;
- (void)onMemberKicked:(NSString* _Nullable)groupId opUser:(NSString* _Nullable)opUser memberList:(NSString* _Nullable)memberList;
- (void)onMemberLeave:(NSString* _Nullable)groupId member:(NSString* _Nullable)member;
- (void)onReceiveJoinApplication:(NSString* _Nullable)groupId member:(NSString* _Nullable)member opReason:(NSString* _Nullable)opReason;
@end
@interface Open_im_sdkSendMsgCallBack : NSObject <goSeqRefInterface, Open_im_sdkSendMsgCallBack> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (void)onError:(long)errCode errMsg:(NSString* _Nullable)errMsg;
- (void)onProgress:(long)progress;
- (void)onSuccess:(NSString* _Nullable)data;
@end
#endif
|
OpenIMSDK/Open-IM-SDK-iOS
|
OpenIMSDKiOS/Classes/BaseModal.h
|
<gh_stars>10-100
//
// BaseModal.h
// Open-IM-SDK-iOS
//
// Created by xpg on 2021/11/4.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface BaseModal : NSObject
- (instancetype)initWithDictionary:(NSDictionary*)dictionary;
- (NSDictionary *)dict;
- (NSString *) className;
- (void)objectFromDictionary:(NSDictionary*) dict;
@end
NS_ASSUME_NONNULL_END
|
OpenIMSDK/Open-IM-SDK-iOS
|
OpenIMSDKiOS/Classes/ConversationInfo.h
|
<reponame>OpenIMSDK/Open-IM-SDK-iOS
//
// ConversationInfo.h
// Open-IM-SDK-iOS
//
// Created by xpg on 2021/11/5.
//
#import <Foundation/Foundation.h>
#import "BaseModal.h"
NS_ASSUME_NONNULL_BEGIN
@interface ConversationInfo : BaseModal
/**
* 会话id
*/
@property(nullable) NSString *conversationID;
/**
* 会话类型 1:单聊 2:群聊
*/
@property int conversationType;
/**
* 会话对象用户ID
*/
@property(nullable) NSString *userID;
/**
* 会话群聊ID
*/
@property(nullable) NSString *groupID;
/**
* 会话对象(用户或群聊)名称
*/
@property(nullable) NSString *showName;
/**
* 用户头像或群聊头像
*/
@property(nullable) NSString *faceUrl;
/**
* 接收消息选项:<br/>
* 0:在线正常接收消息,离线时进行推送<br/>
* 1:不会接收到消息<br/>
* 2:在线正常接收消息,离线不会有推送
*/
@property int recvMsgOpt;
/**
* 未读消息数量
*/
@property int unreadCount;
/**
* 最后一条消息 消息对象json字符串
*/
@property(nullable) NSString *latestMsg;
/**
* 最后一条消息发送时间(ns)
*/
@property long latestMsgSendTime;
/**
* 会话草稿
*/
@property(nullable) NSString *draftText;
/**
* 会话草稿设置时间
*/
@property long draftTimestamp;
/**
* 是否置顶,1置顶
*/
@property int isPinned;
@end
NS_ASSUME_NONNULL_END
|
OpenIMSDK/Open-IM-SDK-iOS
|
OpenIMSDKiOS/Classes/AtElem.h
|
<gh_stars>10-100
//
// AtElem.h
// Open-IM-SDK-iOS
//
// Created by xpg on 2021/11/5.
//
#import <Foundation/Foundation.h>
#import "BaseModal.h"
NS_ASSUME_NONNULL_BEGIN
@interface AtElem : BaseModal
/**
* at 消息内容
*/
@property(nullable) NSString *text;
/**
* 被@的用户id集合
*/
@property(nullable) NSArray<NSString*>/*List<String>*/ *atUserList;
/**
* 自己是否被@了
*/
@property bool isAtSelf;
@end
NS_ASSUME_NONNULL_END
|
khvorov/folly
|
folly/Portability.h
|
/*
* Copyright 2011-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <cstddef>
#include <folly/portability/Config.h>
#include <folly/CPortability.h>
// Unaligned loads and stores
namespace folly {
#if FOLLY_HAVE_UNALIGNED_ACCESS
constexpr bool kHasUnalignedAccess = true;
#else
constexpr bool kHasUnalignedAccess = false;
#endif
} // namespace folly
// compiler specific attribute translation
// msvc should come first, so if clang is in msvc mode it gets the right defines
// NOTE: this will only do checking in msvc with versions that support /analyze
#if _MSC_VER
#ifdef _USE_ATTRIBUTES_FOR_SAL
#undef _USE_ATTRIBUTES_FOR_SAL
#endif
/* nolint */
#define _USE_ATTRIBUTES_FOR_SAL 1
#include <sal.h> // @manual
#define FOLLY_PRINTF_FORMAT _Printf_format_string_
#define FOLLY_PRINTF_FORMAT_ATTR(format_param, dots_param) /**/
#else
#define FOLLY_PRINTF_FORMAT /**/
#define FOLLY_PRINTF_FORMAT_ATTR(format_param, dots_param) \
__attribute__((__format__(__printf__, format_param, dots_param)))
#endif
// warn unused result
#if defined(__has_cpp_attribute)
#if __has_cpp_attribute(nodiscard)
#define FOLLY_NODISCARD [[nodiscard]]
#endif
#endif
#if !defined FOLLY_NODISCARD
#if defined(_MSC_VER) && (_MSC_VER >= 1700)
#define FOLLY_NODISCARD _Check_return_
#elif defined(__clang__) || defined(__GNUC__)
#define FOLLY_NODISCARD __attribute__((__warn_unused_result__))
#else
#define FOLLY_NODISCARD
#endif
#endif
// target
#ifdef _MSC_VER
#define FOLLY_TARGET_ATTRIBUTE(target)
#else
#define FOLLY_TARGET_ATTRIBUTE(target) __attribute__((__target__(target)))
#endif
// detection for 64 bit
#if defined(__x86_64__) || defined(_M_X64)
#define FOLLY_X64 1
#else
#define FOLLY_X64 0
#endif
#if defined(__arm__)
#define FOLLY_ARM 1
#else
#define FOLLY_ARM 0
#endif
#if defined(__aarch64__)
#define FOLLY_AARCH64 1
#else
#define FOLLY_AARCH64 0
#endif
#if defined(__powerpc64__)
#define FOLLY_PPC64 1
#else
#define FOLLY_PPC64 0
#endif
namespace folly {
constexpr bool kIsArchArm = FOLLY_ARM == 1;
constexpr bool kIsArchAmd64 = FOLLY_X64 == 1;
constexpr bool kIsArchAArch64 = FOLLY_AARCH64 == 1;
constexpr bool kIsArchPPC64 = FOLLY_PPC64 == 1;
} // namespace folly
namespace folly {
#if FOLLY_SANITIZE_ADDRESS
constexpr bool kIsSanitizeAddress = true;
#else
constexpr bool kIsSanitizeAddress = false;
#endif
#if FOLLY_SANITIZE_THREAD
constexpr bool kIsSanitizeThread = true;
#else
constexpr bool kIsSanitizeThread = false;
#endif
#if FOLLY_SANITIZE
constexpr bool kIsSanitize = true;
#else
constexpr bool kIsSanitize = false;
#endif
} // namespace folly
// packing is very ugly in msvc
#ifdef _MSC_VER
#define FOLLY_PACK_ATTR /**/
#define FOLLY_PACK_PUSH __pragma(pack(push, 1))
#define FOLLY_PACK_POP __pragma(pack(pop))
#elif defined(__clang__) || defined(__GNUC__)
#define FOLLY_PACK_ATTR __attribute__((__packed__))
#define FOLLY_PACK_PUSH /**/
#define FOLLY_PACK_POP /**/
#else
#define FOLLY_PACK_ATTR /**/
#define FOLLY_PACK_PUSH /**/
#define FOLLY_PACK_POP /**/
#endif
// Generalize warning push/pop.
#if defined(_MSC_VER)
#define FOLLY_PUSH_WARNING __pragma(warning(push))
#define FOLLY_POP_WARNING __pragma(warning(pop))
// Disable the GCC warnings.
#define FOLLY_GNU_DISABLE_WARNING(warningName)
#define FOLLY_GCC_DISABLE_WARNING(warningName)
#define FOLLY_CLANG_DISABLE_WARNING(warningName)
#define FOLLY_MSVC_DISABLE_WARNING(warningNumber) \
__pragma(warning(disable : warningNumber))
#elif defined(__GNUC__)
// Clang & GCC
#define FOLLY_PUSH_WARNING _Pragma("GCC diagnostic push")
#define FOLLY_POP_WARNING _Pragma("GCC diagnostic pop")
#define FOLLY_GNU_DISABLE_WARNING_INTERNAL2(warningName) #warningName
#define FOLLY_GNU_DISABLE_WARNING(warningName) \
_Pragma( \
FOLLY_GNU_DISABLE_WARNING_INTERNAL2(GCC diagnostic ignored warningName))
#ifdef __clang__
#define FOLLY_CLANG_DISABLE_WARNING(warningName) \
FOLLY_GNU_DISABLE_WARNING(warningName)
#define FOLLY_GCC_DISABLE_WARNING(warningName)
#else
#define FOLLY_CLANG_DISABLE_WARNING(warningName)
#define FOLLY_GCC_DISABLE_WARNING(warningName) \
FOLLY_GNU_DISABLE_WARNING(warningName)
#endif
#define FOLLY_MSVC_DISABLE_WARNING(warningNumber)
#else
#define FOLLY_PUSH_WARNING
#define FOLLY_POP_WARNING
#define FOLLY_GNU_DISABLE_WARNING(warningName)
#define FOLLY_GCC_DISABLE_WARNING(warningName)
#define FOLLY_CLANG_DISABLE_WARNING(warningName)
#define FOLLY_MSVC_DISABLE_WARNING(warningNumber)
#endif
#ifdef FOLLY_HAVE_SHADOW_LOCAL_WARNINGS
#define FOLLY_GCC_DISABLE_NEW_SHADOW_WARNINGS \
FOLLY_GNU_DISABLE_WARNING("-Wshadow-compatible-local") \
FOLLY_GNU_DISABLE_WARNING("-Wshadow-local") \
FOLLY_GNU_DISABLE_WARNING("-Wshadow")
#else
#define FOLLY_GCC_DISABLE_NEW_SHADOW_WARNINGS /* empty */
#endif
// Globally disable -Wshadow for gcc < 5.
#if __GNUC__ == 4 && !__clang__
FOLLY_GCC_DISABLE_NEW_SHADOW_WARNINGS
#endif
/* Platform specific TLS support
* gcc implements __thread
* msvc implements __declspec(thread)
* the semantics are the same
* (but remember __thread has different semantics when using emutls (ex. apple))
*/
#if defined(_MSC_VER)
#define FOLLY_TLS __declspec(thread)
#elif defined(__GNUC__) || defined(__clang__)
#define FOLLY_TLS __thread
#else
#error cannot define platform specific thread local storage
#endif
#if FOLLY_MOBILE
#undef FOLLY_TLS
#endif
// It turns out that GNU libstdc++ and LLVM libc++ differ on how they implement
// the 'std' namespace; the latter uses inline namespaces. Wrap this decision
// up in a macro to make forward-declarations easier.
#if FOLLY_USE_LIBCPP
#include <__config> // @manual
#define FOLLY_NAMESPACE_STD_BEGIN _LIBCPP_BEGIN_NAMESPACE_STD
#define FOLLY_NAMESPACE_STD_END _LIBCPP_END_NAMESPACE_STD
#else
#define FOLLY_NAMESPACE_STD_BEGIN namespace std {
#define FOLLY_NAMESPACE_STD_END }
#endif
// If the new c++ ABI is used, __cxx11 inline namespace needs to be added to
// some types, e.g. std::list.
#if _GLIBCXX_USE_CXX11_ABI
#define FOLLY_GLIBCXX_NAMESPACE_CXX11_BEGIN \
inline _GLIBCXX_BEGIN_NAMESPACE_CXX11
#define FOLLY_GLIBCXX_NAMESPACE_CXX11_END _GLIBCXX_END_NAMESPACE_CXX11
#else
#define FOLLY_GLIBCXX_NAMESPACE_CXX11_BEGIN
#define FOLLY_GLIBCXX_NAMESPACE_CXX11_END
#endif
// MSVC specific defines
// mainly for posix compat
#ifdef _MSC_VER
#include <folly/portability/SysTypes.h>
// compiler specific to compiler specific
// nolint
#define __PRETTY_FUNCTION__ __FUNCSIG__
// Hide a GCC specific thing that breaks MSVC if left alone.
#define __extension__
// We have compiler support for the newest of the new, but
// MSVC doesn't tell us that.
#define __SSE4_2__ 1
#endif
// Debug
namespace folly {
#ifdef NDEBUG
constexpr auto kIsDebug = false;
#else
constexpr auto kIsDebug = true;
#endif
} // namespace folly
// Endianness
namespace folly {
#ifdef _MSC_VER
// It's MSVC, so we just have to guess ... and allow an override
#ifdef FOLLY_ENDIAN_BE
constexpr auto kIsLittleEndian = false;
#else
constexpr auto kIsLittleEndian = true;
#endif
#else
constexpr auto kIsLittleEndian = __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__;
#endif
constexpr auto kIsBigEndian = !kIsLittleEndian;
} // namespace folly
#ifndef FOLLY_SSE
#if defined(__SSE4_2__)
#define FOLLY_SSE 4
#define FOLLY_SSE_MINOR 2
#elif defined(__SSE4_1__)
#define FOLLY_SSE 4
#define FOLLY_SSE_MINOR 1
#elif defined(__SSE4__)
#define FOLLY_SSE 4
#define FOLLY_SSE_MINOR 0
#elif defined(__SSE3__)
#define FOLLY_SSE 3
#define FOLLY_SSE_MINOR 0
#elif defined(__SSE2__)
#define FOLLY_SSE 2
#define FOLLY_SSE_MINOR 0
#elif defined(__SSE__)
#define FOLLY_SSE 1
#define FOLLY_SSE_MINOR 0
#else
#define FOLLY_SSE 0
#define FOLLY_SSE_MINOR 0
#endif
#endif
#define FOLLY_SSE_PREREQ(major, minor) \
(FOLLY_SSE > major || FOLLY_SSE == major && FOLLY_SSE_MINOR >= minor)
#ifndef FOLLY_NEON
#if defined(__ARM_NEON) || defined(__ARM_NEON__)
#define FOLLY_NEON 1
#endif
#endif
#if FOLLY_UNUSUAL_GFLAGS_NAMESPACE
namespace FOLLY_GFLAGS_NAMESPACE {}
namespace gflags {
using namespace FOLLY_GFLAGS_NAMESPACE;
} // namespace gflags
#endif
// for TARGET_OS_IPHONE
#ifdef __APPLE__
#include <TargetConditionals.h> // @manual
#endif
// RTTI may not be enabled for this compilation unit.
#if defined(__GXX_RTTI) || defined(__cpp_rtti) || \
(defined(_MSC_VER) && defined(_CPPRTTI))
#define FOLLY_HAS_RTTI 1
#endif
#if defined(__APPLE__) || defined(_MSC_VER)
#define FOLLY_STATIC_CTOR_PRIORITY_MAX
#else
// 101 is the highest priority allowed by the init_priority attribute.
// This priority is already used by JEMalloc and other memory allocators so
// we will take the next one.
#define FOLLY_STATIC_CTOR_PRIORITY_MAX __attribute__((__init_priority__(102)))
#endif
namespace folly {
#if __OBJC__
constexpr auto kIsObjC = true;
#else
constexpr auto kIsObjC = false;
#endif
#if FOLLY_MOBILE
constexpr auto kIsMobile = true;
#else
constexpr auto kIsMobile = false;
#endif
#if defined(__linux__) && !FOLLY_MOBILE
constexpr auto kIsLinux = true;
#else
constexpr auto kIsLinux = false;
#endif
#if defined(_WIN32)
constexpr auto kIsWindows = true;
#else
constexpr auto kIsWindows = false;
#endif
#if __GLIBCXX__
constexpr auto kIsGlibcxx = true;
#else
constexpr auto kIsGlibcxx = false;
#endif
#if _LIBCPP_VERSION
constexpr auto kIsLibcpp = true;
#else
constexpr auto kIsLibcpp = false;
#endif
#if FOLLY_USE_LIBSTDCPP
constexpr auto kIsLibstdcpp = true;
#else
constexpr auto kIsLibstdcpp = false;
#endif
#if _MSC_VER
constexpr auto kMscVer = _MSC_VER;
#else
constexpr auto kMscVer = 0;
#endif
#if FOLLY_MICROSOFT_ABI_VER
constexpr auto kMicrosoftAbiVer = FOLLY_MICROSOFT_ABI_VER;
#else
constexpr auto kMicrosoftAbiVer = 0;
#endif
// cpplib is an implementation of the standard library, and is the one typically
// used with the msvc compiler
#if _CPPLIB_VER
constexpr auto kCpplibVer = _CPPLIB_VER;
#else
constexpr auto kCpplibVer = 0;
#endif
} // namespace folly
// Define FOLLY_USE_CPP14_CONSTEXPR to be true if the compiler's C++14
// constexpr support is "good enough".
#ifndef FOLLY_USE_CPP14_CONSTEXPR
#if defined(__clang__)
#define FOLLY_USE_CPP14_CONSTEXPR __cplusplus >= 201300L
#elif defined(__GNUC__)
#define FOLLY_USE_CPP14_CONSTEXPR __cplusplus >= 201304L
#else
#define FOLLY_USE_CPP14_CONSTEXPR 0 // MSVC?
#endif
#endif
#if FOLLY_USE_CPP14_CONSTEXPR
#define FOLLY_CPP14_CONSTEXPR constexpr
#else
#define FOLLY_CPP14_CONSTEXPR inline
#endif
// MSVC does not permit:
//
// extern int const num;
// constexpr int const num = 3;
//
// Instead:
//
// extern int const num;
// FOLLY_STORAGE_CONSTEXPR int const num = 3;
//
// True for MSVC 2015 and MSVC 2017.
#if _MSC_VER
#define FOLLY_STORAGE_CONSTEXPR
#define FOLLY_STORAGE_CPP14_CONSTEXPR
#else
#if __ICC
#define FOLLY_STORAGE_CONSTEXPR
#else
#define FOLLY_STORAGE_CONSTEXPR constexpr
#endif
#if FOLLY_USE_CPP14_CONSTEXPR
#define FOLLY_STORAGE_CPP14_CONSTEXPR constexpr
#else
#define FOLLY_STORAGE_CPP14_CONSTEXPR
#endif
#endif
#if __cpp_coroutines >= 201703L && __has_include(<experimental/coroutine>)
#define FOLLY_HAS_COROUTINES 1
#elif _MSC_VER && _RESUMABLE_FUNCTIONS_SUPPORTED
#define FOLLY_HAS_COROUTINES 1
#endif
// MSVC 2017.5 && C++17
#if __cpp_noexcept_function_type >= 201510 || \
(_MSC_FULL_VER >= 191225816 && _MSVC_LANG > 201402)
#define FOLLY_HAVE_NOEXCEPT_FUNCTION_TYPE 1
#endif
// Define FOLLY_HAS_EXCEPTIONS
#if __cpp_exceptions >= 199711 || FOLLY_HAS_FEATURE(cxx_exceptions)
#define FOLLY_HAS_EXCEPTIONS 1
#elif __GNUC__
#if __EXCEPTIONS
#define FOLLY_HAS_EXCEPTIONS 1
#else // __EXCEPTIONS
#define FOLLY_HAS_EXCEPTIONS 0
#endif // __EXCEPTIONS
#elif FOLLY_MICROSOFT_ABI_VER
#if _CPPUNWIND
#define FOLLY_HAS_EXCEPTIONS 1
#else // _CPPUNWIND
#define FOLLY_HAS_EXCEPTIONS 0
#endif // _CPPUNWIND
#else
#define FOLLY_HAS_EXCEPTIONS 1 // default assumption for unknown platforms
#endif
|
cultab/st
|
onedark.h
|
<reponame>cultab/st
static const char *colorname[] = {
/* 8 normal colors */
"#222222", //#424242
"#e06c75",
"#98c379",
"#d19a66",
"#61afef",
"#c678dd",
"#56b6c2",
"#d7d7d7",
/* 8 bright colors */
"#0f0f0f",
"#be5046",
"#7ec350",
"#d2863b",
"#309DF1",
"#8E68E6",
"#2DAFC3",
"#fdfdfd",
[255] = 0,
/* more colors can be added after 255 to use with DefaultXX */
"#d7d7d7",
"#cccccc",
"#282c34",
};
|
embeddedmz/mailclient-cpp
|
TestMAIL/test_utils.h
|
<gh_stars>10-100
#ifndef INCLUDE_TEST_UTILS_H_
#define INCLUDE_TEST_UTILS_H_
#include <algorithm>
#include <cerrno>
#include <cmath>
#include <cstdio>
#include <fstream>
#include <functional>
#include <iostream>
#include <iterator>
#include <memory>
#include <mutex>
#include <streambuf>
#include <string>
#include <sstream>
#include <sys/stat.h>
#include <thread>
#include <vector>
#ifdef WINDOWS
#ifdef _DEBUG
#ifdef _USE_VLD_
#include <vld.h>
#endif
#endif
#endif
#include "SimpleIni.h"
bool GlobalTestInit(const std::string& strConfFile);
void GlobalTestCleanUp(void);
void TimeStampTest(std::ostringstream& ssTimestamp);
int TestProgressCallback(void* ptr, double dTotalToDownload, double dNowDownloaded, double dTotalToUpload, double dNowUploaded);
#endif
|
embeddedmz/mailclient-cpp
|
MAIL/IMAPClient.h
|
<gh_stars>10-100
/*
* @file IMAPClient.h
* @brief libcurl wrapper for IMAP operations
*
* @author <NAME> <<EMAIL>>
* @date 2017-01-02
*/
#ifndef INCLUDE_IMAPCLIENT_H_
#define INCLUDE_IMAPCLIENT_H_
#include "MAILClient.h"
class CIMAPClient : public CMailClient
{
public:
enum class MailProperty
{
Deleted,
Seen,
Answered,
Flagged,
Draft,
Recent
};
enum class SearchOption
{
ANSWERED,
DELETED,
DRAFT,
FLAGGED,
NEW,
RECENT,
SEEN
};
explicit CIMAPClient(LogFnCallback oLogger);
// copy constructor and assignment operator are disabled
CIMAPClient(const CIMAPClient& Copy) = delete;
CIMAPClient& operator=(const CIMAPClient& Copy) = delete;
const bool CleanupSession() override;
/* list the folders within a mailbox and save it in strList */
const bool List(std::string& strList, const std::string& strFolderName = "");
/* list the subscribed folders and save it in strList */
const bool ListSubFolders(std::string& strList);
/* send a string as an e-mail */
const bool SendString(const std::string& strMail);
/* send a text file as an e-mail */
const bool SendFile(const std::string& strPath);
/* retrieve e-mail and save its content in strOutput */
const bool GetString(const std::string& strMsgNumber, std::string& strOutput);
/* retrieve e-mail and save its content in a file */
const bool GetFile(const std::string& strMsgNumber, const std::string& strFilePath);
/* delete an existing folder */
const bool DeleteFolder(const std::string& strMsgNumber);
/* perform a noop */
const bool Noop();
/* copy an e-mail from one folder to another */
const bool CopyMail(const std::string& strMsgNumber, const std::string& strFolder);
/* create a new folder */
const bool CreateFolder(const std::string& strFolderName);
/* modify the properties of an e-mail according to MailProperty */
const bool SetMailProperty(const std::string& strMsgNumber, MailProperty eNewProperty);
/* search for e-mails according to SearchOption */
const bool Search(std::string& strRes, SearchOption eSearchOption = SearchOption::NEW);
/* obtain information about a folder */
const bool InfoFolder(std::string& strFolderName, std::string& strInfo);
protected:
enum MailOperation
{
IMAP_NOOP,
IMAP_LIST,
IMAP_SEND_STRING,
IMAP_SEND_FILE,
IMAP_RETR_FILE,
IMAP_RETR_STRING,
IMAP_DELETE_FOLDER,
IMAP_INFO_FOLDER,
IMAP_LSUB,
IMAP_COPY,
IMAP_CREATE,
IMAP_SEARCH,
IMAP_STORE
};
const bool PrePerform() override;
const bool PostPerform(CURLcode ePerformCode) override;
inline void ParseURL(std::string& strURL) override final;
MailOperation m_eOperationType;
MailProperty m_eMailProperty;
SearchOption m_eSearchOption;
std::string m_strFrom;
std::string m_strTo;
std::string m_strCc;
std::string m_strMail;
std::string m_strMsgNumber;
std::string m_strFolderName;
std::string* m_pstrText;
};
#endif
|
embeddedmz/mailclient-cpp
|
MAIL/POPClient.h
|
<gh_stars>10-100
/*
* @file POPClient.h
* @brief libcurl wrapper for POP operations
*
* @author <NAME> <<EMAIL>>
* @date 2017-01-02
*/
#ifndef INCLUDE_POPCLIENT_H_
#define INCLUDE_POPCLIENT_H_
#include "MAILClient.h"
class CPOPClient : public CMailClient
{
public:
explicit CPOPClient(LogFnCallback oLogger);
// copy constructor and assignment operator are disabled
CPOPClient(const CPOPClient& Copy) = delete;
CPOPClient& operator=(const CPOPClient& Copy) = delete;
const bool CleanupSession() override;
/* list the contents of a mailbox and save it in strList */
const bool List(std::string& strList);
/* list the contents of a mailbox by unique ID and save it in strList */
const bool ListUIDL(std::string& strList);
/* retrieve e-mail and save its content in strOutput */
const bool GetString(const std::string& strMsgNumber, std::string& strOutput);
/* retrieve e-mail and save its content in a file */
const bool GetFile(const std::string& strMsgNumber, const std::string& strFilePath);
/* retrieve only the headers of an e-mail */
const bool GetHeaders(const std::string& strMsgNumber, std::string& strOutput);
/* delete an existing e-mail from the mailbox */
const bool Delete(const std::string& strMsgNumber);
/* perform a noop */
const bool Noop();
/* obtain message statistics and save it in strStat */
const bool Stat(std::string& strStat);
protected:
enum MailOperation
{
POP3_LIST,
POP3_RETR_STRING,
POP3_RETR_FILE,
POP3_DELE,
POP3_UIDL,
POP3_TOP,
POP3_STAT,
POP3_NOOP
};
const bool PrePerform() override;
const bool PostPerform(CURLcode ePerformCode) override;
inline void ParseURL(std::string& strURL) override final;
MailOperation m_eOperationType;
std::string m_strMsgNumber;
std::string* m_pstrText;
};
#endif
|
embeddedmz/mailclient-cpp
|
MAIL/SMTPClient.h
|
/*
* @file SMTPClient.h
* @brief libcurl wrapper for SMTP operations
*
* @author <NAME> <<EMAIL>>
* @date 2017-01-02
*/
#ifndef INCLUDE_SMTPCLIENT_H_
#define INCLUDE_SMTPCLIENT_H_
#include "MAILClient.h"
class CSMTPClient : public CMailClient
{
public:
explicit CSMTPClient(LogFnCallback oLogger);
// copy constructor and assignment operator are disabled
CSMTPClient(const CSMTPClient& Copy) = delete;
CSMTPClient& operator=(const CSMTPClient& Copy) = delete;
/* send a string as an e-mail */
const bool SendString(const std::string& strFrom, const std::string& strTo,
const std::string& strCc, const std::string& strMail);
/* send a text file as an e-mail */
const bool SendFile(const std::string& strFrom, const std::string& strTo,
const std::string& strCc, const std::string& strPath);
/* verify an e-mail address */
const bool VerifyAddress(const std::string& strAddress);
/* expand an e-mail mailing list */
const bool ExpandMailList(const std::string& strListName);
protected:
enum MailOperation
{
SMTP_SEND_STRING,
SMTP_SEND_FILE,
SMTP_VRFY,
SMTP_EXPN
};
const bool PrePerform() override;
const bool PostPerform(CURLcode ePerformCode) override;
inline void ParseURL(std::string& strURL) override final;
MailOperation m_eOperationType;
std::string m_strFrom;
std::string m_strTo;
std::string m_strCc;
std::string m_strMail;
};
#endif
|
embeddedmz/mailclient-cpp
|
MAIL/MAILClient.h
|
/*
* @file MAILClient.h
* @brief libcurl wrapper for email operations (POP3, IMAP and SMTP)
* This class contains the common stuff between POP3, IMAP and SMTP
* clients.
*
* It is intended to be an abstract class but for unit tests purposes
* I decided not to declare it so.
*
* @author <NAME> <<EMAIL>>
* @date 2017-01-01
*/
#ifndef INCLUDE_MAILCLIENT_H_
#define INCLUDE_MAILCLIENT_H_
#define CLIENT_USERAGENT "mailclientcpp-agent/1.0"
#include <algorithm>
#include <cstddef> // std::size_t
#include <cstdio> // snprintf
#include <cstdlib>
#include <cstring> // strerror, strlen, memcpy, strcpy
#include <ctime>
#include <curl/curl.h>
#include <fstream>
#include <functional>
#include <iostream>
#include <mutex>
#include <stdarg.h> // va_start, etc...
#include <stdio.h>
#include <stdlib.h>
#include <sstream>
#include <string>
#include <memory> // std::unique_ptr
#include "CurlHandle.h"
class CMailClient
{
public:
// Public definitions
typedef std::function<int(void*, double, double, double, double)> ProgressFnCallback;
typedef std::function<void(const std::string&)> LogFnCallback;
// Progress Function Data Object - parameter void* of ProgressFnCallback references it
struct ProgressFnStruct
{
ProgressFnStruct() : dLastRunTime(0), pCurl(nullptr), pOwner(nullptr) {}
double dLastRunTime;
CURL* pCurl;
/* owner of the MailClient object. can be used in the body of the progress
* function to send signals to the owner (e.g. to update a GUI's progress bar)
*/
void* pOwner;
};
enum SettingsFlag
{
NO_FLAGS = 0x00,
ENABLE_LOG = 0x01,
VERIFY_PEER = 0x02,
VERIFY_HOST = 0x04,
ALL_FLAGS = 0xFF
};
//enum class SslTlsFlag : unsigned char
// DO NOT combine them !
enum SslTlsFlag
{
NO_SSLTLS = 0x00,
ENABLE_TLS = 0x01,
ENABLE_SSL = 0x02
};
/* Please provide your logger thread-safe routine, otherwise, you can turn off
* error log messages printing by not using the flag ALL_FLAGS or ENABLE_LOG */
explicit CMailClient(LogFnCallback oLogger);
virtual ~CMailClient();
// copy constructor and assignment operator are disabled
CMailClient(const CMailClient& Copy) = delete;
CMailClient& operator=(const CMailClient& Copy) = delete;
// Setters - Getters (for unit tests)
void SetProgressFnCallback(void* pOwner, const ProgressFnCallback& fnCallback);
void SetProxy(const std::string& strProxy);
inline void SetTimeout(const int& iTimeout) { m_iCurlTimeout = iTimeout; }
inline void SetNoSignal(const bool& bNoSignal) { m_bNoSignal = bNoSignal; }
inline auto GetProgressFnCallback() const
{
return m_fnProgressCallback.target<int(*)(void*,double,double,double,double)>();
}
inline void* GetProgressFnCallbackOwner() const { return m_ProgressStruct.pOwner; }
inline const std::string& GetProxy() const { return m_strProxy; }
inline const int GetTimeout() const { return m_iCurlTimeout; }
inline const bool GetNoSignal() const { return m_bNoSignal; }
inline const std::string& GetURL() const { return m_strURL; }
inline const std::string& GetUsername() const { return m_strUserName; }
inline const std::string& GetPassword() const { return m_strPassword; }
inline const unsigned char GetFlags() const { return m_eSettingsFlags; }
inline const SslTlsFlag GetSslTlsFlags() const { return m_eSslTlsFlags; }
// Session
const bool InitSession(const std::string& strHost,
const std::string& strLogin,
const std::string& strPassword,
const SettingsFlag& SettingsFlags = ALL_FLAGS,
const SslTlsFlag& SslTlsFlags = NO_SSLTLS);
virtual const bool CleanupSession();
const CURL* GetCurlPointer() const { return m_pCurlSession; }
static const std::string& GetCertificateFile() { return s_strCertificationAuthorityFile; }
static void SetCertificateFile(const std::string& strPath) { s_strCertificationAuthorityFile = strPath; }
void SetSSLCertFile(const std::string& strPath) { m_strSSLCertFile = strPath; }
const std::string& GetSSLCertFile() const { return m_strSSLCertFile; }
void SetSSLKeyFile(const std::string& strPath) { m_strSSLKeyFile = strPath; }
const std::string& GetSSLKeyFile() const { return m_strSSLKeyFile; }
void SetSSLKeyPassword(const std::string& strPwd) { m_strSSLKeyPwd = strPwd; }
const std::string& GetSSLKeyPwd() const { return m_strSSLKeyPwd; }
inline const unsigned char GetSettingsFlags() const { return m_eSettingsFlags; }
#ifdef DEBUG_CURL
static void SetCurlTraceLogDirectory(const std::string& strPath);
#endif
protected:
virtual const bool PrePerform() { return true; }
/* common operations to SMTP, POP & IMAP are performed here */
const bool Perform();
virtual const bool PostPerform(CURLcode ePerformCode) { ePerformCode; return true; }
virtual inline void ParseURL(std::string& strURL) { strURL; }
// Curl callbacks
static size_t WriteInStringCallback(void* ptr, size_t size, size_t nmemb, void* data);
static size_t WriteToFileCallback(void* ptr, size_t size, size_t nmemb, void* data);
static size_t ReadLineFromFileStreamCallback(void* ptr, size_t size, size_t nmemb, void* stream);
static size_t ReadLineFromStringStreamCallback(void* ptr, size_t size, size_t nmemb, void* userp);
static size_t ReadFromFileCallback(void* ptr, size_t size, size_t nmemb, void* stream);
// Helper for error log printing
static std::string StringFormat(const std::string strFormat, ...);
#ifdef DEBUG_CURL
static int DebugCallback(CURL* curl, curl_infotype curl_info_type, char* strace, size_t nSize, void* pFile);
inline void StartCurlDebug();
inline void EndCurlDebug();
#endif
std::string m_strUserName;
std::string m_strPassword;
std::string m_strURL;
std::string m_strProxy;
bool m_bNoSignal;
/* Can be used in derived classes to perform file I/O or
* or input string stream operations */
std::string m_strLocalFile;
std::fstream m_fLocalFile;
std::istringstream m_ssString;
// SSL
static std::string s_strCertificationAuthorityFile;
std::string m_strSSLCertFile;
std::string m_strSSLKeyFile;
std::string m_strSSLKeyPwd;
mutable CURL* m_pCurlSession;
struct curl_slist* m_pRecipientslist;
int m_iCurlTimeout;
SettingsFlag m_eSettingsFlags;
SslTlsFlag m_eSslTlsFlags;
// Progress function
ProgressFnCallback m_fnProgressCallback;
ProgressFnStruct m_ProgressStruct;
bool m_bProgressCallbackSet;
// Log printer callback
LogFnCallback m_oLog;
#ifdef DEBUG_CURL
static std::string s_strCurlTraceLogDirectory;
std::ofstream m_ofFileCurlTrace;
#endif
CurlHandle& m_curlHandle;
};
inline CMailClient::SettingsFlag operator|(CMailClient::SettingsFlag a, CMailClient::SettingsFlag b) {
return static_cast<CMailClient::SettingsFlag>(static_cast<int>(a) | static_cast<int>(b));
}
// Logs messages
#define LOG_ERROR_CURL_ALREADY_INIT_MSG "[MAILClient][Error] Curl session is already initialized ! " \
"Use CleanupSession() to clean the present one."
#define LOG_ERROR_EMPTY_HOST_MSG "[MAILClient][Error] Empty hostname."
#define LOG_ERROR_CURL_NOT_INIT_MSG "[MAILClient][Error] Curl session is not initialized ! Use InitSession() before."
#define LOG_WARNING_OBJECT_NOT_CLEANED "[MAILClient][Warning] Object was freed before calling CMailClient::CleanupSession()." \
" The API session was cleaned though."
#define LOG_ERROR_PREPERFORM_FAILED_MSG "[MAILClient][Error] PrePerform failed !"
#define LOG_ERROR_POSTPERFORM_FAILED_MSG "[MAILClient][Error] PostPerform failed !"
#define LOG_ERROR_CURL_PEFORM_FAILURE_FORMAT "[MAILClient][Error] Unable to perform a request (Error=%d | %s) !"
#endif
|
jly007/JLYTableView
|
JLYTableViewDemo/ViewController.h
|
//
// ViewController.h
// JLYTableViewDemo
//
// Created by LingyuJi on 15/6/21.
// Copyright (c) 2015年 LingyuJi. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
|
jly007/JLYTableView
|
JLYTableViewDemo/JLYData.h
|
<reponame>jly007/JLYTableView
//
// JLYData.h
// MyAccountBook
//
// Created by LingyuJi on 15/6/19.
// Copyright (c) 2015年 LingyuJi. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface JLYData : NSObject
@property (nonatomic, copy) NSString *date;
@property (nonatomic, copy) NSString *rate;
@property (nonatomic, assign) NSInteger totalAssets;
@property (nonatomic, assign) NSInteger profitAndLoss;
+ (NSArray *)dataWithDictArray:(NSArray *)dicts;
@end
|
jly007/JLYTableView
|
JLYTableViewDemo/NSString+Number.h
|
//
// NSString+Number.h
// MyAccountBook
//
// Created by LingyuJi on 15/6/21.
// Copyright (c) 2015年 LingyuJi. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSString (Number)
+(NSString *)countNumAndChangeformat:(NSString *)num;
@end
|
jly007/JLYTableView
|
JLYTableViewDemo/JLYTableViewGlobals.h
|
//
// JLYTableViewGlobals.h
// MyAccountBook
//
// Created by LingyuJi on 15/6/20.
// Copyright (c) 2015年 LingyuJi. All rights reserved.
//
#import <Foundation/Foundation.h>
FOUNDATION_EXPORT NSString *const sNoAction;
@interface JLYTableViewGlobals : NSObject
@end
|
jly007/JLYTableView
|
JLYTableViewDemo/JLYTableView.h
|
//
// JLYTableView.h
// MyAccountBook
//
// Created by LingyuJi on 15/6/18.
// Copyright (c) 2015年 LingyuJi. All rights reserved.
//
#import <UIKit/UIKit.h>
@class JLYTableViewCell;
@protocol JLYTableViewDelegate <NSObject>
@optional
// return height of row
- (CGFloat)tableViewCell:(JLYTableViewCell *)tableViewCell heightForRow:(NSInteger)row;
// return bgcolor of each cell
- (UIColor *)tableViewCell:(JLYTableViewCell *)tableViewCell colorOfColumn:(NSInteger)column inRow:(NSInteger)row;
// return text color of each cell
- (UIColor *)tableViewCell:(JLYTableViewCell *)tableViewCell contentColorOfColumn:(NSInteger)column inRow:(NSInteger)row;
//return border color
- (UIColor *)tableViewCellBorderColor:(JLYTableViewCell *)tableViewCell;
//return border width
- (CGFloat)tableViewCellBorderWidth:(JLYTableViewCell *)tableViewCell;
// return font of text
- (UIFont *)tableViewCell:(JLYTableViewCell *)tableViewCell fontOfColumn:(NSInteger)column;
//return border color
- (UIColor *)tableHeaderViewBorderColor:(JLYTableViewCell *)headerView;
//return border width
- (CGFloat)tableHeaderViewBorderWidth:(JLYTableViewCell *)headerView;
// return bgcolor of headerView cell
- (UIColor *)tableHeaderView:(JLYTableViewCell *)headerView colorOfColumn:(NSInteger)column;
// return text color of headerView cell
- (UIColor *)tableHeaderView:(JLYTableViewCell *)headerView contentColorOfColumn:(NSInteger)column;
// return font of headerView text
- (UIFont *)tableHeaderView:(JLYTableViewCell *)headerView fontOfColumn:(NSInteger)column;
// return alignment of headerView text
- (NSTextAlignment)tableHeaderViewAlignment:(JLYTableViewCell *)headerView;
@end
@interface JLYTableView : UIView
@property (nonatomic, weak) id <JLYTableViewDelegate> delegate;
- (id)initWithFrame:(CGRect)rect
widths:(NSArray *)widths
plistFile:(NSString *)fileName
actions:(NSArray *)actions
headerViewTitles:(NSArray *)titles
headerViewHeight:(CGFloat)height
delegate:(id)delegate;
@end
|
jly007/JLYTableView
|
JLYTableViewDemo/JLYTableViewCell.h
|
<reponame>jly007/JLYTableView<filename>JLYTableViewDemo/JLYTableViewCell.h
//
// JLYTableViewCell.h
// MyAccountBook
//
// Created by LingyuJi on 15/6/18.
// Copyright (c) 2015年 LingyuJi. All rights reserved.
//
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSInteger, JLYTableViewCellMode)
{
JLYTableViewCellModeCenter,
JLYTableViewCellModeLeft,
JLYTableViewCellModeRight,
};
@class JLYTableViewCell;
@protocol JLYTableViewCellDelegate <NSObject>
// return column number
- (NSInteger)tableViewCell:(JLYTableViewCell *)tableViewCell columnsInRow:(NSInteger)index;
// return width of column
- (CGFloat)tableViewCell:(JLYTableViewCell *)tableViewCell widthForColumn:(NSInteger)column;
// return text for each cell
- (NSString *)tableViewCell:(JLYTableViewCell *)tableViewCell textForColumn:(NSInteger)column inRow:(NSInteger)row;
// return NSString *actions[row][col] == sNoAction
- (BOOL)tableViewCell:(JLYTableViewCell *)tableViewCell addActionForColumn:(NSInteger)column inRow:(NSInteger)row;
//@optional
// return height of row
- (CGFloat)tableViewCell:(JLYTableViewCell *)tableViewCell heightForRow:(NSInteger)row;
// return bgcolor of each cell
- (UIColor *)tableViewCell:(JLYTableViewCell *)tableViewCell colorOfColumn:(NSInteger)column inRow:(NSInteger)row;
// return text color of each cell
- (UIColor *)tableViewCell:(JLYTableViewCell *)tableViewCell contentColorOfColumn:(NSInteger)column inRow:(NSInteger)row;
//return border color
- (UIColor *)tableViewCellBorderColor:(JLYTableViewCell *)tableViewCell;
//return border width
- (CGFloat)tableViewCellBorderWidth:(JLYTableViewCell *)tableViewCell;
// return font of text
- (UIFont *)tableViewCell:(JLYTableViewCell *)tableViewCell fontOfColumn:(NSInteger)column;
// tap a cell
- (void)tableViewCell:(JLYTableViewCell *)tableViewCell didSelectColumn:(NSInteger)column inRow:(NSInteger)row;
//return border color
- (UIColor *)tableHeaderViewBorderColor:(JLYTableViewCell *)headerView;
//return border width
- (CGFloat)tableHeaderViewBorderWidth:(JLYTableViewCell *)headerView;
// return bgcolor of headerView cell
- (UIColor *)tableHeaderView:(JLYTableViewCell *)headerView colorOfColumn:(NSInteger)column;
// return text color of headerView cell
- (UIColor *)tableHeaderView:(JLYTableViewCell *)headerView contentColorOfColumn:(NSInteger)column;
// return font of headerView text
- (UIFont *)tableHeaderView:(JLYTableViewCell *)headerView fontOfColumn:(NSInteger)column;
// return alignment of headerView text
- (NSTextAlignment)tableHeaderViewAlignment:(JLYTableViewCell *)headerView;
@end
@interface JLYTableViewCell : UITableViewCell
@property (nonatomic, weak) id <JLYTableViewCellDelegate> delegate;
@property (nonatomic, assign ,readonly) JLYTableViewCellMode mode;
- (void)setMode:(JLYTableViewCellMode)mode withMargin:(CGFloat)margin;
- (void)initializeWithRowIndex:(NSInteger)rowIndex;
- (void)initializeWithTitles:(NSArray *)titles;
@end
|
potato3d/lindstrom
|
src/alg/qspline.h
|
<filename>src/alg/qspline.h<gh_stars>0
// qspline.h
// v-Quaternion spline interpolation
// Ref. "v-Quaternion Splines for the Smooth Interpolation of Orientations"
// <NAME>, IEEE Trans. on Vis. and C.G., 10(2), 2004.
// Dec 2005
// <EMAIL>
#ifndef utl_qspline_h
#define utl_qspline_h
#include <assert.h>
#include <stdio.h>
class AlgQSpline
{
struct Quat {
double x, y, z, w;
Quat () {}
Quat (double angle, double ux, double uy, double uz);
};
int m_n; // number of given Orientations (in fact, n+1 Orientations are given)
int m_size; // allocated size of vectors
int* m_ind; // orientation indirection (to deal with duplicate orientations)
Quat* m_Q; // interpolation Orientations
Quat* m_R; // right control Orientations
Quat* m_L; // left control Orientations
double* m_t; // knot values
double* m_v; // tension values
double* m_a; // temporary A-vector of tridiagonal system
double* m_b; // temporary B-vector of tridiagonal system
double* m_c; // temporary C-vector of tridiagonal system
Quat* m_d0; // temporary C-vector of tridiagonal system
Quat* m_d; // temporary C-vector of tridiagonal system
int m_auto_knot; // automatic knot value generation (0=NONE, 1=UNIFORM, 2=NONUNIFORM)
double m_def_v; // current tension value
public:
AlgQSpline ();
~AlgQSpline ();
// Set the default tension value
void SetDefaultTension (double v);
// Set the auto knot value generation method (0=NONE, 1=UNIFORM, 2=NONUNIFORM)
// This value is used when computing the spline.
void SetAutoKnotMethod (int autoknot);
// Begin interpolation Quat
// It resets all existing data.
void Begin ();
// Add an interpolation orientation, giving the angle and direction of rotation.
void AddOrientation (double angle, double ux, double uy, double uz);
// Add an interpolation orientation, giving the rotation matrix.
void AddMatrix (double R[3][3]);
// Set tension value of last added ratation
void SetTension (double v);
// Set knot value of last added ratation
void SetKnot (double t);
// Signilize the end of interpolation Quat.
// It computes the quaternion spline, returning 'true' on success.
bool End ();
// Re-set an interpolation orientation
bool ModifyOrientation (int i, double angle, double ux, double uy, double uz);
// Re-set an interpolation orientation
bool ModifyMatrix (int i, double R[3][3]);
// Re-set a knot value
bool ModifyKnot (int i, double t);
// Re-set a tension value
bool ModifyTension (int i, double v);
// Re-compute the qspline
// It returns 'true' on success.
bool Recompute ();
// Return the corresponding Orientation
// If the value of t is out of range, it is clamped to the initial or final value.
void GetOrientation (double t, double* angle, double* ux, double* uy, double* uz);
// Return number of rotations
int GetNOrientations ();
// Return the corresponding given rotation
void GetGivenOrientation (int i, double* angle, double* ux, double* uy, double* uz);
// Return the corresponding knot value
double GetKnot (int i);
// Return the corresponding tension value
double GetTension (int i);
private:
double Ti (int i) {
assert(i>=0 && i<=m_n);
return m_t[i];
}
double Ni (int i) {
assert(i>=0 && i<=m_n);
return m_v[i];
}
double Hi (int i) {
return (i==0 || i==m_n+1) ? 0.0f : Ti(i) - Ti(i-1);
}
double Gi (int i) {
return 2*(Hi(i) + Hi(i+1)) / (Ni(i)*Hi(i)*Hi(i+1) + 2*(Hi(i)+Hi(i+1)));
}
double Mi (int i) {
return (Gi(i)*Hi(i)) / (Gi(i)*Hi(i) + Hi(i+1) + Gi(i+1)*Hi(i+2));
}
double Li (int i) {
return (Gi(i-1)*Hi(i-1) + Hi(i)) / (Gi(i-1)*Hi(i-1) + Hi(i) + Gi(i)*Hi(i+1));
}
double Di (int i) {
return Hi(i) / (Hi(i)+Hi(i+1));
}
const Quat& MatrixToQuat (double R[3][3]);
const Quat& CorrectDirection (const Quat&q);
void QuatToOrientation (const Quat& q, double* angle, double* ux, double* uy, double* uz);
void GenerateKnot ();
void EliminateDuplications ();
double Angle (const Quat& q0, const Quat& q1);
const Quat& Geodesic (double t, const Quat& q0, const Quat& q1);
void FillA ();
void FillB ();
void FillC ();
bool Solve4DSpline ();
void Normalize (Quat* d);
void SolveQSpline ();
double EvalMaxError (Quat* d, Quat* d0);
void FillRL ();
void Reserve ();
void AdjustSize ();
void AllocAux();
void FreeAux();
void AllocTemp ();
void FreeTemp ();
public:
void Debug ();
};
#endif
|
potato3d/lindstrom
|
src/alg/plane.h
|
<gh_stars>0
//* plane.h
// Represents plane
// <EMAIL>
// Feb 2003
#ifndef ALG_PLANE_H
#define ALG_PLANE_H
#include <math.h>
#include <stdio.h>
#include "defines.h"
#include "vector.h"
class ALG_API AlgPlane
{
public:
float a,b,c,d;
AlgPlane ()
{
}
AlgPlane (float a, float b, float c, float d)
: a(a),b(b),c(c),d(d)
{
}
AlgPlane (const AlgVector& n, float d)
: a(n.x),b(n.y),c(n.z),d(d)
{
}
~AlgPlane ()
{
}
void Set (float a, float b, float c, float d)
{
this->a = a;
this->b = b;
this->c = c;
this->d = d;
}
void Set (const AlgVector &n, float d)
{
this->a = n.x;
this->b = n.y;
this->c = n.z;
this->d = d;
}
// Set the plane as defined by three points
void Set (const AlgVector& v0, const AlgVector& v1, const AlgVector& v2)
{
AlgVector d1(v1-v0);
AlgVector d2(v2-v0);
AlgVector n(d1^d2); n.Normalize();
float d = -n.Dot(v0);
Set(n,d);
}
AlgVector GetNormal () const
{
return AlgVector(a,b,c);
}
void Normalize ()
{
float l = (float)sqrt(a*a+b*b+c*c);
if (fabs(l) > ALG_TOL) {
float il = 1.0f/l;
a *= il; b *= il; c *= il; d *= il;
}
}
float Distance (const AlgVector& p) const
{
return a*p.x+b*p.y+c*p.z+d;
}
void Print (const char* label=0) const
{
printf("%s = {%g, %g, %g, %g}\n",label?label:"plane",a,b,c,d);
}
// Free friend functions
friend AlgVector Intersect
(const AlgPlane& p1, const AlgPlane& p2, const AlgPlane& p3)
{
AlgVector v(0.0f,0.0f,0.0f);
float d = AlgPlane::Det(p1.a,p1.b,p1.c,p2.a,p2.b,p2.c,p3.a,p3.b,p3.c);
if (d!=0.0)
{
v.Set(Det(-p1.d,p1.b,p1.c,-p2.d,p2.b,p2.c,-p3.d,p3.b,p3.c)/d,
Det(p1.a,-p1.d,p1.c,p2.a,-p2.d,p2.c,p3.a,-p3.d,p3.c)/d,
Det(p1.a,p1.b,-p1.d,p2.a,p2.b,-p2.d,p3.a,p3.b,-p3.d)/d
);
}
return v;
}
private:
static float Det(float m11, float m12, float m13,
float m21, float m22, float m23,
float m31, float m32, float m33
)
{
return ((m11)*(m22)*(m33)-(m11)*(m23)*(m32)-(m21)*(m12)*(m33)+
(m21)*(m13)*(m32)+(m31)*(m12)*(m23)-(m31)*(m13)*(m22));
}
};
#endif
|
potato3d/lindstrom
|
src/alg/matrix.h
|
<filename>src/alg/matrix.h
//* matrix.h
// Implements a 4x4 matrix to support graphics operation.
// <EMAIL>
// <EMAIL>
// Jun 2002
#ifndef ALG_MATRIX_H
#define ALG_MATRIX_H
#include "defines.h"
#include "vector.h"
#include "quatern.h"
#include "plane.h"
#include <ds/stack.h>
#include <string.h>
class ALG_API AlgMatrix
{
float m_v[16];
public:
static AlgMatrix GetIdentity ();
AlgMatrix()
{
}
/**
* Copy constructor
*/
AlgMatrix (const AlgMatrix& m)
{
memcpy(m_v,m.m_v,16*sizeof(float));
}
AlgMatrix (const float *v)
{
memcpy(m_v,v,16*sizeof(float));
}
AlgMatrix (const double *v)
{
for(int i=0; i<16; i++)
m_v[i] = (float)v[i];
}
AlgMatrix(const AlgVector& x, const AlgVector& y, const AlgVector& z);
void operator = (const AlgMatrix&m);
void operator = (const float* m);
void Identity ();
void Translate (float x, float y, float z);
void Translate (const AlgVector& v);
void Scale (float x, float y, float z);
void Scale (const AlgVector& v);
void Scale (float x, float y, float z, float rx, float ry, float rz);
void Scale (const AlgVector& v, const AlgVector& r);
void Scale (float s);
void Rotate (float a, float x, float y, float z);
void Rotate (float a, const AlgVector& p);
void Rotate (const AlgQuatern& q);
void Rotate (float a, float x, float y, float z, float rx, float ry, float rz);
void Rotate (float a, const AlgVector& p, const AlgVector& r);
void Rotate (const AlgQuatern& q, const AlgVector& r);
void LookAt (const AlgVector& pos, const AlgVector& target, const AlgVector& up);
void Ortho (float pleft, float pright, float pbottom, float ptop, float pnear, float pfar);
void Frustum (float pleft, float pright, float pbottom, float ptop, float pnear, float pfar);
void Perspective (float fovy, float aspect, float znear, float zfar);
void Accum (const AlgMatrix& m);
void PreAccum(const AlgMatrix& m);
void SetMatrix (const float* v);
void SetMatrix (const double* v);
void Transpose ();
bool IsIdentity () const;
void Invert ();
AlgMatrix Inverse () const;
AlgVector Transform(float x, float y, float z) const;
void Transform(float*x, float*y, float*z) const;
void Transform(float*x, float*y, float*z, float*w) const;
void Transform(int n, int nelem, float *v) const;
AlgVector Transform(const AlgVector& p) const;
AlgVector TransformNormal(float nx, float ny, float nz) const;
AlgVector TransformNormal(const AlgVector& n) const;
void TransformNormals(int n, float *v) const;
AlgPlane TransformPlane(float a, float b, float c, float d) const;
AlgPlane TransformPlane(const AlgPlane& p) const;
AlgVector TransformVector(float vx, float vy, float vz) const;
AlgVector TransformVector(const AlgVector& v) const;
const float* GetMatrix () const
{
return m_v;
}
void GetMatrixDouble (double* v) const
{
int i;
for (i=0; i<16; i++)
v[i] = m_v[i];
}
void Print (const char* label=0) const;
bool operator == (const AlgMatrix& m);
};
class ALG_API AlgStackMatrix : public DsStack<AlgMatrix>
{
public:
AlgStackMatrix ()
: DsStack<AlgMatrix>()
{
Init();
}
void Clear ()
{
DsStack<AlgMatrix>::Clear();
Init();
}
private:
void Init ()
{
AlgMatrix m;
m.Identity();
Push(m);
}
};
#endif
|
potato3d/lindstrom
|
src/alg/glmatrixstack.h
|
// GL and matrix stack class
// <EMAIL>
// Sep 2004
#ifndef ALG_GL_MATRIX_STACK_H
#define ALG_GL_MATRIX_STACK_H
#include "glstack.h"
#include "matrixstack.h"
/**
* This class interfaces for the OpenGL matrix stack, while maintaining a AlgMatrix stack.
* It defines methods for:
* - setting the base matrix (eg. the projection+view matrix), so that identity() takes to this space.
* - accumulating/pushing/popping transformations.
* - obtaining the stack top
*/
class ALG_API AlgGLMatrixStack : public AlgGLStack
{
AlgMatrixStack m_stack;
public:
AlgGLMatrixStack () : m_stack()
{
}
virtual ~AlgGLMatrixStack ()
{
}
virtual AlgMatrix GetTop ()
{
return m_stack.GetTop();
}
virtual void Push ()
{
m_stack.Push();
AlgGLStack::Push();
}
virtual void Pop ()
{
m_stack.Pop();
AlgGLStack::Pop();
}
virtual void Identity ()
{
m_stack.Identity();
AlgGLStack::Identity();
}
virtual void LoadMatrix (const AlgMatrix& m)
{
m_stack.LoadMatrix(m);
AlgGLStack::LoadMatrix(m);
}
virtual void Translate (float x, float y, float z)
{
m_stack.Translate(x,y,z);
AlgGLStack::Translate(x,y,z);
}
virtual void Translate (const AlgVector& v)
{
m_stack.Translate(v);
AlgGLStack::Translate(v);
}
virtual void Scale (float x, float y, float z)
{
m_stack.Scale(x,y,z);
AlgGLStack::Scale(x,y,z);
}
virtual void Scale (const AlgVector& v)
{
m_stack.Scale(v);
AlgGLStack::Scale(v);
}
virtual void Scale (float x,float y,float z,float rx,float ry,float rz)
{
m_stack.Scale(x,y,z,rx,ry,rz);
AlgGLStack::Scale(x,y,z,rx,ry,rz);
}
virtual void Scale (const AlgVector& v, const AlgVector& r)
{
m_stack.Scale(v,r);
AlgGLStack::Scale(v,r);
}
virtual void Rotate (float a, float x, float y, float z)
{
m_stack.Rotate(a,x,y,z);
AlgGLStack::Rotate(a,x,y,z);
}
virtual void Rotate (float a, const AlgVector& p)
{
m_stack.Rotate(a,p);
AlgGLStack::Rotate(a,p);
}
virtual void Rotate (const AlgQuatern& q)
{
m_stack.Rotate(q);
AlgGLStack::Rotate(q);
}
virtual void Rotate (float a,float x,float y,float z,float rx,float ry,float rz)
{
m_stack.Rotate(a,x,y,z,rx,ry,rz);
AlgGLStack::Rotate(a,x,y,z,rx,ry,rz);
}
virtual void Rotate (float a, const AlgVector& p, const AlgVector& r)
{
m_stack.Rotate(a,p,r);
AlgGLStack::Rotate(a,p,r);
}
virtual void Rotate (const AlgQuatern& q, const AlgVector& r)
{
m_stack.Rotate(q,r);
AlgGLStack::Rotate(q,r);
}
virtual void LookAt (const AlgVector& pos, const AlgVector& target, const AlgVector& up)
{
m_stack.LookAt(pos,target,up);
AlgGLStack::LookAt(pos,target,up);
}
virtual void Ortho (float pleft, float pright, float pbottom, float ptop, float pnear, float pfar)
{
m_stack.Ortho(pleft,pright,pbottom,ptop,pnear,pfar);
AlgGLStack::Ortho(pleft,pright,pbottom,ptop,pnear,pfar);
}
virtual void Frustum (float pleft, float pright, float pbottom, float ptop, float pnear, float pfar)
{
m_stack.Frustum(pleft,pright,pbottom,ptop,pnear,pfar);
AlgGLStack::Frustum(pleft,pright,pbottom,ptop,pnear,pfar);
}
virtual void Perspective (float fovy, float aspect, float znear, float zfar)
{
m_stack.Perspective(fovy,aspect,znear,zfar);
AlgGLStack::Perspective(fovy,aspect,znear,zfar);
}
virtual void Accum (const AlgMatrix& m)
{
m_stack.Accum(m);
AlgGLStack::Accum(m);
}
virtual void PreAccum (const AlgMatrix& m) // TODO: untested
{
m_stack.PreAccum(m);
AlgGLStack::PreAccum(m);
}
};
#endif
|
potato3d/lindstrom
|
src/alg/vector.h
|
<filename>src/alg/vector.h
//* vector.h
// Represents 3D point.
// <EMAIL>
// Jul 2002
#ifndef ALG_VECTOR_H
#define ALG_VECTOR_H
#include <math.h>
#include <stdio.h>
#include "defines.h"
class ALG_API AlgVector
{
public:
float x, y, z;
AlgVector ()
{
}
AlgVector (float vx, float vy, float vz)
: x(vx), y(vy), z(vz)
{
}
AlgVector (const float v[3])
: x(v[0]), y(v[1]), z(v[2])
{
}
~AlgVector ()
{
}
void Set (float vx, float vy, float vz)
{
x = vx; y = vy; z = vz;
}
void Set (const float v[3])
{
x = v[0]; y = v[1]; z = v[2];
}
float Dot (const AlgVector& q) const
{
return x*q.x + y*q.y + z*q.z;
}
void Cross (const AlgVector& a, const AlgVector& b)
{
x = a.y*b.z - a.z*b.y;
y = a.z*b.x - a.x*b.z;
z = a.x*b.y - a.y*b.x;
}
float SqrLength() const
{
return (x*x+y*y+z*z);
}
float Length () const
{
return (float)sqrt(x*x+y*y+z*z);
}
/**
* Normalizes the vector. Returns the previous vector norm.
*/
float Normalize ()
{
float l = Length();
if (l != 0.0f && ALG_FINITE(l))
{
float d = 1.0f/l;
x *= d; y *= d; z *= d;
}
return l;
}
float Angle( const AlgVector& v ) const
{
return (float)(acos( Dot(v) / (Length()*v.Length()) ));
}
void Print (const char* label) const
{
printf("%s = {%g, %g, %g}\n",label,x,y,z);
}
//* Operators
//* Add other vector in place
AlgVector& operator+= (const AlgVector& other)
{
x += other.x; y += other.y; z += other.z;
return *this;
}
//* Add a scalar in place
AlgVector& operator+= (float scalar)
{
x += scalar; y += scalar; z += scalar;
return *this;
}
//* Subtract other vector in place
AlgVector& operator-= (const AlgVector& other)
{
x -= other.x; y -= other.y; z -= other.z;
return *this;
}
//* Subtract a scalar in place
AlgVector& operator-= (float scalar)
{
x -= scalar; y -= scalar; z -= scalar;
return *this;
}
//* Unary minus operator
AlgVector operator- ()
{
AlgVector v(-x,-y,-z);
return v;
}
//* Multiply other vector, component by component, in place
AlgVector& operator*= (const AlgVector& other)
{
x *= other.x; y *= other.y; z *= other.z;
return *this;
}
//* Multiply a scalar in place
AlgVector& operator*= (float scalar)
{
x *= scalar; y *= scalar; z *= scalar;
return *this;
}
//* Divide by a scalar in place
AlgVector& operator/= (float scalar)
{
x /= scalar; y /= scalar; z /= scalar;
return *this;
}
//* Free operators
friend bool operator == (const AlgVector& v1, const AlgVector& v2)
{
return (v1.x == v2.x) && (v1.y == v2.y) && (v1.z == v2.z);
}
friend bool operator != (const AlgVector& v1, const AlgVector& v2)
{
return (v1.x != v2.x) || (v1.y != v2.y) || (v1.z != v2.z);
}
//* Add two vectors
friend AlgVector operator+ (const AlgVector& one, const AlgVector& other)
{
AlgVector res(one);
return res+=other;
}
//* Add a vector and a scalar
friend AlgVector operator+ (const AlgVector& one, float scalar)
{
AlgVector res(one);
return res+=scalar;
}
//* Add a scalar and a vector
friend AlgVector operator+ (float scalar, const AlgVector& one)
{
AlgVector res(one);
return res+=scalar;
}
//* Subtract two vectors
friend AlgVector operator- (const AlgVector& one, const AlgVector& other)
{
AlgVector res(one);
return res-=other;
}
//* Subtract a vector by a scalar
friend AlgVector operator- (const AlgVector& one, float scalar)
{
AlgVector res(one);
return res-=scalar;
}
//* Subtract a scalar from a vector
friend AlgVector operator- (float scalar, const AlgVector& one)
{
AlgVector res(one);
res*=-1;
return res+=scalar;
}
//* Multiply component by component
friend AlgVector operator* (const AlgVector& one, const AlgVector& other)
{
AlgVector res(one.x*other.x,one.y*other.y,one.z*other.z);
return res;
}
//* Multiply a vector by a scalar
friend AlgVector operator* (const AlgVector& one, float scalar)
{
AlgVector res(one);
return res*=scalar;
}
//* Multiply a scalar by a vector
friend AlgVector operator* (float scalar, const AlgVector& one)
{
AlgVector res(one);
return res*=scalar;
}
//* Divide a vector by a scalar
friend AlgVector operator/ (const AlgVector& one, float scalar)
{
AlgVector res(one);
return res/=scalar;
}
//* Divide a scalar by a vector
friend AlgVector operator/ (float scalar, const AlgVector& one)
{
AlgVector res(scalar/one.x,scalar/one.y,scalar/one.z);
return res;
}
//* Cross product
friend AlgVector operator^ (const AlgVector& a, const AlgVector& b)
{
AlgVector res(a.y*b.z-b.y*a.z,b.x*a.z-a.x*b.z,a.x*b.y-b.x*a.y);
return res;
}
};
#endif
|
potato3d/lindstrom
|
src/alg/spline.h
|
// spline.h
// v-Spline interpolation
// Ref. "v-Quaternion Splines for the Smooth Interpolation of Orientations"
// <NAME>, IEEE Trans. on Vis. and C.G., 10(2), 2004.
// Dec 2005
// <EMAIL>
#ifndef utl_spline_h
#define utl_spline_h
#include <assert.h>
class AlgSpline
{
struct Point {
double x, y, z;
};
int m_n; // number of given Positions (in fact, n+1 Positions are given)
int m_nseg; // number of segments
int m_size; // allocated size of vectors
int* m_ind; // point indirection (to deal with duplicate points)
Point* m_P; // interpolation Positions
Point* m_R; // right control Positions
Point* m_L; // left control Positions
double* m_t; // knot values
double* m_v; // tension values
double* m_a; // temporary A-vector of tridiagonal system
double* m_b; // temporary B-vector of tridiagonal system
double* m_c; // temporary C-vector of tridiagonal system
Point* m_d; // temporary C-vector of tridiagonal system
int m_auto_knot; // automatic knot value generation (0=NONE, 1=UNIFORM, 2=NONUNIFORM)
double m_def_v; // default tension value
public:
AlgSpline ();
~AlgSpline ();
// Set the default tension value
void SetDefaultTension (double v);
// Set the auto knot value generation method (0=NONE, 1=UNIFORM, 2=NONUNIFORM)
// This value is used when computing the spline.
void SetAutoKnotMethod (int autoknot);
// Begin interpolation Point
// It resets all existing data.
void Begin ();
// Add an interpolation Point.
void AddPosition (double x, double y, double z);
// Set tension value of last added position
void SetTension (double v);
// Set knot value of last added position
void SetKnot (double t);
// Signilize the end of interpolation Point.
// It computes the spline, returning 'true' on success.
bool End ();
// Re-set an interpolation Point
bool ModifyPosition (int i, double x, double y, double z);
// Re-set a knot value
bool ModifyKnot (int i, double t);
// Re-set a tension value
bool ModifyTension (int i, double v);
// Re-compute the spline
// It returns 'true' on success.
bool Recompute ();
// Return the corresponding Point coordinate
// If the value of t is out of range, it is clamped to the initial or final value.
void GetPosition (double t, double* x, double* y, double* z);
// Return number of segments (including zero-length segments)
int GetNSegments ();
// Return number of positions
int GetNPositions ();
// Return the corresponding given position
void GetGivenPosition (int i, double* x, double* y, double* z);
// Return the corresponding knot value
double GetKnot (int i);
// Return the corresponding tension value
double GetTension (int i);
private:
double Ti (int i) {
assert(i>=0 && i<=m_n);
return m_t[i];
}
double Ni (int i) {
assert(i>=0 && i<=m_n);
return m_v[i];
}
double Hi (int i) {
return (i==0 || i==m_n+1) ? 0.0f : Ti(i) - Ti(i-1);
}
double Gi (int i) {
return 2*(Hi(i) + Hi(i+1)) / (Ni(i)*Hi(i)*Hi(i+1) + 2*(Hi(i)+Hi(i+1)));
}
double Mi (int i) {
return (Gi(i)*Hi(i)) / (Gi(i)*Hi(i) + Hi(i+1) + Gi(i+1)*Hi(i+2));
}
double Li (int i) {
return (Gi(i-1)*Hi(i-1) + Hi(i)) / (Gi(i-1)*Hi(i-1) + Hi(i) + Gi(i)*Hi(i+1));
}
double Di (int i) {
return Hi(i) / (Hi(i)+Hi(i+1));
}
void GenerateKnot ();
void EliminateDuplications ();
double Distance (const Point& p0, const Point& p1);
const Point& Linear (double t, const Point& p0, const Point& p1);
void FillA ();
void FillB ();
void FillC ();
bool SolveD ();
void FillR ();
void FillL ();
void Reserve ();
void AdjustSize ();
void AllocAux();
void FreeAux();
void AllocTemp ();
void FreeTemp ();
public:
void Debug ();
};
#endif
|
potato3d/lindstrom
|
src/alg/defines.h
|
<gh_stars>0
#ifndef ALG_DEFINES_H
#define ALG_DEFINES_H
#ifdef ALG_DLL
#define ALG_API __declspec(dllexport)
#else
#define ALG_API
#endif
#define ALG_TOL 1.0e-7
#define ALG_PI 3.14159f
#if (defined(_WIN32) && !defined(HAS_POSIX))
# include <float.h>
# define ALG_FINITE(a) _finite(a)
#elif defined(__sun)
# include <ieeefp.h>
# define ALG_FINITE(a) finite(a)
#else
# include <math.h>
# define ALG_FINITE(a) finite(a)
#endif
#endif
|
potato3d/lindstrom
|
src/Defines.h
|
#ifndef TERRAIN_DEFINES
#define TERRAIN_DEFINES
/*
** mathematical defines
*/
#define DEG2RAD(x) ((3.1415927f / 180.0f) * (x))
#define RAD2DEG(x) ((180.0f / 3.1415927f) * (x))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define ISPOW2(x) (!((x) & ((x) - 1)) && !!(x))
#define SQR(x) ((x) * (x))
#define DISTANCE_SQR(p, q) (SQR((p)->x-(q)->x) + SQR((p)->y-(q)->y) + SQR((p)->z-(q)->z))
#define DISTANCE_SQR2(p, qx, qy, qz) (SQR((p)->x-(qx)) + SQR((p)->y-(qy)) + SQR((p)->z-(qz)))
#define DISTANCE_SQR3(p, qx, qy, qz) (SQR((p)->x-(qx)) + SQR((p)->height-(qy)) + SQR((p)->z-(qz)))
#define DISTANCE(p, q) (sqrtf(DISTANCE_SQR(p, q)))
#define CROSS_PRODUCT(x, y, z) ((void)((x)[0] = (y)[1]*(z)[2] - (y)[2]*(z)[1], (x)[1] = (y)[2]*(z)[0] - (y)[0]*(z)[2], (x)[2] = (y)[0]*(z)[1] - (y)[1]*(z)[0]))
#define ADD(x, y) ((void)((x)[0] += (y)[0], (x)[1] += (y)[1], (x)[2] += (y)[2]))
#define ALL_PLANES_VISIBLE 0x007Fu
#define INITIAL_VISIBILITY 0x0040u
/*
** Index Computation Defines
*/
#define LN_INDEX(i, j, m) ((i) + (j) + ((j) << (m)))
#define LN_SPLIT(i, j, k) (((j) + (k)) / 2)
#define LN_CHILD_LEFT(i, j, k) LN_SPLIT(i, j, k), j, i
#define LN_CHILD_RIGHT(i, j, k) LN_SPLIT(i, j, k), i, k
#define IQ_SPLIT(i, j) (j)
#define IQ_CHILD_LEFT(i, j) IQ_SPLIT(i, j), (4*(i)-7 + ((2*(i)+(j)+2) & 3))
#define IQ_CHILD_RIGHT(i, j) IQ_SPLIT(i, j), (4*(i)-7 + ((2*(i)+(j)+3) & 3))
#define COUNT_ONE_DIM(n) (1 << ((n) / 2)) + 1
#define LINEAR_INDEXING 1
#define INTERLEAVED_QUADTREE_INDEXING 2
// definitions for LINEAR_INDEXING
#define LN_COUNT(n) SQR(COUNT_ONE_DIM(n))
#define LN_I_SW(m) LN_INDEX(0 << (m), 0 << (m), m)
#define LN_I_SE(m) LN_INDEX(1 << (m), 0 << (m), m)
#define LN_I_NE(m) LN_INDEX(1 << (m), 1 << (m), m)
#define LN_I_NW(m) LN_INDEX(0 << (m), 1 << (m), m)
#define LN_I_C(m) LN_INDEX(1 << ((m) - 1), 1 << ((m) - 1), m)
#define LN_I_S(m) LN_INDEX(1 << ((m) - 1), 0 << (m), m)
#define LN_I_E(m) LN_INDEX(1 << (m), 1 << ((m) - 1), m)
#define LN_I_N(m) LN_INDEX(1 << ((m) - 1), 1 << (m), m)
#define LN_I_W(m) LN_INDEX(0 << (m), 1 << ((m) - 1), m)
#define LN_ROOT_S(m) LN_I_C(m), LN_I_SW(m), LN_I_SE(m)
#define LN_ROOT_E(m) LN_I_C(m), LN_I_SE(m), LN_I_NE(m)
#define LN_ROOT_N(m) LN_I_C(m), LN_I_NE(m), LN_I_NW(m)
#define LN_ROOT_W(m) LN_I_C(m), LN_I_NW(m), LN_I_SW(m)
#define LN_SPLIT_ROOT_S(m) LN_SPLIT(LN_I_C(m), LN_I_SW(m), LN_I_SE(m))
#define LN_SPLIT_ROOT_E(m) LN_SPLIT(LN_I_C(m), LN_I_SE(m), LN_I_NE(m))
#define LN_SPLIT_ROOT_N(m) LN_SPLIT(LN_I_C(m), LN_I_NE(m), LN_I_NW(m))
#define LN_SPLIT_ROOT_W(m) LN_SPLIT(LN_I_C(m), LN_I_NW(m), LN_I_SW(m))
#define LN_SPLIT_CHILD_LEFT(i, j, k) LN_SPLIT(LN_SPLIT(i, j, k), j, i)
#define LN_SPLIT_CHILD_RIGHT(i, j, k) LN_SPLIT(LN_SPLIT(i, j, k), i, k)
/*
#define TRIANGLE(i, j, k) i, j, k
#define TO_TRIANGLE(i, j, k) i, j, k
#define TRIANGLE_CMD(i, j, k) i j k
*/
#define LN_CHILD_LEFT_TRI(i, j, k) LN_SPLIT(i, j, k), i, j
#define LN_CHILD_RIGHT_TRI(i, j, k) LN_SPLIT(i, j, k), k, i
#define LN_SPLIT_CHILD_LEFT_TRI(i, j, k) LN_SPLIT(LN_SPLIT(i, j, k), i, j)
#define LN_SPLIT_CHILD_RIGHT_TRI(i, j, k) LN_SPLIT(LN_SPLIT(i, j, k), k, i)
//definitions for INTERLEAVED_QUADTREE_INDEXING
#define IQ_COUNT(n) (4 + 5 * ((1 << (n)) - 1) / 3)
#define IQ_I_SW(m) 0
#define IQ_I_SE(m) 1
#define IQ_I_NE(m) 2
#define IQ_I_NW(m) 3
#define IQ_I_C(m) 4
#define IQ_I_W(m) 5
#define IQ_I_S(m) 6
#define IQ_I_E(m) 7
#define IQ_I_N(m) 8
#define IQ_ROOT_S(m) IQ_I_C(m), IQ_I_S(m)
#define IQ_ROOT_E(m) IQ_I_C(m), IQ_I_E(m)
#define IQ_ROOT_N(m) IQ_I_C(m), IQ_I_N(m)
#define IQ_ROOT_W(m) IQ_I_C(m), IQ_I_W(m)
#define IQ_ROOT_S_TRI(m) IQ_I_C(m), IQ_I_S(m), IQ_I_SW(m), IQ_I_SE(m)
#define IQ_ROOT_E_TRI(m) IQ_I_C(m), IQ_I_E(m), IQ_I_SE(m), IQ_I_NE(m)
#define IQ_ROOT_N_TRI(m) IQ_I_C(m), IQ_I_N(m), IQ_I_NE(m), IQ_I_NW(m)
#define IQ_ROOT_W_TRI(m) IQ_I_C(m), IQ_I_W(m), IQ_I_NW(m), IQ_I_SW(m)
#define IQ_SPLIT_ROOT_S(m) IQ_SPLIT(IQ_I_C(m), IQ_I_S(m))
#define IQ_SPLIT_ROOT_E(m) IQ_SPLIT(IQ_I_C(m), IQ_I_E(m))
#define IQ_SPLIT_ROOT_N(m) IQ_SPLIT(IQ_I_C(m), IQ_I_N(m))
#define IQ_SPLIT_ROOT_W(m) IQ_SPLIT(IQ_I_C(m), IQ_I_W(m))
/*
#define TRIANGLE(i, j, k) i, j
#define TO_TRIANGLE(i, j, k) i, j, j
#define TRIANGLE_CMD(i, j, k) i j
#define IQ_CHILD_LEFT_TRI(i, j, k) IQ_CHILD_LEFT(i, j, k)
#define IQ_CHILD_RIGHT_TRI(i, j, k) IQ_CHILD_RIGHT(i, j, k)
*/
#define IQ_SPLIT_CHILD_LEFT(i, j) IQ_SPLIT(IQ_SPLIT(i, j), (4*(i)-7 + ((2*(i)+(j)+2) & 3))) //SPLIT(IQ_CHILD_LEFT(i, j))
#define IQ_SPLIT_CHILD_RIGHT(i, j) IQ_SPLIT(IQ_SPLIT(i, j), (4*(i)-7 + ((2*(i)+(j)+3) & 3))) //SPLIT(IQ_CHILD_RIGHT(i, j))
/*
** Terrain defines
*/
#define MIN_LEVEL 2
#endif
|
potato3d/lindstrom
|
src/alg/stack.h
|
// Matrix stack interface
// <EMAIL>
// Sep 2003
#ifndef ALG_STACK_H
#define ALG_STACK_H
#include "defines.h"
#include "matrix.h"
#include "vector.h"
#include "quatern.h"
class ALG_API AlgStack
{
public:
virtual ~AlgStack ()
{
}
virtual AlgMatrix GetTop () = 0;
virtual void Push () = 0;
virtual void Pop () = 0;
virtual void Identity () = 0;
virtual void LoadMatrix (const AlgMatrix& m) = 0;
virtual void Translate (float x, float y, float z) = 0;
virtual void Translate (const AlgVector& v) = 0;
virtual void Scale (float x, float y, float z) = 0;
virtual void Scale (const AlgVector& v) = 0;
virtual void Scale (float x,float y,float z,float rx,float ry,float rz) = 0;
virtual void Scale (const AlgVector& v, const AlgVector& r) = 0;
virtual void Rotate (float a, float x, float y, float z) = 0;
virtual void Rotate (float a, const AlgVector& p) = 0;
virtual void Rotate (const AlgQuatern& q) = 0;
virtual void Rotate (float a,float x,float y,float z,float rx,float ry,float rz) = 0;
virtual void Rotate (float a, const AlgVector& p, const AlgVector& r) = 0;
virtual void Rotate (const AlgQuatern& q, const AlgVector& r) = 0;
virtual void LookAt (const AlgVector& pos, const AlgVector& target, const AlgVector& up) = 0;
virtual void Ortho (float pleft, float pright, float pbottom, float ptop, float pnear, float pfar) = 0;
virtual void Frustum (float pleft, float pright, float pbottom, float ptop, float pnear, float pfar) = 0;
virtual void Perspective (float fovy, float aspect, float znear, float zfar) = 0;
virtual void Accum (const AlgMatrix& m) = 0;
virtual void PreAccum (const AlgMatrix& m) = 0;
};
#endif
|
potato3d/lindstrom
|
src/alg/lua/alglua.h
|
<gh_stars>0
#ifndef ALG_LUA
#define ALG_LUA
#ifdef __cplusplus
extern "C" {
#endif
#include <lua.h>
#ifdef __cplusplus
}
# ifdef _WIN32
# ifdef ALGLUA_DLL
# define ALGLUAAPI extern "C" __declspec(dllexport)
# else
# define ALGLUAAPI extern "C"
# endif
# else
# define ALGLUAAPI extern "C"
# endif
#else
# define ALGLUAAPI
#endif
#ifdef LUA_NOOBJECT /* Lua 3 */
ALGLUAAPI int alg_open (void);
ALGLUAAPI void alg_close (void);
#endif
#ifdef LUA_NOREF /* Lua 4 or 5 */
ALGLUAAPI int alg_open (lua_State* L);
ALGLUAAPI void alg_close (lua_State* L);
#endif
#endif
|
potato3d/lindstrom
|
src/TerrainImpl.h
|
#ifndef TERRAIN_IMPL_INCLUDED
#define TERRAIN_IMPL_INCLUDED
//class Rnd;
class AlgVector;
#include "Defines.h"
#include <math.h>
#include <float.h>
struct plane
{
float a, b, c, d;
};
struct viewPlanes
{
enum plane_visibility{
NOT_VISIBLE = 0,
LEFT_VISIBLE = 1,
RIGHT_VISIBLE = 2,
NEAR_VISIBLE = 4,
FAR_VISIBLE = 8,
BOTTON_VISIBLE = 16,
TOP_VISIBLE = 32
};
plane viewplane[6];
unsigned int isInside;
};
struct viewParameters
{
float position_x; /* view x position */
float position_y; /* view y position */
float position_z; /* view z position */
float invErrorTolerance; /* view dependent screen space error tolerance inverted */
float invErrorTolerance_min; /* minimum error tolerance - for morphing */
float invErrorTolerance_max; /* maximum error tolerance - for morphing */
float lambda;
int cullEnabled;
viewPlanes planes;
};
class TerrainImpl
{
friend class Terrain;
friend class TerrainNormals;
friend class TerrainTiledImpl;
protected:
struct vertexData
{
float x, y, z; /* vertex position */
float height; /* original height - y coordinate */
float e; /* vertex object space error */
float r; /* vertex bounding radius */
};
public:
typedef void (*PROGRESS_CALLBACK)(void*, float);
TerrainImpl();
~TerrainImpl();
// Client Functions
int LoadFromImage(const char* filename,
const float origin_x = 0, const float origin_y = 0, const float origin_z = 0,
const float scale_x = 1 , const float scale_y = 1 , const float scale_z = 1);
int Load(const char* filename,
bool outOfCore);
int Save(const char* filename);
int PreProcess();
unsigned int DataReindex();
//void Render(viewParameters view,
// Rnd* renderer);
int GetIndexing() { return m_indexing; }
void SetProgressCallback(PROGRESS_CALLBACK cb, void* data);
bool GetHeight(float x, float z, float* height);
const char* GetErrorMsg() {return m_errorMsg;}
void GetBBox(float *x_min, float *y_min, float *z_min,
float *x_max, float *y_max, float *z_max) const;
// Inline Functions
inline float* GetVertexPointer() { return (float*) m_vertices; }
inline int GetVertexOffset() { return sizeof(TerrainImpl::vertexData); }
inline float* GetVertexPos(unsigned int i) { return &m_vertices[i].x; }
inline float GetVertexPosX(unsigned int i) { return m_vertices[i].x; }
inline float GetVertexPosX(float* v) { return ((TerrainImpl::vertexData *)v)->x; }
inline float GetVertexPosY(unsigned int i) { return m_vertices[i].y; }
inline float GetVertexPosY(float* v) { return ((TerrainImpl::vertexData *)v)->y; }
inline float GetVertexHeight(unsigned int i) { return m_vertices[i].height; }
inline float GetVertexHeight(float* v) { return ((TerrainImpl::vertexData *)v)->height; }
inline float GetVertexPosZ(unsigned int i) { return m_vertices[i].z; }
inline float GetVertexPosZ(float* v) { return ((TerrainImpl::vertexData *)v)->z; }
inline float GetVertexError(unsigned int i) { return m_vertices[i].e; }
inline float GetVertexError(float* v) { return ((TerrainImpl::vertexData *)v)->e; }
inline float GetVertexRadius(unsigned int i) { return m_vertices[i].r; }
inline float GetVertexRadius(float* v) { return ((TerrainImpl::vertexData *)v)->r; }
inline int GetLevels() { return m_levels; }
inline int GetSize() { return m_size; }
inline int VertexActive(unsigned int i, const viewParameters* view)
{
vertexData* v = &m_vertices[i];
return SQR(view->invErrorTolerance*v->e + v->r) > DISTANCE_SQR2(v, view->position_x, view->position_y, view->position_z);
}
inline float VertexTauSphere(unsigned int i, const viewParameters* view)
{
vertexData* v = &m_vertices[i];
return view->invErrorTolerance*v->e + v->r;
}
inline int VertexError(unsigned int i, const viewParameters* view, float &error)
{
vertexData* v = &m_vertices[i];
error = view->lambda*v->e / (sqrtf(DISTANCE_SQR2(v, view->position_x, view->position_y, view->position_z)) - v->r);
// error = view.lambda*v->e / (sqrtf(DISTANCE_SQR2(v, view.position_x, view.position_y, view.position_z)) + v->r);
// error = view.lambda*v->e / (sqrtf(DISTANCE_SQR2(v, view.position_x, view.position_y, view.position_z)));
// error = view.lambda*v->e / (DISTANCE_SQR2(v, view.position_x, view.position_y, view.position_z) - v->r);
// error = SQR(view.invErrorTolerance*v->e + v->r) - DISTANCE_SQR2(v, view.position_x, view.position_y, view.position_z);
// error = view.invErrorTolerance*v->e + v->r - sqrt(DISTANCE_SQR2(v, view.position_x, view.position_y, view.position_z));
// error = view.invErrorTolerance*v->e + v->r;
if (error < 0) error = FLT_MAX;
return error > 0;
}
inline float VertexDistanceSquare(unsigned int i, const viewParameters* view)
{
vertexData* v = &m_vertices[i];
return DISTANCE_SQR2(v, view->position_x, view->position_y, view->position_z);
}
inline int IsSphereVisible(unsigned int p, unsigned int mask, viewParameters* view)
{
vertexData* v = &m_vertices[p];
for (int i = 0; i < 6; i++)
{
if (!(mask & (1u << i)))
{
plane* currPlane = &view->planes.viewplane[i];
float dist = v->x*currPlane->a + v->y*currPlane->b + v->z*currPlane->c + currPlane->d;
// float dist = v->x*view.planes.viewplane[i].a + v->height*view.planes.viewplane[i].b + v->z*view.planes.viewplane[i].c + view.planes.viewplane[i].d;
if (dist < -v->r) // Totally outside
return 0;
if (dist > v->r) // Totally inside
mask |= 1u << i;
/*
if ((dist - v->r) > 0) // Totally outside
return 0;
if ((dist + v->r) < 0) // Totally inside
view.planes.isInside |= 1u << i;
*/
}
}
return mask;
}
inline float CullingSafeDistance(unsigned int p, viewParameters* view)
{
vertexData* v = &m_vertices[p];
plane* currPlane = &view->planes.viewplane[0];
float minDist = v->r + (v->x*currPlane->a + v->y*currPlane->b + v->z*currPlane->c + currPlane->d);
for (int i = 1; i < 6; i++)
{
currPlane = &view->planes.viewplane[i];
float dist = v->r + (v->x*currPlane->a + v->y*currPlane->b + v->z*currPlane->c + currPlane->d);
if (dist < minDist)
minDist = dist;
}
return minDist;
}
inline int VertexMorph(unsigned int i, const viewParameters* view, float height_left, float height_right, float &height_morphed)
{
/*
** Compute the elevation of the morphed vertex. The return value indicates
** whether the vertex is active or not.
*/
vertexData* v = &m_vertices[i];
float curr_dist = DISTANCE_SQR2(v, view->position_x, view->position_y, view->position_z);
float max_dist = SQR(view->invErrorTolerance_max * v->e + v->r);
if (max_dist > curr_dist)
{
float min_dist = SQR(view->invErrorTolerance_min * v->e + v->r);
height_morphed = (min_dist > curr_dist) ?
v->height :
((max_dist - curr_dist) * v->height + (curr_dist - min_dist) * 0.5f * (height_left + height_right)) / (max_dist - min_dist);
v->y = height_morphed;
return 1; // True (TOTALLY ACTIVE)
}
else
return 0; // False (NOT ACTIVE)
}
protected:
void CleanUp();
int BuildData(const float origin_x, const float origin_y, const float origin_z,
const float scale_x , const float scale_y , const float scale_z,
float* heightmap, int width, int height);
int BuildData(TerrainImpl::vertexData* vertices, int width, int height, int lineOffset);
void VertexLodCompute(
unsigned int i, /* column index */
unsigned int j, /* row index */
int di, /* non-negative col offset to bisected edge endpoint */
int dj, /* row offset to bisected edge endpoint */
unsigned int n /* one less array width/height (zero for leaves) */
);
static void subDataReindex(
TerrainImpl::vertexData *vvo, // rearranged data
const TerrainImpl::vertexData *vvi, // linearly indexed data
unsigned int level, // refinement level
unsigned int p, // DAG parent and triangle apex (quadtree index)
unsigned int c, // DAG child (quadtree index)
unsigned int i, // triangle apex (linear index)
unsigned int j, // base vertex #1 (linear index)
unsigned int k // base vertex #2 (linear index)
);
//Rnd* m_renderer;
vertexData* m_vertices;
unsigned int m_levels;
unsigned int m_size;
char m_errorMsg[300];
unsigned int m_indexing;
PROGRESS_CALLBACK m_progressCallback;
void* m_progressCallbackData;
float m_bbox_min_x, m_bbox_min_y, m_bbox_min_z;
float m_bbox_max_x, m_bbox_max_y, m_bbox_max_z;
};
#endif
|
potato3d/lindstrom
|
src/alg/glstack.h
|
// GL stack class
// <EMAIL>
// Sep 2003
#ifndef ALG_GL_STACK_H
#define ALG_GL_STACK_H
#include "stack.h"
#ifdef _WIN32
#include <windows.h>
#endif
#include <GL/gl.h>
#include <GL/glu.h>
/**
* This class interfaces for the OpenGL matrix stack.
* It defines methods for:
* - setting the base matrix (eg. the projection+view matrix), so that identity() takes to this space.
* - accumulating/pushing/popping transformations.
* - obtaining the stack top
*/
class ALG_API AlgGLStack : public AlgStack
{
AlgMatrix* m_identity;
public:
AlgGLStack () : m_identity(0)
{
}
virtual ~AlgGLStack ()
{
if (m_identity)
delete m_identity;
}
void SetIdentity (AlgMatrix* m)
{
if (m)
{
if (m_identity)
*m_identity = *m;
else
m_identity = new AlgMatrix((float*)m->GetMatrix());
}
else if (m_identity)
{
delete m_identity;
m_identity = 0;
}
}
void SetIdentity (AlgMatrix m)
{
SetIdentity(&m);
}
void SetIdentity (float* m)
{
if (m)
{
if (m_identity)
*m_identity = m;
else
m_identity = new AlgMatrix(m);
}
else if (m_identity)
{
delete m_identity;
m_identity = 0;
}
}
AlgMatrix* GetIdentity() const
{
return m_identity;
}
virtual AlgMatrix GetTop ()
{
float modl[16];
glGetFloatv(GL_MODELVIEW_MATRIX,modl);
return AlgMatrix(modl);
}
virtual void Push ()
{
glPushMatrix();
}
virtual void Pop ()
{
glPopMatrix();
}
virtual void Identity ()
{
if (GetIdentity())
glLoadMatrixf(GetIdentity()->GetMatrix());
else
glLoadIdentity();
}
virtual void LoadMatrix (const AlgMatrix& m)
{
if (GetIdentity())
{
glLoadMatrixf(GetIdentity()->GetMatrix());
glMultMatrixf(m.GetMatrix());
}
else
glLoadMatrixf(m.GetMatrix());
}
virtual void Translate (float x, float y, float z)
{
glTranslatef(x,y,z);
}
virtual void Translate (const AlgVector& v)
{
glTranslatef(v.x,v.y,v.z);
}
virtual void Scale (float x, float y, float z)
{
glScalef(x,y,z);
}
virtual void Scale (const AlgVector& v)
{
glScalef(v.x,v.y,v.z);
}
virtual void Scale (float x,float y,float z,float rx,float ry,float rz)
{
glTranslatef(rx,ry,rz);
glScalef(x,y,z);
glTranslatef(-rx,-ry,-rz);
}
virtual void Scale (const AlgVector& v, const AlgVector& r)
{
glTranslatef(r.x,r.y,r.z);
glScalef(v.x,v.y,v.z);
glTranslatef(-r.x,-r.y,-r.z);
}
virtual void Rotate (float a, float x, float y, float z)
{
glRotatef(a,x,y,z);
}
virtual void Rotate (float a, const AlgVector& p)
{
glRotatef(a,p.x,p.y,p.z);
}
virtual void Rotate (const AlgQuatern& q)
{
float x,y,z;
q.GetAxis(&x,&y,&z);
glRotatef(q.GetAngle(),x,y,z);
}
virtual void Rotate (float a,float x,float y,float z,float rx,float ry,float rz)
{
glTranslatef(rx,ry,rz);
glRotatef(a,x,y,z);
glTranslatef(-rx,-ry,-rz);
}
virtual void Rotate (float a, const AlgVector& p, const AlgVector& r)
{
glTranslatef(r.x,r.y,r.z);
glRotatef(a,p.x,p.y,p.z);
glTranslatef(-r.x,-r.y,-r.z);
}
virtual void Rotate (const AlgQuatern& q, const AlgVector& r)
{
float x,y,z;
q.GetAxis(&x,&y,&z);
glTranslatef(r.x,r.y,r.z);
glRotatef(q.GetAngle(),x,y,z);
glTranslatef(-r.x,-r.y,-r.z);
}
virtual void LookAt (const AlgVector& pos, const AlgVector& target, const AlgVector& up)
{
gluLookAt(pos.x,pos.y,pos.z,target.x,target.y,target.z,up.x,up.y,up.z);
}
virtual void Ortho (float pleft, float pright, float pbottom, float ptop, float pnear, float pfar)
{
glOrtho(pleft,pright,pbottom,ptop,pnear,pfar);
}
virtual void Frustum (float pleft, float pright, float pbottom, float ptop, float pnear, float pfar)
{
glFrustum(pleft,pright,pbottom,ptop,pnear,pfar);
}
virtual void Perspective (float fovy, float aspect, float znear, float zfar)
{
gluPerspective(fovy,aspect,znear,zfar);
}
virtual void Accum (const AlgMatrix& m)
{
glMultMatrixf(m.GetMatrix());
}
virtual void PreAccum (const AlgMatrix& m) // TODO: untested
{
AlgMatrix top = GetTop();
top.PreAccum(m);
LoadMatrix(top);
}
};
#endif
|
potato3d/lindstrom
|
src/alg/matrixstack.h
|
// Matrix stack class
// <EMAIL>
// Sep 2003
#ifndef ALG_MATRIX_STACK_H
#define ALG_MATRIX_STACK_H
#include "stack.h"
#include <ds/stack.h>
/**
* This class implements a matrix stack on the CPU, just like the OpenGL matrix stacks.
* It defines methods for:
* - accumulating/pushing/popping transformations.
* - obtaining the stack top
*/
class ALG_API AlgMatrixStack : public AlgStack, private DsStack<AlgMatrix>
{
public:
AlgMatrixStack () : DsStack<AlgMatrix>()
{
Clear();
}
virtual ~AlgMatrixStack () {}
virtual AlgMatrix GetTop ()
{
return Top();
}
void Clear ()
{
DsStack<AlgMatrix>::Clear();
PushConst(AlgMatrix::GetIdentity());
}
virtual void Push ()
{
Duplicate();
}
virtual void Pop ()
{
DsStack<AlgMatrix>::Pop();
}
virtual void Identity ()
{
Top().Identity();
}
virtual void LoadMatrix (const AlgMatrix& m)
{
Top() = m;
}
virtual void Translate (float x, float y, float z)
{
Top().Translate(x,y,z);
}
virtual void Translate (const AlgVector& v)
{
Top().Translate(v);
}
virtual void Scale (float x, float y, float z)
{
Top().Scale(x,y,z);
}
virtual void Scale (const AlgVector& v)
{
Top().Scale(v);
}
virtual void Scale (float x, float y, float z, float rx, float ry, float rz)
{
Top().Scale(x,y,z,rx,ry,rz);
}
virtual void Scale (const AlgVector& v, const AlgVector& r)
{
Top().Scale(v,r);
}
virtual void Rotate (float a, float x, float y, float z)
{
Top().Rotate(a,x,y,z);
}
virtual void Rotate (float a, const AlgVector& p)
{
Top().Rotate(a,p);
}
virtual void Rotate (const AlgQuatern& q)
{
Top().Rotate(q);
}
virtual void Rotate (float a, float x, float y, float z, float rx, float ry, float rz)
{
Top().Rotate(a,x,y,z,rx,ry,rz);
}
virtual void Rotate (float a, const AlgVector& p, const AlgVector& r)
{
Top().Rotate(a,p,r);
}
virtual void Rotate (const AlgQuatern& q, const AlgVector& r)
{
Top().Rotate(q,r);
}
virtual void LookAt (const AlgVector& pos, const AlgVector& target, const AlgVector& up)
{
Top().LookAt(pos,target,up);
}
virtual void Ortho (float pleft, float pright, float pbottom, float ptop, float pnear, float pfar)
{
Top().Ortho(pleft,pright,pbottom,ptop,pnear,pfar);
}
virtual void Frustum (float pleft, float pright, float pbottom, float ptop, float pnear, float pfar)
{
Top().Frustum(pleft,pright,pbottom,ptop,pnear,pfar);
}
virtual void Perspective (float fovy, float aspect, float znear, float zfar)
{
Top().Perspective(fovy,aspect,znear,zfar);
}
virtual void Accum (const AlgMatrix& m)
{
Top().Accum(m);
}
virtual void PreAccum (const AlgMatrix& m)
{
Top().PreAccum(m);
}
};
#endif
|
potato3d/lindstrom
|
src/alg/lua/algtolua5.h
|
/*
** Lua binding: alg
** Generated automatically by tolua 5.0 on Thu Mar 1 17:15:17 2007.
*/
/* Exported function */
#ifdef __cplusplus
extern "C" {
#endif
TOLUA_API int tolua_alg_open (lua_State* tolua_S);
#ifdef __cplusplus
}
#endif
|
potato3d/lindstrom
|
src/alg/quatern.h
|
<gh_stars>0
//* quatern.h
// Represents quaternion.
// <EMAIL>
// <EMAIL>
// Nov 2004
#ifndef VIS_QUATERN_H
#define VIS_QUATERN_H
#include "defines.h"
#include "vector.h"
class ALG_API AlgQuatern
{
private:
float m_w;
AlgVector m_p;
public:
// Constructors and destructors
AlgQuatern ()
: m_w(1.0f),m_p(0.0f,0.0f,0.0f)
{
}
AlgQuatern (float angle, float x, float y, float z)
{
Set(angle,x,y,z);
}
AlgQuatern (float angle, const AlgVector& axis)
{
Set(angle,axis);
}
AlgQuatern (const AlgVector &u, const AlgVector &v, const AlgVector &w)
{
Set(u, v, w);
}
~AlgQuatern ()
{
}
// Set Values
void Set (float angle, float x, float y, float z)
{
float a = angle*ALG_PI/180.0f/2;
float s = (float)sin(a);
m_w = (float)cos(a);
m_p.Set(x,y,z);
m_p.Normalize();
m_p.x *= s;
m_p.y *= s;
m_p.z *= s;
}
void Set(float angle, const AlgVector& axis)
{
Set(angle,axis.x,axis.y,axis.z);
}
void Set(const AlgVector &u, const AlgVector &v, const AlgVector &w);
void SetRaw(float w, float x, float y, float z)
{
m_w = w;
m_p.x = x;
m_p.y = y;
m_p.z = z;
};
void SetRaw(float w, const AlgVector &v)
{
m_w = w;
m_p = v;
}
// Get Values
float GetAngle () const
{
return (float)(2*acos(m_w)*180.0/ALG_PI);
}
void GetAxis (float* x, float* y, float* z) const
{
*x = m_p.x; *y = m_p.y; *z = m_p.z;
}
const AlgVector& GetAxis () const
{
return m_p;
}
void Get(AlgVector *u, AlgVector *v, AlgVector *w)
{
float s = 2/Norm();
u->x = 1-s*(m_p.y*m_p.y+m_p.z*m_p.z); v->x = s*(m_p.x*m_p.y-m_w*m_p.z); w->x = s*(m_p.x*m_p.z+m_w*m_p.y);
u->y = s*(m_p.x*m_p.y+m_w*m_p.z); v->y = 1-s*(m_p.x*m_p.x+m_p.z*m_p.z); w->y = s*(m_p.y*m_p.z-m_w*m_p.x);
u->z = s*(m_p.x*m_p.z-m_w*m_p.y); v->z = s*(m_p.y*m_p.z+m_w*m_p.x); w->z = 1-s*(m_p.x*m_p.x+m_p.y*m_p.y);
}
void GetRaw(float *w, float *x, float *y, float *z) const
{
*w = m_w;
*x = m_p.x;
*y = m_p.y;
*z = m_p.z;
};
void GetRaw(float *w, AlgVector *v)
{
*w = m_w;
*v = m_p;
}
// Print
void Print(const char *label=0)
{
printf("%s %g %g %g %g\n", label?label:"", m_w, m_p.x, m_p.y, m_p.z);
}
// Basic operations
void Identity()
{
m_w = 1;
m_p.Set(0,0,0);
}
void Add(const AlgQuatern& q)
{
m_w += q.m_w;
m_p.x += q.m_p.x;
m_p.y += q.m_p.y;
m_p.z += q.m_p.z;
}
void Sub(const AlgQuatern& q)
{
m_w -= q.m_w;
m_p.x -= q.m_p.x;
m_p.y -= q.m_p.y;
m_p.z -= q.m_p.z;
}
void Mult(const AlgQuatern& q);
void Mult(float v)
{
m_w *= v;
m_p.x *= v;
m_p.y *= v;
m_p.z *= v;
}
void Div(float v)
{
Mult(1/v);
}
void Conjugate()
{
m_p.x = -m_p.x;
m_p.y = -m_p.y;
m_p.z = -m_p.z;
}
float Norm() const
{
return (float)sqrt(m_w*m_w + m_p.x*m_p.x + m_p.y*m_p.y + m_p.z*m_p.z);
}
void Normalize()
{
float norm = Norm();
if (norm > 0)
Div(norm);
}
void Inverse()
{
float t = Norm();
if (t < 2e-5)
{
m_p.x = 0;
m_p.y = 0;
m_p.z = 0;
m_w = 1;
}
else
{
Div(t);
Conjugate();
}
}
bool IsEqual(const AlgQuatern &q) const
{
if (m_w == q.m_w && m_p.x == q.m_p.x && m_p.y == q.m_p.y && m_p.z == q.m_p.z)
return true;
return false;
}
float Dot(const AlgQuatern& q) const
{
return m_w*q.m_w + m_p.x*q.m_p.x + m_p.y*q.m_p.y + m_p.z*q.m_p.z;
}
bool Log(); // Unit Quaternion operation
void Exp() // Quaternion q=(0, Theta*v) operation
{
float t = (float)(sqrt(m_p.x*m_p.x + m_p.y*m_p.y + m_p.z*m_p.z));
float tmp = (float)(exp(m_w)*sin(t)/t);
m_w = (float)(cos(t)*exp(m_w));
if (t > 2e-5)
{
m_p.x *= tmp;
m_p.y *= tmp;
m_p.z *= tmp;
}
else
{
m_p.x = m_p.y = m_p.z = 0;
}
}
bool Pow(float v);
static AlgQuatern Add(const AlgQuatern &q0, const AlgQuatern &q1)
{
AlgQuatern q = q0;
q.Add(q1);
return q;
}
static AlgQuatern Sub(const AlgQuatern &q0, const AlgQuatern &q1)
{
AlgQuatern q = q0;
q.Sub(q1);
return q;
}
static AlgQuatern Mult(const AlgQuatern &q0, const AlgQuatern &q1)
{
AlgQuatern q = q0;
q.Mult(q1);
return q;
}
static AlgQuatern Mult(const AlgQuatern &q0, float v)
{
AlgQuatern q = q0;
q.Mult(v);
return q;
}
static AlgQuatern Div(const AlgQuatern &q0, float v)
{
AlgQuatern q = q0;
q.Div(v);
return q;
}
static AlgQuatern Conjugate(const AlgQuatern &q)
{
AlgQuatern qt = q;
qt.Conjugate();
return qt;
}
static AlgQuatern Inverse(const AlgQuatern &q)
{
AlgQuatern qt = q;
qt.Inverse();
return qt;
}
static AlgQuatern Normalize(const AlgQuatern &q)
{
AlgQuatern qt = q;
qt.Normalize();
return qt;
}
static AlgQuatern Log(const AlgQuatern &q)
{
AlgQuatern qt = q;
qt.Log();
//if(qt.Log())
// qt.Set(0, 0,0,0);
return q;
}
static AlgQuatern Exp(const AlgQuatern &q)
{
AlgQuatern qt = q;
qt.Exp();
return qt;
}
static AlgQuatern Pow(const AlgQuatern &q, float v)
{
AlgQuatern qt = q;
qt.Pow(v);
return qt;
}
// Interpolation Functions
// Linear
static AlgQuatern Lerp(const AlgQuatern& q0, const AlgQuatern& q1, float h)
{
return AlgQuatern::Normalize(AlgQuatern::Add(AlgQuatern::Mult(q0,1-h),AlgQuatern::Mult(q1,h)));
}
// Spherical
static AlgQuatern Slerp(const AlgQuatern& q0, const AlgQuatern& q1, float h);
// Cubic
static AlgQuatern Squad(const AlgQuatern& q0, const AlgQuatern& q1, const AlgQuatern& q2, const AlgQuatern& q3, float h);
};
#endif
|
potato3d/lindstrom
|
src/alg/frustum.h
|
// frustum.h
// Tecgraf/PUC-Rio
// <EMAIL>
// Feb 2003
#ifndef ALG_FRUSTUM_H
#define ALG_FRUSTUM_H
#include "defines.h"
#include "plane.h"
class ALG_API AlgFrustum
{
public:
/* Creates a new AlgFrustum object
* \param Number of canonical planes
*/
AlgFrustum (int n)
{
m_pl = new AlgPlane[n];
m_npl = n;
}
/* Deletes object
*/
virtual ~AlgFrustum ()
{
delete [] m_pl;
}
/* Sets canonical plane equations
* \param Plane ID
* \param Plane equation coeficients
*/
void SetCanonicalPlane (int id, float a, float b, float c, float d)
{
if (id>=0 && id<m_npl)
m_pl[id].Set(a,b,c,d);
}
/* Sets vertex transformation matrix
* \param The matrix represented in vector, column by column
*/
void SetVertexMatrix (const float* m)
{
for (int i=0; i<16; i++)
m_mat[i] = m[i];
}
/* Gets plane equation in original space
* \param Plane ID
*/
AlgPlane GetPlane (int id)
{
AlgPlane p(0.0f,0.0f,0.0f,0.0f);
if (id>=0 && id<m_npl)
{
// Multiply by the transpose matrix
p.Set (m_pl[id].a*m_mat[0]+m_pl[id].b*m_mat[1]+
m_pl[id].c*m_mat[2]+m_pl[id].d*m_mat[3],
m_pl[id].a*m_mat[4]+m_pl[id].b*m_mat[5]+
m_pl[id].c*m_mat[6]+m_pl[id].d*m_mat[7],
m_pl[id].a*m_mat[8]+m_pl[id].b*m_mat[9]+
m_pl[id].c*m_mat[10]+m_pl[id].d*m_mat[11],
m_pl[id].a*m_mat[12]+m_pl[id].b*m_mat[13]+
m_pl[id].c*m_mat[14]+m_pl[id].d*m_mat[15]
);
}
return p;
}
private:
int m_npl;
AlgPlane* m_pl;
float m_mat[16];
};
#endif
|
JunAILiang/JMButton
|
JMButton/JMRadioViewController.h
|
//
// JMRadioViewController.h
// JMButton
//
// Created by JM on 2018/1/27.
// Copyright © 2018年 JM. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface JMRadioViewController : UIViewController
@end
|
JunAILiang/JMButton
|
JMButton/JMWaveViewController.h
|
//
// JMWaveViewController.h
// JMButton
//
// Created by JM on 2018/1/23.
// Copyright © 2018年 JM. All rights reserved.
//
/*
.----------------. .----------------.
| .--------------. | .--------------. |
| | _____ | | | ____ ____ | |
| | |_ _| | | ||_ \ / _|| |
| | | | | | | | \/ | | |
| | _ | | | | | | |\ /| | | |
| | | |_' | | | | _| |_\/_| |_ | |
| | `.___.' | | ||_____||_____|| |
| | | | | | |
| '--------------' | '--------------' |
'----------------' '----------------'
github: https://github.com/JunAILiang
blog: https://www.ljmvip.cn
*/
#import <UIKit/UIKit.h>
@interface JMWaveViewController : UIViewController
@end
|
gerasim13/Chameleon
|
ChameleonDemo/ChameleonDemo/Row4ViewController.h
|
//
// FlatfiyViewController.h
// ChameleonDemo
//
// Created by <NAME> on 7/24/14.
// Copyright (c) 2014 <NAME>. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "Chameleon.h"
@interface Row4ViewController : UIViewController
@property (nonatomic, strong) UILabel *titleLabel;
- (IBAction)flatify:(id)sender;
- (IBAction)flatifyAndContrast:(id)sender;
@end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.