add oversampler
This commit is contained in:
691
oversampling/WDL/localize/build_sample_langpack.cpp
Normal file
691
oversampling/WDL/localize/build_sample_langpack.cpp
Normal file
@@ -0,0 +1,691 @@
|
||||
/*
|
||||
* to generate a template language pack, use:
|
||||
* build_sample_langpack --template *.rc *.cpp etc > file.langpack
|
||||
*
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#ifndef _WIN32
|
||||
#define stricmp strcasecmp
|
||||
#endif
|
||||
|
||||
#include "../wdltypes.h"
|
||||
#include "../assocarray.h"
|
||||
#include "../ptrlist.h"
|
||||
#include "../wdlstring.h"
|
||||
#include "../fnv64.h"
|
||||
|
||||
static bool isblank(char c)
|
||||
{
|
||||
return c==' ' || c== '\t' || c=='\r' || c=='\n';
|
||||
}
|
||||
static bool isblankorz(char c)
|
||||
{
|
||||
return !c || isblank(c);
|
||||
}
|
||||
|
||||
WDL_StringKeyedArray<char *> section_descs;
|
||||
|
||||
WDL_StringKeyedArray< WDL_PtrList<char> * > translations;
|
||||
WDL_StringKeyedArray< WDL_StringKeyedArray<bool> * > translations_indexed;
|
||||
|
||||
void gotString(const char *str, int len, const char *secname, bool isRC, const char *fn, int line)
|
||||
{
|
||||
WDL_PtrList<char> *sec=translations.Get(secname);
|
||||
if (!sec)
|
||||
{
|
||||
sec=new WDL_PtrList<char>;
|
||||
translations.Insert(secname,sec);
|
||||
}
|
||||
WDL_StringKeyedArray<bool> *sec2 = translations_indexed.Get(secname);
|
||||
if (!sec2)
|
||||
{
|
||||
sec2 = new WDL_StringKeyedArray<bool>(true);
|
||||
translations_indexed.Insert(secname,sec2);
|
||||
}
|
||||
if (len > (int)strlen(str))
|
||||
{
|
||||
fprintf(stderr,"gotString got len>strlen(str) on %s:%d\n",fn,line);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
WDL_FastString buf;
|
||||
if (!isRC)
|
||||
{
|
||||
int st = 0;
|
||||
for (int x = 0; x < len; x ++)
|
||||
{
|
||||
if (!st)
|
||||
{
|
||||
if (str[x] == '\\' && str[x+1])
|
||||
{
|
||||
buf.Append(str+x,2);
|
||||
x++;
|
||||
}
|
||||
else if (str[x] == '\"') st=1;
|
||||
else buf.Append(str+x,1);
|
||||
}
|
||||
else if (str[x] == '\"') st=0;
|
||||
else if (!isblank(str[x]))
|
||||
{
|
||||
fprintf(stderr,"gotString has junk between concatenated strings on %s:%d\n",fn,line);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
buf.Set(str,len);
|
||||
}
|
||||
if (sec2->Get(buf.Get())) return; //already in list
|
||||
|
||||
sec2->Insert(buf.Get(),true);
|
||||
sec->Add(strdup(buf.Get()));
|
||||
}
|
||||
const char *g_last_file;
|
||||
int g_last_linecnt;
|
||||
int length_of_quoted_string(char *p, bool convertRCquotesToSlash)
|
||||
{
|
||||
int l=0;
|
||||
while (p[l])
|
||||
{
|
||||
if (convertRCquotesToSlash && p[l] == '\"' && p[l+1] == '\"') p[l]='\\';
|
||||
|
||||
if (p[l] == '\"')
|
||||
{
|
||||
if (convertRCquotesToSlash) return l;
|
||||
|
||||
// scan over whitespace to see if another string begins, concat them
|
||||
int l2 = l+1;
|
||||
while (isblank(p[l2])) l2++;
|
||||
if (p[l2] != '\"') return l;
|
||||
l = l2;
|
||||
}
|
||||
if (p[l] == '\\')
|
||||
{
|
||||
l++;
|
||||
}
|
||||
if (!p[l] || p[l] == '\r' || p[l] == '\n') break;
|
||||
l++;
|
||||
}
|
||||
fprintf(stderr,"ERROR: mismatched quotes in file %s:%d, check input!\n",g_last_file,g_last_linecnt);
|
||||
exit(1);
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int uint64cmpfunc(WDL_UINT64 *a, WDL_UINT64 *b)
|
||||
{
|
||||
if (*a < *b) return -1;
|
||||
if (*a > *b) return 1;
|
||||
return 0;
|
||||
}
|
||||
#define HACK_WILDCARD_ENTRY 2
|
||||
static int isLocalizeCall(const char *p)
|
||||
{
|
||||
int rv = 0;
|
||||
if (!strncmp(p,"__LOCALIZE",10)) { p+=10; rv = 1; }
|
||||
else if (!strncmp(p,"ADD_WILDCARD_ENTRY",18)) { p+=18; rv = HACK_WILDCARD_ENTRY; }
|
||||
else return 0;
|
||||
|
||||
if (*p == '_') while (*p == '_' || (*p >= 'A' && *p <= 'Z')||(*p>='0' && *p <='9')) p++;
|
||||
while (isblank(*p)) p++;
|
||||
return *p == '(' ? rv : 0;
|
||||
}
|
||||
|
||||
WDL_UINT64 outputLine(const char *strv, int casemode)
|
||||
{
|
||||
WDL_UINT64 h = WDL_FNV64_IV;
|
||||
const char *p=strv;
|
||||
while (*p)
|
||||
{
|
||||
char c = *p++;
|
||||
if (c == '\\')
|
||||
{
|
||||
if (*p == '\\'||*p == '"' || *p == '\'') h=WDL_FNV64(h,(unsigned char *)p,1);
|
||||
else if (*p == 'n') h=WDL_FNV64(h,(unsigned char *)"\n",1);
|
||||
else if (*p == 'r') h=WDL_FNV64(h,(unsigned char *)"\r",1);
|
||||
else if (*p == 't') h=WDL_FNV64(h,(unsigned char *)"\t",1);
|
||||
else if (*p == '0') h=WDL_FNV64(h,(unsigned char *)"",1);
|
||||
else if (*p == 'x' && p[1] == 'e' && p[2] == '9')
|
||||
{
|
||||
h=WDL_FNV64(h,(unsigned char *)"\xe9",1);
|
||||
p+=2;
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr,"ERROR: unknown escape seq in '%s' at '%s'\n",strv,p);
|
||||
exit(1);
|
||||
}
|
||||
p++;
|
||||
}
|
||||
else h=WDL_FNV64(h,(unsigned char *)&c,1);
|
||||
}
|
||||
h=WDL_FNV64(h,(unsigned char *)"",1);
|
||||
|
||||
printf("%08X%08X=",(int)(h>>32),(int)(h&0xffffffff));
|
||||
int lc = 0;
|
||||
while (*strv)
|
||||
{
|
||||
int c = *strv++;
|
||||
if (lc == '%' || lc == '\\') { /* hacky*/ }
|
||||
else if (c == '\\' && strv[0] == 'x' && strv[1] == 'e' && strv[2] == '9')
|
||||
{
|
||||
strv+=3;
|
||||
c = 0xe9;
|
||||
}
|
||||
else if (casemode == 2)
|
||||
{
|
||||
switch (tolower(c))
|
||||
{
|
||||
case 'o': c='0'; break;
|
||||
case 'i': c='1'; break;
|
||||
case 'e': c='3'; break;
|
||||
case 'a': c='4'; break;
|
||||
case 's': c='5'; break;
|
||||
}
|
||||
}
|
||||
else if (casemode==-1) c=tolower(c);
|
||||
else if (casemode==1) c=toupper(c);
|
||||
else if (casemode==4)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
case 'E': c=0xc494; break;
|
||||
case 'A': c=0xc381; break;
|
||||
case 'I': c=0xc38f; break;
|
||||
case 'N': c=0xc391; break;
|
||||
case 'O': c=0xc395; break;
|
||||
case 'U': c=0xc39a; break;
|
||||
case 'B': c=0xc39f; break;
|
||||
case 'C': c=0xc486; break;
|
||||
case 'G': c=0xc4a0; break;
|
||||
case 'e': c=0xc497; break;
|
||||
case 'a': c=0xc3a4; break;
|
||||
case 'i': c=0xc4ad; break;
|
||||
case 'n': c=0xc584; break;
|
||||
case 'o': c=0xc58d; break;
|
||||
case 'u': c=0xc5af; break;
|
||||
case 'b': c=0xc39e; break;
|
||||
case 'c': c=0xc48d; break;
|
||||
case 'g': c=0xc49f; break;
|
||||
}
|
||||
if (c >= 256)
|
||||
{
|
||||
printf("%c",(c>>8));
|
||||
c&=0xff;
|
||||
}
|
||||
}
|
||||
printf("%c",c);
|
||||
if (lc == '%' && (c == '.' || c=='l' || (c>='0' && c<='9')))
|
||||
{
|
||||
// ignore .xyz and l between format spec (hacky)
|
||||
}
|
||||
else if (lc == '%' && c == '%') lc = 0;
|
||||
else if (lc == '\\' && c == '\\') lc = 0;
|
||||
else lc = c;
|
||||
}
|
||||
printf("\n");
|
||||
return h;
|
||||
}
|
||||
|
||||
|
||||
WDL_StringKeyedArray<int> g_resdefs;
|
||||
const char *getResourceDefinesFromHeader(const char *fn)
|
||||
{
|
||||
g_resdefs.DeleteAll();
|
||||
|
||||
FILE *fp=fopen(fn,"rb");
|
||||
if (!fp) return "error opening header";
|
||||
for (;;)
|
||||
{
|
||||
char buf[8192];
|
||||
g_last_linecnt++;
|
||||
if (!fgets(buf,sizeof(buf),fp)) break;
|
||||
char *p = buf;
|
||||
while (*p) p++;
|
||||
while (p>buf && (p[-1] == '\r'|| p[-1] == '\n' || p[-1] == ' ')) p--;
|
||||
*p=0;
|
||||
|
||||
if (!strncmp(buf,"#define",7))
|
||||
{
|
||||
p=buf;
|
||||
while (*p && *p != ' '&& *p != '\t') p++;
|
||||
while (*p == ' ' || *p == '\t') p++;
|
||||
char *n1 = p;
|
||||
while (*p && *p != ' '&& *p != '\t') p++;
|
||||
if (*p) *p++=0;
|
||||
while (*p == ' ' || *p == '\t') p++;
|
||||
int a = atoi(p);
|
||||
if (a && *n1)
|
||||
{
|
||||
g_resdefs.Insert(n1,a);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void processRCfile(FILE *fp, const char *dirprefix, const char *filename)
|
||||
{
|
||||
char sname[512];
|
||||
sname[0]=0;
|
||||
int depth=0;
|
||||
for (;;)
|
||||
{
|
||||
char buf[8192];
|
||||
g_last_linecnt++;
|
||||
if (!fgets(buf,sizeof(buf),fp)) break;
|
||||
char *p = buf;
|
||||
while (*p) p++;
|
||||
while (p>buf && (p[-1] == '\r'|| p[-1] == '\n' || p[-1] == ' ')) p--;
|
||||
*p=0;
|
||||
|
||||
p=buf;
|
||||
if (sname[0]) while (*p == ' ' || *p == '\t') p++;
|
||||
char *first_tok = p;
|
||||
if (!strncmp(first_tok,"CLASS",5) && isblank(first_tok[5]) && first_tok[6]=='\"') continue;
|
||||
|
||||
while (*p && *p != '\t' && *p != ' ') p++;
|
||||
if (*p) *p++=0;
|
||||
while (*p == '\t' || *p == ' ') p++;
|
||||
char *second_tok = p;
|
||||
|
||||
if ((!strncmp(second_tok,"DIALOG",6) && isblankorz(second_tok[6])) ||
|
||||
(!strncmp(second_tok,"DIALOGEX",8) && isblankorz(second_tok[8]))||
|
||||
(!strncmp(second_tok,"MENU",4) && isblankorz(second_tok[4])))
|
||||
{
|
||||
if (sname[0])
|
||||
{
|
||||
fprintf(stderr,"got %s inside a block\n",second_tok);
|
||||
exit(1);
|
||||
}
|
||||
int sec = g_resdefs.Get(first_tok);
|
||||
if (!sec)
|
||||
{
|
||||
fprintf(stderr, "unknown dialog %s\n",first_tok);
|
||||
exit(1);
|
||||
}
|
||||
sprintf(sname,"%s%s%s_%d",dirprefix?dirprefix:"",dirprefix?"_":"",second_tok[0] == 'M' ? "MENU" : "DLG",sec);
|
||||
section_descs.Insert(sname,strdup(first_tok));
|
||||
}
|
||||
else if (sname[0] && *second_tok && *first_tok)
|
||||
{
|
||||
if (*second_tok == '"')
|
||||
{
|
||||
int l = length_of_quoted_string(second_tok+1,true);
|
||||
if (l>0)
|
||||
{
|
||||
gotString(second_tok+1,l,sname, true, filename, g_last_linecnt);
|
||||
|
||||
// OSX menu support: store a 2nd string w/o \tshortcuts, strip '&' too
|
||||
// note: relies on length_of_quoted_string() pre-conversion above
|
||||
if (depth && strstr(sname, "MENU_"))
|
||||
{
|
||||
int j=0;
|
||||
char* m=second_tok+1;
|
||||
for(;;)
|
||||
{
|
||||
if (!*m || (*m == '\\' && *(m+1)=='t') || (*m=='\"' && *(m-1)!='\\')) { buf[j]=0; break; }
|
||||
if (*m != '&') buf[j++] = *m;
|
||||
m++;
|
||||
}
|
||||
if (j!=l) gotString(buf,j,sname,true, filename, g_last_linecnt);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!strcmp(first_tok,"BEGIN"))
|
||||
{
|
||||
depth++;
|
||||
}
|
||||
else if (!strcmp(first_tok,"END"))
|
||||
{
|
||||
depth--;
|
||||
if (depth<0)
|
||||
{
|
||||
fprintf(stderr,"extra END\n");
|
||||
exit(1);
|
||||
}
|
||||
if (!depth) sname[0]=0;
|
||||
}
|
||||
|
||||
}
|
||||
if (depth!=0)
|
||||
{
|
||||
fprintf(stderr,"missing some ENDs at end of rc file\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
void processCPPfile(FILE *fp, const char *filename)
|
||||
{
|
||||
char clocsec[512];
|
||||
clocsec[0]=0;
|
||||
WDL_FastString fs;
|
||||
for (;;)
|
||||
{
|
||||
char buf[8192];
|
||||
if (!fgets(buf,sizeof(buf),fp)) break;
|
||||
fs.Append(buf);
|
||||
}
|
||||
|
||||
char *p = (char*)fs.Get();
|
||||
char *comment_state = NULL;
|
||||
g_last_linecnt++;
|
||||
while (*p)
|
||||
{
|
||||
if (!strncmp(p,"//",2))
|
||||
{
|
||||
comment_state = p;
|
||||
p+=2;
|
||||
}
|
||||
else if (*p == '\n')
|
||||
{
|
||||
g_last_linecnt++;
|
||||
comment_state = NULL;
|
||||
p++;
|
||||
}
|
||||
else if (!comment_state)
|
||||
{
|
||||
int hm;
|
||||
if (*p == '\\') { p++; if (*p) p++; }
|
||||
else if (*p == '\'') { p++; if (*p == '"') p++; }
|
||||
else if (*p == '"')
|
||||
{
|
||||
int l = length_of_quoted_string(p+1,false);
|
||||
if (clocsec[0])
|
||||
{
|
||||
gotString(p+1,l,clocsec,false, filename, g_last_linecnt);
|
||||
}
|
||||
p += l+2;
|
||||
}
|
||||
else if ((p==(char*)fs.Get() || (!isalnum(p[-1]) && p[-1] != '_')) && (hm=isLocalizeCall(p)))
|
||||
{
|
||||
while (*p != '(') p++;
|
||||
p++;
|
||||
while (isblank(*p)) p++;
|
||||
if (*p++ != '"')
|
||||
{
|
||||
fprintf(stderr,"Error: missing \" on %s:%d\n",filename,g_last_linecnt);
|
||||
exit(1);
|
||||
}
|
||||
int l = length_of_quoted_string(p,false);
|
||||
char *sp = p;
|
||||
p+=l+1;
|
||||
while (isblank(*p)) p++;
|
||||
if (*p++ != ',')
|
||||
{
|
||||
fprintf(stderr,"Error: missing , on %s:%d\n",filename,g_last_linecnt);
|
||||
exit(1);
|
||||
}
|
||||
while (isblank(*p)) p++;
|
||||
if (*p++ != '"')
|
||||
{
|
||||
fprintf(stderr,"Error: missing second \" on %s:%d\n",filename,g_last_linecnt);
|
||||
exit(1);
|
||||
}
|
||||
int l2 = length_of_quoted_string(p,false);
|
||||
|
||||
if (hm == HACK_WILDCARD_ENTRY)
|
||||
{
|
||||
gotString(p,l2,"render_wildcard",false, filename, g_last_linecnt);
|
||||
p += l2;
|
||||
}
|
||||
else
|
||||
{
|
||||
char sec[512];
|
||||
memcpy(sec,p,l2);
|
||||
sec[l2]=0;
|
||||
p+=l2;
|
||||
gotString(sp,l,sec,false, filename, g_last_linecnt);
|
||||
}
|
||||
p++;
|
||||
}
|
||||
else
|
||||
p++;
|
||||
}
|
||||
else if (p > comment_state && p < comment_state + 4)
|
||||
{
|
||||
if (!strncmp(p,"!WANT_LOCALIZE_STRINGS_BEGIN:",29))
|
||||
{
|
||||
p += 29;
|
||||
if (clocsec[0])
|
||||
{
|
||||
fprintf(stderr,"Error: !WANT_LOCALIZE_STRINGS_BEGIN: before WANT_LOCALIZE_STRINGS_END on %s:%d\n",filename,g_last_linecnt);
|
||||
exit(1);
|
||||
}
|
||||
int a = 0;
|
||||
while (*p && !isblank(*p) && a < sizeof(clocsec)) clocsec[a++] = *p++;
|
||||
if (a >= sizeof(clocsec))
|
||||
{
|
||||
fprintf(stderr,"Error: !WANT_LOCALIZE_STRINGS_BEGIN: too long on %s:%d\n",filename,g_last_linecnt);
|
||||
exit(1);
|
||||
}
|
||||
clocsec[a]=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!strncmp(p,"!WANT_LOCALIZE_STRINGS_END",26))
|
||||
{
|
||||
if (!clocsec[0])
|
||||
{
|
||||
fprintf(stderr,"Error: mismatched !WANT_LOCALIZE_STRINGS_END on %s:%d\n",filename,g_last_linecnt);
|
||||
exit(1);
|
||||
}
|
||||
clocsec[0]=0;
|
||||
}
|
||||
p++;
|
||||
}
|
||||
}
|
||||
else p++;
|
||||
}
|
||||
if (clocsec[0])
|
||||
{
|
||||
fprintf(stderr,"Error: missing !WANT_LOCALIZE_STRINGS_END at eof %s:%d\n",filename,g_last_linecnt);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int x;
|
||||
int casemode=0;
|
||||
for (x=1;x<argc;x++)
|
||||
{
|
||||
if (argv[x][0] == '-')
|
||||
{
|
||||
if (!strcmp(argv[x],"--lower")) casemode = -1;
|
||||
else if (!strcmp(argv[x],"--leet")) casemode = 2;
|
||||
else if (!strcmp(argv[x],"--utf8test")) casemode = 4;
|
||||
else if (!strcmp(argv[x],"--upper")) casemode = 1;
|
||||
else if (!strcmp(argv[x],"--template")) casemode = 3;
|
||||
else
|
||||
{
|
||||
printf("Usage: build_sample_langpack [--leet|--lower|--upper|--template] file.rc file.cpp ...\n");
|
||||
exit(1);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
FILE *fp = fopen(argv[x],"rb");
|
||||
if (!fp)
|
||||
{
|
||||
fprintf(stderr,"Error opening %s\n",argv[x]);
|
||||
return 1;
|
||||
}
|
||||
g_last_file = argv[x];
|
||||
g_last_linecnt=1;
|
||||
int alen =strlen(argv[x]);
|
||||
if (alen>3 && !stricmp(argv[x]+alen-3,".rc"))
|
||||
{
|
||||
WDL_String s(argv[x]);
|
||||
WDL_String dpre;
|
||||
char *p=s.Get();
|
||||
while (*p) p++;
|
||||
while (p>=s.Get() && *p != '\\' && *p != '/') p--;
|
||||
*++p=0;
|
||||
if (p>s.Get())
|
||||
{
|
||||
p-=2;
|
||||
while (p>=s.Get() && *p != '\\' && *p != '/') p--;
|
||||
dpre.Set(++p); // get dir name portion
|
||||
if (dpre.GetLength()) dpre.Get()[dpre.GetLength()-1]=0;
|
||||
}
|
||||
if (!strcmp(dpre.Get(),"jesusonic")) dpre.Set("jsfx");
|
||||
|
||||
s.Append("resource.h");
|
||||
const char *err=getResourceDefinesFromHeader(s.Get());
|
||||
if (err)
|
||||
{
|
||||
fprintf(stderr,"Error reading %s: %s\n",s.Get(),err);
|
||||
exit(1);
|
||||
}
|
||||
processRCfile(fp,dpre.Get()[0]?dpre.Get():NULL, argv[x]);
|
||||
}
|
||||
else
|
||||
{
|
||||
processCPPfile(fp,argv[x]);
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
}
|
||||
if (casemode==4) printf("\xef\xbb\xbf");
|
||||
printf("#NAME:%s\n",
|
||||
casemode==-1 ? "English (lower case, demo)" :
|
||||
casemode==1 ? "English (upper case, demo)" :
|
||||
casemode==2 ? "English (leet-speak, demo)" :
|
||||
casemode==4 ? "UTF-8 English test (demo)" :
|
||||
casemode==3 ? "Template (edit-me)" :
|
||||
"English (sample language pack)");
|
||||
if (casemode==3)
|
||||
{
|
||||
printf("; NOTE: this is the best starting point for making a new langpack.\n"
|
||||
"; As you translate a string, remove the ; from the beginning of the\n"
|
||||
"; line. If the line begins with ;^, then it is an optional string,\n"
|
||||
"; and you should only modify that line if the definition in [common]\n"
|
||||
"; is not accurate for that context.\n"
|
||||
"; You can enlarge windows using 5CA1E00000000000=scale, for example:\n"
|
||||
"; [DLG_218] ; IDD_LOCKSETTINGS\n"
|
||||
"; 5CA1E00000000000=1.2\n"
|
||||
"; This makes the above dialog 1.2x wider than default.\n\n");
|
||||
}
|
||||
|
||||
WDL_StringKeyedArray<bool> common_found;
|
||||
{
|
||||
if (!translations_indexed.GetSize())
|
||||
{
|
||||
fprintf(stderr,"no sections!\n");
|
||||
exit(1);
|
||||
}
|
||||
else if (translations_indexed.GetSize() > 4096)
|
||||
{
|
||||
fprintf(stderr,"too many translation sections, check input or adjust code here\n");
|
||||
exit(1);
|
||||
}
|
||||
fprintf(stderr,"%d sections\n",translations_indexed.GetSize());
|
||||
|
||||
int pos[4096]={0,};
|
||||
printf("[common]\n");
|
||||
WDL_FastString matchlist;
|
||||
WDL_AssocArray<WDL_UINT64, bool> ids(uint64cmpfunc);
|
||||
int minpos = 0;
|
||||
for (;;)
|
||||
{
|
||||
int matchcnt=0;
|
||||
matchlist.Set("");
|
||||
const char *str=NULL;
|
||||
for(x=minpos;x<translations_indexed.GetSize();x++)
|
||||
{
|
||||
const char *secname;
|
||||
WDL_StringKeyedArray<bool> *l = translations_indexed.Enumerate(x,&secname);
|
||||
int sz=l->GetSize();
|
||||
if (!str)
|
||||
{
|
||||
if (x>minpos)
|
||||
{
|
||||
memset(pos,0,sizeof(pos)); // start over
|
||||
minpos=x;
|
||||
}
|
||||
while (!str && pos[x]<sz)
|
||||
{
|
||||
l->Enumerate(pos[x]++,&str);
|
||||
if (!*str || common_found.Get(str)) str=NULL; // skip if we've already analyzed this string
|
||||
}
|
||||
if (str) matchlist.Set(secname);
|
||||
}
|
||||
else
|
||||
{
|
||||
while (pos[x] < sz)
|
||||
{
|
||||
const char *tv=NULL;
|
||||
l->Enumerate(pos[x],&tv);
|
||||
int c = strcmp(tv,str);
|
||||
if (c>0) break;
|
||||
pos[x]++;
|
||||
if (!c)
|
||||
{
|
||||
matchlist.Append(", ");
|
||||
matchlist.Append(secname);
|
||||
matchcnt++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (matchcnt>0)
|
||||
{
|
||||
common_found.Insert(str,true);
|
||||
//printf("; used by: %s\n",matchlist.Get());
|
||||
if (casemode==3) printf(";");
|
||||
WDL_UINT64 a = outputLine(str,casemode);
|
||||
if (ids.Get(a))
|
||||
{
|
||||
fprintf(stderr,"duplicate hash for strings in common section, hope this is OK.. 64 bit hash fail!\n");
|
||||
exit(1);
|
||||
}
|
||||
// printf("\n");
|
||||
ids.Insert(a,true);
|
||||
}
|
||||
if (minpos == x-1) break;
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
for(x=0;x<translations.GetSize();x++)
|
||||
{
|
||||
const char *nm=NULL;
|
||||
WDL_PtrList<char> *p = translations.Enumerate(x,&nm);
|
||||
if (x) printf("\n");
|
||||
char *secinfo = section_descs.Get(nm);
|
||||
printf("[%s]%s%s\n",nm,secinfo?" ; ":"", secinfo?secinfo:"");
|
||||
int a;
|
||||
int y;
|
||||
WDL_AssocArray<WDL_UINT64, bool> ids(uint64cmpfunc);
|
||||
for (a=0;a<2;a++)
|
||||
{
|
||||
for (y=0;y<p->GetSize();y++)
|
||||
{
|
||||
char *strv=p->Get(y);
|
||||
if (!*strv) continue;
|
||||
if ((common_found.Get(strv)?1:0) != a) continue;
|
||||
|
||||
if (a) printf(";^");
|
||||
else if (casemode==3) printf(";");
|
||||
|
||||
WDL_UINT64 a = outputLine(strv,casemode);
|
||||
if (ids.Get(a))
|
||||
{
|
||||
fprintf(stderr,"duplicate hash for strings in section, hope this is OK.. 64 bit hash fail!\n");
|
||||
exit(1);
|
||||
}
|
||||
ids.Insert(a,true);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
7
oversampling/WDL/localize/langpack_edit/.gitignore
vendored
Normal file
7
oversampling/WDL/localize/langpack_edit/.gitignore
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
Win32/Debug/
|
||||
Win32/Release/
|
||||
x64/Debug/
|
||||
x64/Release/
|
||||
*.sdf
|
||||
*.opensdf
|
||||
*.v12.suo
|
||||
654
oversampling/WDL/localize/langpack_edit/Base.lproj/MainMenu.xib
Normal file
654
oversampling/WDL/localize/langpack_edit/Base.lproj/MainMenu.xib
Normal file
@@ -0,0 +1,654 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14113" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14113"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="SWELLApplication">
|
||||
<connections>
|
||||
<outlet property="delegate" destination="494" id="495"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="SWELLApplication"/>
|
||||
<menu title="AMainMenu" systemMenu="main" id="29">
|
||||
<items>
|
||||
<menuItem title="LangPackEdit" id="56">
|
||||
<menu key="submenu" title="LangPackEdit" systemMenu="apple" id="57">
|
||||
<items>
|
||||
<menuItem title="About LangPackEdit" id="58">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="orderFrontStandardAboutPanel:" target="-2" id="142"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="236">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Preferences…" keyEquivalent="," id="129"/>
|
||||
<menuItem isSeparatorItem="YES" id="143">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Services" id="131">
|
||||
<menu key="submenu" title="Services" systemMenu="services" id="130"/>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="144">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Hide LangPackEdit" keyEquivalent="h" id="134">
|
||||
<connections>
|
||||
<action selector="hide:" target="-1" id="367"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Hide Others" keyEquivalent="h" id="145">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="hideOtherApplications:" target="-1" id="368"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Show All" id="150">
|
||||
<connections>
|
||||
<action selector="unhideAllApplications:" target="-1" id="370"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="149">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Quit LangPackEdit" tag="40000" keyEquivalent="q" id="136">
|
||||
<connections>
|
||||
<action selector="onSysMenuCommand:" target="494" id="Ca1-uU-6vc"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="File" id="83">
|
||||
<menu key="submenu" title="File" id="81">
|
||||
<items>
|
||||
<menuItem title="New" keyEquivalent="n" id="82">
|
||||
<connections>
|
||||
<action selector="newDocument:" target="-1" id="373"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Open…" keyEquivalent="o" id="72">
|
||||
<connections>
|
||||
<action selector="openDocument:" target="-1" id="374"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Open Recent" id="124">
|
||||
<menu key="submenu" title="Open Recent" systemMenu="recentDocuments" id="125">
|
||||
<items>
|
||||
<menuItem title="Clear Menu" id="126">
|
||||
<connections>
|
||||
<action selector="clearRecentDocuments:" target="-1" id="127"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="79">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Close" keyEquivalent="w" id="73">
|
||||
<connections>
|
||||
<action selector="performClose:" target="-1" id="193"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Save…" keyEquivalent="s" id="75">
|
||||
<connections>
|
||||
<action selector="saveDocument:" target="-1" id="362"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Revert to Saved" id="112">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="revertDocumentToSaved:" target="-1" id="364"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="74">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Page Setup..." keyEquivalent="P" id="77">
|
||||
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="runPageLayout:" target="-1" id="87"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Print…" keyEquivalent="p" id="78">
|
||||
<connections>
|
||||
<action selector="print:" target="-1" id="86"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Edit" id="217">
|
||||
<menu key="submenu" title="Edit" id="205">
|
||||
<items>
|
||||
<menuItem title="Undo" keyEquivalent="z" id="207">
|
||||
<connections>
|
||||
<action selector="undo:" target="-1" id="223"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Redo" keyEquivalent="Z" id="215">
|
||||
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="redo:" target="-1" id="231"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="206">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Cut" keyEquivalent="x" id="199">
|
||||
<connections>
|
||||
<action selector="cut:" target="-1" id="228"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Copy" keyEquivalent="c" id="197">
|
||||
<connections>
|
||||
<action selector="copy:" target="-1" id="224"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Paste" keyEquivalent="v" id="203">
|
||||
<connections>
|
||||
<action selector="paste:" target="-1" id="226"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Paste and Match Style" keyEquivalent="V" id="485">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="pasteAsPlainText:" target="-1" id="486"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Delete" id="202">
|
||||
<connections>
|
||||
<action selector="delete:" target="-1" id="235"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Select All" keyEquivalent="a" id="198">
|
||||
<connections>
|
||||
<action selector="selectAll:" target="-1" id="232"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="214">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Find" id="218">
|
||||
<menu key="submenu" title="Find" id="220">
|
||||
<items>
|
||||
<menuItem title="Find…" tag="1" keyEquivalent="f" id="209">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="241"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Find and Replace…" tag="12" keyEquivalent="f" id="534">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="535"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Find Next" tag="2" keyEquivalent="g" id="208">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="487"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Find Previous" tag="3" keyEquivalent="G" id="213">
|
||||
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="488"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="221">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="489"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Jump to Selection" keyEquivalent="j" id="210">
|
||||
<connections>
|
||||
<action selector="centerSelectionInVisibleArea:" target="-1" id="245"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Spelling and Grammar" id="216">
|
||||
<menu key="submenu" title="Spelling and Grammar" id="200">
|
||||
<items>
|
||||
<menuItem title="Show Spelling and Grammar" keyEquivalent=":" id="204">
|
||||
<connections>
|
||||
<action selector="showGuessPanel:" target="-1" id="230"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Check Document Now" keyEquivalent=";" id="201">
|
||||
<connections>
|
||||
<action selector="checkSpelling:" target="-1" id="225"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="453"/>
|
||||
<menuItem title="Check Spelling While Typing" id="219">
|
||||
<connections>
|
||||
<action selector="toggleContinuousSpellChecking:" target="-1" id="222"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Check Grammar With Spelling" id="346">
|
||||
<connections>
|
||||
<action selector="toggleGrammarChecking:" target="-1" id="347"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Correct Spelling Automatically" id="454">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticSpellingCorrection:" target="-1" id="456"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Substitutions" id="348">
|
||||
<menu key="submenu" title="Substitutions" id="349">
|
||||
<items>
|
||||
<menuItem title="Show Substitutions" id="457">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="orderFrontSubstitutionsPanel:" target="-1" id="458"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="459"/>
|
||||
<menuItem title="Smart Copy/Paste" tag="1" keyEquivalent="f" id="350">
|
||||
<connections>
|
||||
<action selector="toggleSmartInsertDelete:" target="-1" id="355"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Smart Quotes" tag="2" keyEquivalent="g" id="351">
|
||||
<connections>
|
||||
<action selector="toggleAutomaticQuoteSubstitution:" target="-1" id="356"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Smart Dashes" id="460">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticDashSubstitution:" target="-1" id="461"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Smart Links" tag="3" keyEquivalent="G" id="354">
|
||||
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticLinkDetection:" target="-1" id="357"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Text Replacement" id="462">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticTextReplacement:" target="-1" id="463"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Transformations" id="450">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Transformations" id="451">
|
||||
<items>
|
||||
<menuItem title="Make Upper Case" id="452">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="uppercaseWord:" target="-1" id="464"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Make Lower Case" id="465">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="lowercaseWord:" target="-1" id="468"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Capitalize" id="466">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="capitalizeWord:" target="-1" id="467"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Speech" id="211">
|
||||
<menu key="submenu" title="Speech" id="212">
|
||||
<items>
|
||||
<menuItem title="Start Speaking" id="196">
|
||||
<connections>
|
||||
<action selector="startSpeaking:" target="-1" id="233"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Stop Speaking" id="195">
|
||||
<connections>
|
||||
<action selector="stopSpeaking:" target="-1" id="227"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Format" id="375">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Format" id="376">
|
||||
<items>
|
||||
<menuItem title="Font" id="377">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Font" systemMenu="font" id="388">
|
||||
<items>
|
||||
<menuItem title="Show Fonts" keyEquivalent="t" id="389">
|
||||
<connections>
|
||||
<action selector="orderFrontFontPanel:" target="420" id="424"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Bold" tag="2" keyEquivalent="b" id="390">
|
||||
<connections>
|
||||
<action selector="addFontTrait:" target="420" id="421"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Italic" tag="1" keyEquivalent="i" id="391">
|
||||
<connections>
|
||||
<action selector="addFontTrait:" target="420" id="422"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Underline" keyEquivalent="u" id="392">
|
||||
<connections>
|
||||
<action selector="underline:" target="-1" id="432"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="393"/>
|
||||
<menuItem title="Bigger" tag="3" keyEquivalent="+" id="394">
|
||||
<connections>
|
||||
<action selector="modifyFont:" target="420" id="425"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Smaller" tag="4" keyEquivalent="-" id="395">
|
||||
<connections>
|
||||
<action selector="modifyFont:" target="420" id="423"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="396"/>
|
||||
<menuItem title="Kern" id="397">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Kern" id="415">
|
||||
<items>
|
||||
<menuItem title="Use Default" id="416">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="useStandardKerning:" target="-1" id="438"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Use None" id="417">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="turnOffKerning:" target="-1" id="441"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Tighten" id="418">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="tightenKerning:" target="-1" id="431"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Loosen" id="419">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="loosenKerning:" target="-1" id="435"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Ligatures" id="398">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Ligatures" id="411">
|
||||
<items>
|
||||
<menuItem title="Use Default" id="412">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="useStandardLigatures:" target="-1" id="439"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Use None" id="413">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="turnOffLigatures:" target="-1" id="440"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Use All" id="414">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="useAllLigatures:" target="-1" id="434"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Baseline" id="399">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Baseline" id="405">
|
||||
<items>
|
||||
<menuItem title="Use Default" id="406">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="unscript:" target="-1" id="437"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Superscript" id="407">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="superscript:" target="-1" id="430"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Subscript" id="408">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="subscript:" target="-1" id="429"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Raise" id="409">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="raiseBaseline:" target="-1" id="426"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Lower" id="410">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="lowerBaseline:" target="-1" id="427"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="400"/>
|
||||
<menuItem title="Show Colors" keyEquivalent="C" id="401">
|
||||
<connections>
|
||||
<action selector="orderFrontColorPanel:" target="-1" id="433"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="402"/>
|
||||
<menuItem title="Copy Style" keyEquivalent="c" id="403">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="copyFont:" target="-1" id="428"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Paste Style" keyEquivalent="v" id="404">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="pasteFont:" target="-1" id="436"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Text" id="496">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Text" id="497">
|
||||
<items>
|
||||
<menuItem title="Align Left" keyEquivalent="{" id="498">
|
||||
<connections>
|
||||
<action selector="alignLeft:" target="-1" id="524"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Center" keyEquivalent="|" id="499">
|
||||
<connections>
|
||||
<action selector="alignCenter:" target="-1" id="518"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Justify" id="500">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="alignJustified:" target="-1" id="523"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Align Right" keyEquivalent="}" id="501">
|
||||
<connections>
|
||||
<action selector="alignRight:" target="-1" id="521"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="502"/>
|
||||
<menuItem title="Writing Direction" id="503">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Writing Direction" id="508">
|
||||
<items>
|
||||
<menuItem title="Paragraph" enabled="NO" id="509">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem id="510">
|
||||
<string key="title"> Default</string>
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="makeBaseWritingDirectionNatural:" target="-1" id="525"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem id="511">
|
||||
<string key="title"> Left to Right</string>
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="makeBaseWritingDirectionLeftToRight:" target="-1" id="526"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem id="512">
|
||||
<string key="title"> Right to Left</string>
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="makeBaseWritingDirectionRightToLeft:" target="-1" id="527"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="513"/>
|
||||
<menuItem title="Selection" enabled="NO" id="514">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem id="515">
|
||||
<string key="title"> Default</string>
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="makeTextWritingDirectionNatural:" target="-1" id="528"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem id="516">
|
||||
<string key="title"> Left to Right</string>
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="makeTextWritingDirectionLeftToRight:" target="-1" id="529"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem id="517">
|
||||
<string key="title"> Right to Left</string>
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="makeTextWritingDirectionRightToLeft:" target="-1" id="530"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="504"/>
|
||||
<menuItem title="Show Ruler" id="505">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleRuler:" target="-1" id="520"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Copy Ruler" keyEquivalent="c" id="506">
|
||||
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="copyRuler:" target="-1" id="522"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Paste Ruler" keyEquivalent="v" id="507">
|
||||
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="pasteRuler:" target="-1" id="519"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="View" id="295">
|
||||
<menu key="submenu" title="View" id="296">
|
||||
<items>
|
||||
<menuItem title="Show Toolbar" keyEquivalent="t" id="297">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="toggleToolbarShown:" target="-1" id="366"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Customize Toolbar…" id="298">
|
||||
<connections>
|
||||
<action selector="runToolbarCustomizationPalette:" target="-1" id="365"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Window" id="19">
|
||||
<menu key="submenu" title="Window" systemMenu="window" id="24">
|
||||
<items>
|
||||
<menuItem title="Minimize" keyEquivalent="m" id="23">
|
||||
<connections>
|
||||
<action selector="performMiniaturize:" target="-1" id="37"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Zoom" id="239">
|
||||
<connections>
|
||||
<action selector="performZoom:" target="-1" id="240"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="92">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Bring All to Front" id="5">
|
||||
<connections>
|
||||
<action selector="arrangeInFront:" target="-1" id="39"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Help" id="490">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Help" systemMenu="help" id="491">
|
||||
<items>
|
||||
<menuItem title="LangPackEdit Help" keyEquivalent="?" id="492">
|
||||
<connections>
|
||||
<action selector="showHelp:" target="-1" id="493"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
<point key="canvasLocation" x="142" y="154"/>
|
||||
</menu>
|
||||
<customObject id="494" customClass="SWELLAppController"/>
|
||||
<customObject id="420" customClass="NSFontManager"/>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>LangPackEdit</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>nobody.wdl.langpackedit</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.5</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.developer-tools</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2022 Cockos Inc</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>SWELLApplication</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,9 @@
|
||||
//
|
||||
// Prefix header
|
||||
//
|
||||
// The contents of this file are implicitly included at the beginning of every source file.
|
||||
//
|
||||
|
||||
#ifdef __OBJC__
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#endif
|
||||
BIN
oversampling/WDL/localize/langpack_edit/LangPackEdit.icns
Normal file
BIN
oversampling/WDL/localize/langpack_edit/LangPackEdit.icns
Normal file
Binary file not shown.
28
oversampling/WDL/localize/langpack_edit/LangPackEdit.sln
Normal file
28
oversampling/WDL/localize/langpack_edit/LangPackEdit.sln
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Express 2013 for Windows Desktop
|
||||
VisualStudioVersion = 12.0.21005.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LangPackEdit", "LangPackEdit.vcxproj", "{DC8CCBA9-5214-48ED-96AE-C18B212FBE10}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{DC8CCBA9-5214-48ED-96AE-C18B212FBE10}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{DC8CCBA9-5214-48ED-96AE-C18B212FBE10}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{DC8CCBA9-5214-48ED-96AE-C18B212FBE10}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{DC8CCBA9-5214-48ED-96AE-C18B212FBE10}.Debug|x64.Build.0 = Debug|x64
|
||||
{DC8CCBA9-5214-48ED-96AE-C18B212FBE10}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{DC8CCBA9-5214-48ED-96AE-C18B212FBE10}.Release|Win32.Build.0 = Release|Win32
|
||||
{DC8CCBA9-5214-48ED-96AE-C18B212FBE10}.Release|x64.ActiveCfg = Release|x64
|
||||
{DC8CCBA9-5214-48ED-96AE-C18B212FBE10}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
172
oversampling/WDL/localize/langpack_edit/LangPackEdit.vcxproj
Normal file
172
oversampling/WDL/localize/langpack_edit/LangPackEdit.vcxproj
Normal file
@@ -0,0 +1,172 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{DC8CCBA9-5214-48ED-96AE-C18B212FBE10}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>LangPackEdit</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<IntDir>$(SolutionDir)$(Platform)\$(Configuration)\</IntDir>
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<IntDir>$(SolutionDir)$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<IntDir>$(SolutionDir)$(Platform)\$(Configuration)\</IntDir>
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<IntDir>$(SolutionDir)$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;BUILD_WINDOWS;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;winmm.lib;wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;BUILD_WINDOWS;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;winmm.lib;wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;BUILD_WINDOWS;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;winmm.lib;wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;BUILD_WINDOWS;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;winmm.lib;wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="ReadMe.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="resource.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\filebrowse.cpp" />
|
||||
<ClCompile Include="..\localize.cpp" />
|
||||
<ClCompile Include="..\..\win32_utf8.c" />
|
||||
<ClCompile Include="..\..\wingui\wndsize.cpp" />
|
||||
<ClCompile Include="langpack_edit.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="res.rc" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\WDL">
|
||||
<UniqueIdentifier>{26d63633-dc60-4f96-afe7-14e5aa4ad154}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="ReadMe.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="resource.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\wingui\wndsize.cpp">
|
||||
<Filter>Source Files\WDL</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\win32_utf8.c">
|
||||
<Filter>Source Files\WDL</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="langpack_edit.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\localize.cpp">
|
||||
<Filter>Source Files\WDL</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\filebrowse.cpp">
|
||||
<Filter>Source Files\WDL</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="res.rc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,417 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
338536692957A46300048720 /* langpack_edit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 338536682957A46300048720 /* langpack_edit.cpp */; };
|
||||
3385366B2957A4D300048720 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 3385366A2957A4D300048720 /* main.m */; };
|
||||
338536702957A62F00048720 /* LangPackEdit.icns in Resources */ = {isa = PBXBuildFile; fileRef = 3385366E2957A62F00048720 /* LangPackEdit.icns */; };
|
||||
338536732957A6EB00048720 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 338536712957A6EB00048720 /* MainMenu.xib */; };
|
||||
3385932D185B555500FDFFEA /* wndsize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3385932C185B555500FDFFEA /* wndsize.cpp */; };
|
||||
33AA3116185A7E8D001D767E /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33AA3115185A7E8D001D767E /* Cocoa.framework */; };
|
||||
33AA3126185A7E8D001D767E /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 33AA3124185A7E8D001D767E /* Credits.rtf */; };
|
||||
33B8832B2958A0C300A9EBFF /* filebrowse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33B8832A2958A0C300A9EBFF /* filebrowse.cpp */; };
|
||||
33B8832E2958A3BD00A9EBFF /* localize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33B8832D2958A3BD00A9EBFF /* localize.cpp */; };
|
||||
33F96581185A7F79004C7070 /* swell-appstub.mm in Sources */ = {isa = PBXBuildFile; fileRef = 33F96576185A7F79004C7070 /* swell-appstub.mm */; };
|
||||
33F96582185A7F79004C7070 /* swell-dlg.mm in Sources */ = {isa = PBXBuildFile; fileRef = 33F96577185A7F79004C7070 /* swell-dlg.mm */; };
|
||||
33F96583185A7F79004C7070 /* swell-gdi.mm in Sources */ = {isa = PBXBuildFile; fileRef = 33F96578185A7F79004C7070 /* swell-gdi.mm */; };
|
||||
33F96584185A7F79004C7070 /* swell-ini.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33F96579185A7F79004C7070 /* swell-ini.cpp */; };
|
||||
33F96585185A7F79004C7070 /* swell-kb.mm in Sources */ = {isa = PBXBuildFile; fileRef = 33F9657A185A7F79004C7070 /* swell-kb.mm */; };
|
||||
33F96586185A7F79004C7070 /* swell-menu.mm in Sources */ = {isa = PBXBuildFile; fileRef = 33F9657B185A7F79004C7070 /* swell-menu.mm */; };
|
||||
33F96587185A7F79004C7070 /* swell-misc.mm in Sources */ = {isa = PBXBuildFile; fileRef = 33F9657C185A7F79004C7070 /* swell-misc.mm */; };
|
||||
33F96588185A7F79004C7070 /* swell-miscdlg.mm in Sources */ = {isa = PBXBuildFile; fileRef = 33F9657D185A7F79004C7070 /* swell-miscdlg.mm */; };
|
||||
33F96589185A7F79004C7070 /* swell-wnd.mm in Sources */ = {isa = PBXBuildFile; fileRef = 33F9657E185A7F79004C7070 /* swell-wnd.mm */; };
|
||||
33F9658A185A7F79004C7070 /* swell.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33F9657F185A7F79004C7070 /* swell.cpp */; };
|
||||
33F9658B185A7F79004C7070 /* swellappmain.mm in Sources */ = {isa = PBXBuildFile; fileRef = 33F96580185A7F79004C7070 /* swellappmain.mm */; };
|
||||
33F9658D185A8228004C7070 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33F9658C185A8228004C7070 /* Carbon.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
338536682957A46300048720 /* langpack_edit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = langpack_edit.cpp; sourceTree = SOURCE_ROOT; };
|
||||
3385366A2957A4D300048720 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = SOURCE_ROOT; };
|
||||
3385366C2957A62F00048720 /* LangPackEdit-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "LangPackEdit-Info.plist"; sourceTree = SOURCE_ROOT; };
|
||||
3385366D2957A62F00048720 /* LangPackEdit-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "LangPackEdit-Prefix.pch"; sourceTree = SOURCE_ROOT; };
|
||||
3385366E2957A62F00048720 /* LangPackEdit.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = LangPackEdit.icns; sourceTree = SOURCE_ROOT; };
|
||||
338536722957A6EB00048720 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = SOURCE_ROOT; };
|
||||
3385932C185B555500FDFFEA /* wndsize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = wndsize.cpp; path = ../../wingui/wndsize.cpp; sourceTree = "<group>"; };
|
||||
33AA3112185A7E8D001D767E /* LangPackEdit.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LangPackEdit.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
33AA3115185A7E8D001D767E /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
|
||||
33AA3118185A7E8D001D767E /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
|
||||
33AA3119185A7E8D001D767E /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
|
||||
33AA311A185A7E8D001D767E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
33AA311F185A7E8D001D767E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
33AA3125185A7E8D001D767E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = "<group>"; };
|
||||
33B8832A2958A0C300A9EBFF /* filebrowse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ../../filebrowse.cpp; sourceTree = "<group>"; };
|
||||
33B8832C2958A3BD00A9EBFF /* localize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = localize.h; path = localize/localize.h; sourceTree = "<group>"; };
|
||||
33B8832D2958A3BD00A9EBFF /* localize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = localize.cpp; path = ../localize.cpp; sourceTree = "<group>"; };
|
||||
33F96576185A7F79004C7070 /* swell-appstub.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "swell-appstub.mm"; path = "../../swell/swell-appstub.mm"; sourceTree = "<group>"; };
|
||||
33F96577185A7F79004C7070 /* swell-dlg.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "swell-dlg.mm"; path = "../../swell/swell-dlg.mm"; sourceTree = "<group>"; };
|
||||
33F96578185A7F79004C7070 /* swell-gdi.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "swell-gdi.mm"; path = "../../swell/swell-gdi.mm"; sourceTree = "<group>"; };
|
||||
33F96579185A7F79004C7070 /* swell-ini.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "swell-ini.cpp"; path = "../../swell/swell-ini.cpp"; sourceTree = "<group>"; };
|
||||
33F9657A185A7F79004C7070 /* swell-kb.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "swell-kb.mm"; path = "../../swell/swell-kb.mm"; sourceTree = "<group>"; };
|
||||
33F9657B185A7F79004C7070 /* swell-menu.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "swell-menu.mm"; path = "../../swell/swell-menu.mm"; sourceTree = "<group>"; };
|
||||
33F9657C185A7F79004C7070 /* swell-misc.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "swell-misc.mm"; path = "../../swell/swell-misc.mm"; sourceTree = "<group>"; };
|
||||
33F9657D185A7F79004C7070 /* swell-miscdlg.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "swell-miscdlg.mm"; path = "../../swell/swell-miscdlg.mm"; sourceTree = "<group>"; };
|
||||
33F9657E185A7F79004C7070 /* swell-wnd.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "swell-wnd.mm"; path = "../../swell/swell-wnd.mm"; sourceTree = "<group>"; };
|
||||
33F9657F185A7F79004C7070 /* swell.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = swell.cpp; path = ../../swell/swell.cpp; sourceTree = "<group>"; };
|
||||
33F96580185A7F79004C7070 /* swellappmain.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = swellappmain.mm; path = ../../swell/swellappmain.mm; sourceTree = "<group>"; };
|
||||
33F9658C185A8228004C7070 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = System/Library/Frameworks/Carbon.framework; sourceTree = SDKROOT; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
33AA310F185A7E8D001D767E /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
33F9658D185A8228004C7070 /* Carbon.framework in Frameworks */,
|
||||
33AA3116185A7E8D001D767E /* Cocoa.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
33AA3109185A7E8D001D767E = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
338536712957A6EB00048720 /* MainMenu.xib */,
|
||||
338536682957A46300048720 /* langpack_edit.cpp */,
|
||||
3385366C2957A62F00048720 /* LangPackEdit-Info.plist */,
|
||||
3385366D2957A62F00048720 /* LangPackEdit-Prefix.pch */,
|
||||
3385366E2957A62F00048720 /* LangPackEdit.icns */,
|
||||
3385366A2957A4D300048720 /* main.m */,
|
||||
33AA3149185A7EEC001D767E /* WDL */,
|
||||
33AA311E185A7E8D001D767E /* InfoPlist.strings */,
|
||||
33AA3124185A7E8D001D767E /* Credits.rtf */,
|
||||
33AA3114185A7E8D001D767E /* Frameworks */,
|
||||
33AA3113185A7E8D001D767E /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
33AA3113185A7E8D001D767E /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
33AA3112185A7E8D001D767E /* LangPackEdit.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
33AA3114185A7E8D001D767E /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
33F9658C185A8228004C7070 /* Carbon.framework */,
|
||||
33AA3115185A7E8D001D767E /* Cocoa.framework */,
|
||||
33AA3117185A7E8D001D767E /* Other Frameworks */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
33AA3117185A7E8D001D767E /* Other Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
33AA3118185A7E8D001D767E /* AppKit.framework */,
|
||||
33AA3119185A7E8D001D767E /* CoreData.framework */,
|
||||
33AA311A185A7E8D001D767E /* Foundation.framework */,
|
||||
);
|
||||
name = "Other Frameworks";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
33AA3149185A7EEC001D767E /* WDL */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
33B8832A2958A0C300A9EBFF /* filebrowse.cpp */,
|
||||
33B8832D2958A3BD00A9EBFF /* localize.cpp */,
|
||||
33B8832C2958A3BD00A9EBFF /* localize.h */,
|
||||
3385932C185B555500FDFFEA /* wndsize.cpp */,
|
||||
33AA314A185A7EF4001D767E /* swell */,
|
||||
);
|
||||
name = WDL;
|
||||
path = .;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
33AA314A185A7EF4001D767E /* swell */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
33F96576185A7F79004C7070 /* swell-appstub.mm */,
|
||||
33F96577185A7F79004C7070 /* swell-dlg.mm */,
|
||||
33F96578185A7F79004C7070 /* swell-gdi.mm */,
|
||||
33F96579185A7F79004C7070 /* swell-ini.cpp */,
|
||||
33F9657A185A7F79004C7070 /* swell-kb.mm */,
|
||||
33F9657B185A7F79004C7070 /* swell-menu.mm */,
|
||||
33F9657C185A7F79004C7070 /* swell-misc.mm */,
|
||||
33F9657D185A7F79004C7070 /* swell-miscdlg.mm */,
|
||||
33F9657E185A7F79004C7070 /* swell-wnd.mm */,
|
||||
33F9657F185A7F79004C7070 /* swell.cpp */,
|
||||
33F96580185A7F79004C7070 /* swellappmain.mm */,
|
||||
);
|
||||
name = swell;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
33AA3111185A7E8D001D767E /* LangPackEdit */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 33AA3143185A7E8D001D767E /* Build configuration list for PBXNativeTarget "LangPackEdit" */;
|
||||
buildPhases = (
|
||||
3304E16F1FC2253B00290319 /* ShellScript */,
|
||||
33AA310E185A7E8D001D767E /* Sources */,
|
||||
33AA310F185A7E8D001D767E /* Frameworks */,
|
||||
33AA3110185A7E8D001D767E /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = LangPackEdit;
|
||||
productName = langpack_edit;
|
||||
productReference = 33AA3112185A7E8D001D767E /* LangPackEdit.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
33AA310A185A7E8D001D767E /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0500;
|
||||
ORGANIZATIONNAME = cockos;
|
||||
};
|
||||
buildConfigurationList = 33AA310D185A7E8D001D767E /* Build configuration list for PBXProject "LangPackEdit" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
English,
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = 33AA3109185A7E8D001D767E;
|
||||
productRefGroup = 33AA3113185A7E8D001D767E /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
33AA3111185A7E8D001D767E /* LangPackEdit */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
33AA3110185A7E8D001D767E /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
338536732957A6EB00048720 /* MainMenu.xib in Resources */,
|
||||
33AA3126185A7E8D001D767E /* Credits.rtf in Resources */,
|
||||
338536702957A62F00048720 /* LangPackEdit.icns in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
3304E16F1FC2253B00290319 /* ShellScript */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "/usr/bin/perl ../../swell/swell_resgen.pl res.rc\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
33AA310E185A7E8D001D767E /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
33B8832E2958A3BD00A9EBFF /* localize.cpp in Sources */,
|
||||
33F96581185A7F79004C7070 /* swell-appstub.mm in Sources */,
|
||||
33F9658B185A7F79004C7070 /* swellappmain.mm in Sources */,
|
||||
33F9658A185A7F79004C7070 /* swell.cpp in Sources */,
|
||||
33F96584185A7F79004C7070 /* swell-ini.cpp in Sources */,
|
||||
3385932D185B555500FDFFEA /* wndsize.cpp in Sources */,
|
||||
33F96589185A7F79004C7070 /* swell-wnd.mm in Sources */,
|
||||
33F96582185A7F79004C7070 /* swell-dlg.mm in Sources */,
|
||||
33F96585185A7F79004C7070 /* swell-kb.mm in Sources */,
|
||||
33F96586185A7F79004C7070 /* swell-menu.mm in Sources */,
|
||||
33F96583185A7F79004C7070 /* swell-gdi.mm in Sources */,
|
||||
338536692957A46300048720 /* langpack_edit.cpp in Sources */,
|
||||
33B8832B2958A0C300A9EBFF /* filebrowse.cpp in Sources */,
|
||||
33F96587185A7F79004C7070 /* swell-misc.mm in Sources */,
|
||||
3385366B2957A4D300048720 /* main.m in Sources */,
|
||||
33F96588185A7F79004C7070 /* swell-miscdlg.mm in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
338536712957A6EB00048720 /* MainMenu.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
338536722957A6EB00048720 /* Base */,
|
||||
);
|
||||
name = MainMenu.xib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
33AA311E185A7E8D001D767E /* InfoPlist.strings */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
33AA311F185A7E8D001D767E /* en */,
|
||||
);
|
||||
name = InfoPlist.strings;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
33AA3124185A7E8D001D767E /* Credits.rtf */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
33AA3125185A7E8D001D767E /* en */,
|
||||
);
|
||||
name = Credits.rtf;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
33AA3141185A7E8D001D767E /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD)";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++98";
|
||||
CLANG_CXX_LIBRARY = "libstdc++";
|
||||
CLANG_ENABLE_OBJC_ARC = NO;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_STRICT_ALIASING = NO;
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.5;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
33AA3142185A7E8D001D767E /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD)";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++98";
|
||||
CLANG_CXX_LIBRARY = "libstdc++";
|
||||
CLANG_ENABLE_OBJC_ARC = NO;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_STRICT_ALIASING = NO;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.5;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
33AA3144185A7E8D001D767E /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "LangPackEdit-Prefix.pch";
|
||||
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO;
|
||||
INFOPLIST_FILE = "LangPackEdit-Info.plist";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.9;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = nobody.wdl.langpackedit;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
33AA3145185A7E8D001D767E /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "LangPackEdit-Prefix.pch";
|
||||
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO;
|
||||
INFOPLIST_FILE = "LangPackEdit-Info.plist";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.9;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = nobody.wdl.langpackedit;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
33AA310D185A7E8D001D767E /* Build configuration list for PBXProject "LangPackEdit" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
33AA3141185A7E8D001D767E /* Debug */,
|
||||
33AA3142185A7E8D001D767E /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
33AA3143185A7E8D001D767E /* Build configuration list for PBXNativeTarget "LangPackEdit" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
33AA3144185A7E8D001D767E /* Debug */,
|
||||
33AA3145185A7E8D001D767E /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 33AA310A185A7E8D001D767E /* Project object */;
|
||||
}
|
||||
110
oversampling/WDL/localize/langpack_edit/Makefile
Normal file
110
oversampling/WDL/localize/langpack_edit/Makefile
Normal file
@@ -0,0 +1,110 @@
|
||||
APPNAME=langpack_edit
|
||||
|
||||
WDL_PATH = ../..
|
||||
vpath swell%.cpp $(WDL_PATH)/swell
|
||||
vpath lice%.cpp $(WDL_PATH)/lice
|
||||
vpath %.c $(WDL_PATH)
|
||||
vpath %.cpp $(WDL_PATH) $(WDL_PATH)/wingui $(WDL_PATH)/localize
|
||||
|
||||
###### Objects and resources (probably too many)
|
||||
SWELL_OBJS = swell.o swell-ini.o swell-miscdlg-generic.o swell-wnd-generic.o \
|
||||
swell-menu-generic.o swell-kb-generic.o swell-dlg-generic.o \
|
||||
swell-gdi-generic.o swell-misc-generic.o swell-gdi-lice.o \
|
||||
swell-generic-gdk.o swell-appstub-generic.o swell-modstub-generic.o
|
||||
|
||||
LICE_OBJS = lice_image.o lice_arc.o lice_line.o lice_text.o \
|
||||
lice_textnew.o lice.o lice_colorspace.o
|
||||
|
||||
OTHER_OBJS = wndsize.o localize.o filebrowse.o
|
||||
|
||||
RESFILES = res.rc_mac_dlg res.rc_mac_menu
|
||||
|
||||
OBJS += langpack_edit.o $(SWELL_OBJS) $(OTHER_OBJS)
|
||||
|
||||
|
||||
###### Compiler/Linker flags
|
||||
CFLAGS += -pipe -fvisibility=hidden -fno-math-errno -fPIC -DPIC -Wall -Wshadow -Wtype-limits \
|
||||
-Wno-unused-function -Wno-multichar -Wno-unused-result
|
||||
|
||||
CFLAGS += -D_FILE_OFFSET_BITS=64
|
||||
|
||||
ARCH := $(shell uname -m)
|
||||
PKG_CONFIG = pkg-config
|
||||
|
||||
ifndef ALLOW_WARNINGS
|
||||
CFLAGS += -Werror
|
||||
endif
|
||||
ifndef DEPRECATED_WARNINGS
|
||||
CFLAGS += -Wno-deprecated-declarations
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),arm64)
|
||||
CFLAGS += -fsigned-char
|
||||
else
|
||||
ifneq ($(filter arm%,$(ARCH)),)
|
||||
CFLAGS += -fsigned-char -mfpu=vfp -march=armv6t2 -marm
|
||||
endif
|
||||
ifeq ($(ARCH),aarch64)
|
||||
CFLAGS += -fsigned-char
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
ifndef RELEASE
|
||||
CFLAGS += -O0 -g -D_DEBUG -DWDL_CHECK_FOR_NON_UTF8_FOPEN
|
||||
else
|
||||
CFLAGS += -O2 -DNDEBUG
|
||||
endif
|
||||
|
||||
LINKEXTRA = -lpthread -ldl
|
||||
|
||||
ifndef NOGDK
|
||||
ifdef GDK2
|
||||
CFLAGS += -DSWELL_TARGET_GDK=2 $(shell $(PKG_CONFIG) --cflags gdk-2.0)
|
||||
LINKEXTRA += $(shell $(PKG_CONFIG) --libs gdk-2.0)
|
||||
LINKEXTRA += -lX11 -lXi
|
||||
else
|
||||
ifdef SWELL_SUPPORT_GTK
|
||||
CFLAGS += -DSWELL_TARGET_GDK=3 $(shell $(PKG_CONFIG) --cflags gtk+-3.0) -DSWELL_SUPPORT_GTK
|
||||
else
|
||||
CFLAGS += -DSWELL_TARGET_GDK=3 $(shell $(PKG_CONFIG) --cflags gdk-3.0)
|
||||
endif
|
||||
LINKEXTRA += -lX11 -lXi -lGL
|
||||
ifdef SWELL_SUPPORT_GTK
|
||||
LINKEXTRA += $(shell $(PKG_CONFIG) --libs gtk+-3.0)
|
||||
else
|
||||
LINKEXTRA += $(shell $(PKG_CONFIG) --libs gdk-3.0)
|
||||
endif
|
||||
endif
|
||||
CFLAGS += -DSWELL_LICE_GDI
|
||||
OBJS += $(LICE_OBJS)
|
||||
|
||||
ifndef NOFREETYPE
|
||||
CFLAGS += -DSWELL_FREETYPE $(shell $(PKG_CONFIG) --cflags freetype2)
|
||||
LINKEXTRA += $(shell $(PKG_CONFIG) --libs freetype2)
|
||||
ifndef NOFONTCONFIG
|
||||
CFLAGS += -DSWELL_FONTCONFIG
|
||||
LINKEXTRA += -lfontconfig
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
CXXFLAGS = $(CFLAGS)
|
||||
|
||||
|
||||
default: $(APPNAME)
|
||||
|
||||
.PHONY: clean run
|
||||
|
||||
$(RESFILES): res.rc
|
||||
$(WDL_PATH)/swell/swell_resgen.pl $^
|
||||
|
||||
$(APPNAME): $(RESFILES) $(OBJS)
|
||||
$(CXX) -o $@ $(CFLAGS) $(OBJS) $(LINKEXTRA)
|
||||
|
||||
run: $(APPNAME)
|
||||
./$^
|
||||
|
||||
clean:
|
||||
-rm $(OBJS) $(APPNAME) $(RESFILES)
|
||||
BIN
oversampling/WDL/localize/langpack_edit/Resources/main.png
Normal file
BIN
oversampling/WDL/localize/langpack_edit/Resources/main.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
@@ -0,0 +1,7 @@
|
||||
{\rtf1\ansi\ansicpg1252\cocoartf1265
|
||||
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
\vieww9600\viewh8400\viewkind0
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
|
||||
|
||||
\f0\b\fs24 \cf0 This is it, word.}
|
||||
@@ -0,0 +1,2 @@
|
||||
/* Localized versions of Info.plist keys */
|
||||
|
||||
BIN
oversampling/WDL/localize/langpack_edit/icon1.ico
Normal file
BIN
oversampling/WDL/localize/langpack_edit/icon1.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 766 B |
1106
oversampling/WDL/localize/langpack_edit/langpack_edit.cpp
Normal file
1106
oversampling/WDL/localize/langpack_edit/langpack_edit.cpp
Normal file
File diff suppressed because it is too large
Load Diff
10
oversampling/WDL/localize/langpack_edit/main.m
Normal file
10
oversampling/WDL/localize/langpack_edit/main.m
Normal file
@@ -0,0 +1,10 @@
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
int main(int argc, const char * argv[])
|
||||
{
|
||||
extern const char **g_argv;
|
||||
extern int g_argc;
|
||||
g_argc=argc;
|
||||
g_argv=argv;
|
||||
return NSApplicationMain(argc, argv);
|
||||
}
|
||||
228
oversampling/WDL/localize/langpack_edit/res.rc
Normal file
228
oversampling/WDL/localize/langpack_edit/res.rc
Normal file
@@ -0,0 +1,228 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDI_ICON1 ICON DISCARDABLE "icon1.ico"
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_DIALOG1 DIALOG DISCARDABLE 0, 0, 600, 400
|
||||
STYLE DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION |
|
||||
WS_SYSMENU | WS_THICKFRAME
|
||||
CAPTION "LangPackEdit"
|
||||
MENU IDR_MENU1
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "Template:",IDC_TEMPLATE_LABEL,3,10,35,8
|
||||
EDITTEXT IDC_TEMPLATE,41,8,556,12,ES_AUTOHSCROLL | ES_READONLY
|
||||
LTEXT "Pack:",IDC_PACK_LABEL,3,26,35,8
|
||||
EDITTEXT IDC_PACK,41,24,556,12,ES_AUTOHSCROLL | ES_READONLY
|
||||
LTEXT "Comments:",IDC_COMMENTS_LABEL,3,40,35,8
|
||||
EDITTEXT IDC_COMMENTS,41,40,556,37,ES_MULTILINE | ES_AUTOHSCROLL
|
||||
LTEXT "Filter:",IDC_FILTERLBL,3,83,35,8,SS_NOTIFY
|
||||
EDITTEXT IDC_FILTER,41,80,556,14,ES_AUTOHSCROLL
|
||||
CONTROL "List1",IDC_LIST,"SysListView32",LVS_REPORT |
|
||||
LVS_SHOWSELALWAYS | LVS_OWNERDATA | LVS_NOSORTHEADER |
|
||||
WS_BORDER | WS_TABSTOP,3,97,594,300
|
||||
END
|
||||
|
||||
IDD_RENAME DIALOG DISCARDABLE 0, 0, 400, 81
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Localize: "
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "Localized string:",IDC_STATIC,7,41,61,8
|
||||
EDITTEXT IDC_LOCALIZED_STRING,65,39,328,14,ES_AUTOHSCROLL
|
||||
DEFPUSHBUTTON "OK",IDOK,118,61,44,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,167,61,44,14
|
||||
PUSHBUTTON "Remove Localization",IDC_REMOVE_LOCALIZATION,220,61,84,
|
||||
14
|
||||
PUSHBUTTON "Set to Template String",IDC_COPY_TEMPLATE,309,61,84,14
|
||||
LTEXT "Template string:",IDC_STATIC,7,9,61,8
|
||||
EDITTEXT IDC_TEMPLATE_STRING,65,7,328,14,ES_AUTOHSCROLL |
|
||||
ES_READONLY
|
||||
LTEXT "[common] string:",IDC_COMMON_LABEL,7,25,61,8
|
||||
EDITTEXT IDC_COMMON_STRING,65,23,328,14,ES_AUTOHSCROLL |
|
||||
ES_READONLY
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Menu
|
||||
//
|
||||
|
||||
IDR_CONTEXTMENU MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "Context"
|
||||
BEGIN
|
||||
MENUITEM "Edit localization\tEnter", IDC_LOCALIZED_STRING
|
||||
MENUITEM "Edit [common] localization", IDC_COMMON_STRING
|
||||
MENUITEM "Add dialog scaling item for context", ID_SCALING_ADD
|
||||
MENUITEM "Set localization to template value if not set (mark as localized)",
|
||||
IDC_COPY_TEMPLATE
|
||||
MENUITEM "Remove localization\tDelete", IDC_REMOVE_LOCALIZATION
|
||||
MENUITEM "Remove localization from items that match template",
|
||||
IDC_REMOVE_NONLOCALIZATION
|
||||
END
|
||||
END
|
||||
|
||||
IDR_MENU1 MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "&File"
|
||||
BEGIN
|
||||
MENUITEM "Load &Template...\tCtrl+T", IDC_TEMPLATE_LOAD
|
||||
MENUITEM "&Load Pack...\tCtrl+O", IDC_PACK_LOAD
|
||||
MENUITEM "&Save Pack\tCtrl+S", IDC_PACK_SAVE
|
||||
MENUITEM "Save Pack &As...\tCtrl+Alt+S", IDC_PACK_SAVE_AS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Quit\tCtrl+Q", ID_QUIT
|
||||
END
|
||||
POPUP "&Edit"
|
||||
BEGIN
|
||||
MENUITEM "Edit localization\tEnter", IDC_LOCALIZED_STRING
|
||||
MENUITEM "Edit [common] localization", IDC_COMMON_STRING
|
||||
MENUITEM "Add dialog scaling item for context", ID_SCALING_ADD
|
||||
MENUITEM "Set localization to template value if not set (mark as localized)",
|
||||
IDC_COPY_TEMPLATE
|
||||
MENUITEM "Remove localization\tDelete", IDC_REMOVE_LOCALIZATION
|
||||
MENUITEM "Remove localization from items that match template",
|
||||
IDC_REMOVE_NONLOCALIZATION
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
IDD_DIALOG1, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 4
|
||||
RIGHTMARGIN, 597
|
||||
TOPMARGIN, 3
|
||||
BOTTOMMARGIN, 258
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
#ifndef _MAC
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 0,0,0,1
|
||||
PRODUCTVERSION 0,0,0,1
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x40004L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "Comments", "\0"
|
||||
VALUE "CompanyName", "unknown\0"
|
||||
VALUE "FileDescription", "LangPackEdit\0"
|
||||
VALUE "FileVersion", "0, 0, 0, 5\0"
|
||||
VALUE "InternalName", "LangPackEdit\0"
|
||||
VALUE "LegalCopyright", "Copyright <20> 2022 and onwards Cockos Inc\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "OriginalFilename", "LangPackEdit.exe\0"
|
||||
VALUE "PrivateBuild", "\0"
|
||||
VALUE "ProductName", "LangPackEdit\0"
|
||||
VALUE "ProductVersion", "0, 0, 0, 5\0"
|
||||
VALUE "SpecialBuild", "\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // !_MAC
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
42
oversampling/WDL/localize/langpack_edit/resource.h
Normal file
42
oversampling/WDL/localize/langpack_edit/resource.h
Normal file
@@ -0,0 +1,42 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by res.rc
|
||||
//
|
||||
#define IDI_ICON1 101
|
||||
#define IDD_DIALOG1 102
|
||||
#define IDD_RENAME 103
|
||||
#define IDR_MENU1 103
|
||||
#define IDR_CONTEXTMENU 104
|
||||
#define IDC_LIST 1000
|
||||
#define IDC_FILTER 1001
|
||||
#define IDC_FILTERLBL 1002
|
||||
#define IDC_TEMPLATE 1003
|
||||
#define IDC_TEMPLATE_LOAD 1004
|
||||
#define IDC_TEMPLATE_LABEL 1005
|
||||
#define IDC_PACK 1006
|
||||
#define IDC_PACK_LOAD 1007
|
||||
#define IDC_PACK_LABEL 1008
|
||||
#define IDC_COMMENTS 1009
|
||||
#define IDC_COMMENTS_LABEL 1010
|
||||
#define IDC_PACK_SAVE 1011
|
||||
#define IDC_PACK_SAVE_AS 1012
|
||||
#define IDC_LOCALIZED_STRING 1013
|
||||
#define IDC_TEMPLATE_STRING 1014
|
||||
#define IDC_COMMON_STRING 1015
|
||||
#define IDC_COMMON_LABEL 1016
|
||||
#define IDC_REMOVE_LOCALIZATION 1017
|
||||
#define IDC_COPY_TEMPLATE 1018
|
||||
#define ID_SCALING_ADD 1019
|
||||
#define IDC_REMOVE_NONLOCALIZATION 1020
|
||||
#define ID_QUIT 40000
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 104
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1021
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
83
oversampling/WDL/localize/localize-import.h
Normal file
83
oversampling/WDL/localize/localize-import.h
Normal file
@@ -0,0 +1,83 @@
|
||||
// used by plug-ins to access imported localization
|
||||
// usage, in one file:
|
||||
// #define LOCALIZE_IMPORT_PREFIX "midi_" (should be the directory name with _)
|
||||
// #include "localize-import.h"
|
||||
// #include "localize.h"
|
||||
// import function pointers in initialization
|
||||
//
|
||||
// other files can simply import localize.h as normal
|
||||
// note that if the module might be unloaded, LOCALIZE_FLAG_NOCACHE is essential!
|
||||
//
|
||||
|
||||
#ifdef _WDL_LOCALIZE_H_
|
||||
#error you must include localize-import.h before localize.h, sorry
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include "../wdltypes.h"
|
||||
|
||||
// caller must import these 4 function pointers from the running app
|
||||
static const char *(*importedLocalizeFunc)(const char *str, const char *subctx, int flags);
|
||||
static void (*importedLocalizeMenu)(const char *rescat, HMENU hMenu, LPCSTR lpMenuName);
|
||||
static DLGPROC (*importedLocalizePrepareDialog)(const char *rescat, HINSTANCE hInstance, const char *lpTemplate, DLGPROC dlgProc, LPARAM lPAram, void **ptrs, int nptrs);
|
||||
static void (*importedLocalizeInitializeDialog)(HWND hwnd, const char *d);
|
||||
|
||||
const char *__localizeFunc(const char *str, const char *subctx, int flags)
|
||||
{
|
||||
if (WDL_NORMALLY(importedLocalizeFunc)) return importedLocalizeFunc(str,subctx,flags);
|
||||
return str;
|
||||
}
|
||||
|
||||
HMENU __localizeLoadMenu(HINSTANCE hInstance, const char *lpMenuName)
|
||||
{
|
||||
HMENU menu = LoadMenu(hInstance,lpMenuName);
|
||||
if (menu && WDL_NORMALLY(importedLocalizeMenu)) importedLocalizeMenu(LOCALIZE_IMPORT_PREFIX,menu,lpMenuName);
|
||||
return menu;
|
||||
}
|
||||
|
||||
HWND __localizeDialog(HINSTANCE hInstance, const char *lpTemplate, HWND hwndParent, DLGPROC dlgProc, LPARAM lParam, int mode)
|
||||
{
|
||||
void *p[5];
|
||||
char tmp[256];
|
||||
if (mode == 1)
|
||||
{
|
||||
sprintf(tmp,"%.100s%d",LOCALIZE_IMPORT_PREFIX,(int)(INT_PTR)lpTemplate);
|
||||
p[4] = tmp;
|
||||
}
|
||||
else
|
||||
p[4] = NULL;
|
||||
|
||||
if (WDL_NORMALLY(importedLocalizePrepareDialog))
|
||||
{
|
||||
DLGPROC newDlg = importedLocalizePrepareDialog(LOCALIZE_IMPORT_PREFIX,hInstance,lpTemplate,dlgProc,lParam,p,sizeof(p)/sizeof(p[0]));
|
||||
if (newDlg)
|
||||
{
|
||||
dlgProc = newDlg;
|
||||
lParam = (LPARAM)(INT_PTR)p;
|
||||
}
|
||||
}
|
||||
switch (mode)
|
||||
{
|
||||
case 0: return CreateDialogParam(hInstance,lpTemplate,hwndParent,dlgProc,lParam);
|
||||
case 1: return (HWND) (INT_PTR)DialogBoxParam(hInstance,lpTemplate,hwndParent,dlgProc,lParam);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void __localizeInitializeDialog(HWND hwnd, const char *d)
|
||||
{
|
||||
if (WDL_NORMALLY(importedLocalizeInitializeDialog)) importedLocalizeInitializeDialog(hwnd,d);
|
||||
}
|
||||
|
||||
static WDL_STATICFUNC_UNUSED void localizeKbdSection(KbdSectionInfo *sec, const char *nm)
|
||||
{
|
||||
if (WDL_NORMALLY(importedLocalizeFunc))
|
||||
{
|
||||
int x;
|
||||
if (sec->action_list) for (x=0;x<sec->action_list_cnt; x++)
|
||||
{
|
||||
KbdCmd *p = &sec->action_list[x];
|
||||
if (p->text) p->text = __localizeFunc(p->text,nm,2/*LOCALIZE_FLAG_NOCACHE*/);
|
||||
}
|
||||
}
|
||||
}
|
||||
83
oversampling/WDL/localize/localize-info.txt
Normal file
83
oversampling/WDL/localize/localize-info.txt
Normal file
@@ -0,0 +1,83 @@
|
||||
WDL Localization System
|
||||
===============================================================================
|
||||
|
||||
This is a tool for localizing C++ applications. It supports Windows and SWELL-based
|
||||
GUI applications, or command line only.
|
||||
|
||||
|
||||
1. In your code
|
||||
==========================
|
||||
The main thing to do is include localize.h from most of your code, and add
|
||||
localize.cpp to the project (you may want to include it from a wrapper file
|
||||
in order to hook certain functions).
|
||||
|
||||
At startup your application should call:
|
||||
|
||||
WDL_LoadLanguagePack("/path/to/filename.langpack",NULL);
|
||||
|
||||
When your code has a string that is to be localizable, you do it via this
|
||||
macro:
|
||||
|
||||
__LOCALIZE("my string","section");
|
||||
|
||||
Note that both parameters to the macro MUST be literal strings, and be one block
|
||||
of string (i.e. not using concatenation, i.e. "part1" "part2" etc).
|
||||
|
||||
If you are calling from code that could possibly be in a thread other than the
|
||||
main thread, or from a module that could be unloaded, use:
|
||||
|
||||
__LOCALIZE_NOCACHE("my string","section");
|
||||
|
||||
If you would like to have a format specifier in the string, you can use:
|
||||
|
||||
snprintf(buf,sizeof(buf),__LOCALIZE_VERFMT("This has %d items","section"),6);
|
||||
|
||||
The value returned by __LOCALIZE/etc is effectively a const char *, and will
|
||||
persist, so it is safe to pass whereever and use again. If you are really
|
||||
performance sensitive, you might want to do:
|
||||
|
||||
static const char *msg;
|
||||
if (!msg) msg = __LOCALIZE_NOCACHE("whatever","section");
|
||||
|
||||
This will do the lookup once, and cache the result.
|
||||
|
||||
If you have strings which are present in a table such as:
|
||||
struct foo bar[]={
|
||||
{x,y,z,"string 1"},
|
||||
{x,y,z,"string 2"},
|
||||
{x,y,z,"string 3"},
|
||||
};
|
||||
|
||||
The best way to handle this is to put comments around the string table, such as:
|
||||
// !WANT_LOCALIZE_STRINGS_BEGIN:section_name
|
||||
struct foo bar[]={
|
||||
{x,y,z,"string 1"},
|
||||
{x,y,z,"string 2"},
|
||||
{x,y,z,"string 3"},
|
||||
};
|
||||
// !WANT_LOCALIZE_STRINGS_END
|
||||
|
||||
Or if other strings exist in that table that are not localized, you can use __LOCALIZE_REG_ONLY().
|
||||
|
||||
Then, supposing you reference these strings via bar[x].stringptr, you would use:
|
||||
__localizeFunc(bar[x].stringptr,flags)
|
||||
(where flags can be 0, or LOCALIZE_FLAG_VERIFY_FMTS or
|
||||
LOCALIZE_FLAG_NOCACHE or some combination of those, see localize.h)
|
||||
|
||||
There currently a limit of around 8k for localized strings -- if you are
|
||||
localizing a huge block of text, it might be good to divide it up into
|
||||
separate strings.
|
||||
|
||||
Finally, for resources, the menus and dialogs are localized automatically via a
|
||||
wrapper function and some #defines, which are in localize.h
|
||||
|
||||
Dynamic libraries loaded can access the system by using localize-import.h (see comments in that file)
|
||||
|
||||
2. Generating the language pack template
|
||||
==========================
|
||||
|
||||
To generate a template language pack, compile build_sample_langpack.cpp:
|
||||
g++ -O -o build_sample_langpack build_sample_langpack.cpp
|
||||
|
||||
Then use:
|
||||
build_sample_langpack --template *.rc *.cpp > template.langpack
|
||||
1205
oversampling/WDL/localize/localize.cpp
Normal file
1205
oversampling/WDL/localize/localize.cpp
Normal file
File diff suppressed because it is too large
Load Diff
95
oversampling/WDL/localize/localize.h
Normal file
95
oversampling/WDL/localize/localize.h
Normal file
@@ -0,0 +1,95 @@
|
||||
#ifndef _WDL_LOCALIZE_H_
|
||||
#define _WDL_LOCALIZE_H_
|
||||
|
||||
#include "../assocarray.h"
|
||||
|
||||
// normally onlySec_name is NULL and returns NULL (and updates global state)
|
||||
// if onlySec_name is set, only loads/returns section in question and does not update global state.
|
||||
WDL_AssocArray<WDL_UINT64, char *> *WDL_LoadLanguagePack(const char *buf, const char *onlySec_name);
|
||||
|
||||
WDL_AssocArray<WDL_UINT64, char *> *WDL_LoadLanguagePackInternal(const char *buf,
|
||||
WDL_StringKeyedArray< WDL_AssocArray<WDL_UINT64, char *> * > *dest,
|
||||
const char *onlySec_name, // if set, will not touch dest
|
||||
bool include_commented_lines,
|
||||
bool no_escape_strings,
|
||||
WDL_StringKeyedArray<char *> *extra_metadata
|
||||
);
|
||||
|
||||
WDL_AssocArray<WDL_UINT64, char *> *WDL_GetLangpackSection(const char *sec);
|
||||
|
||||
void WDL_SetLangpackFallbackEntry(const char *src_sec, WDL_UINT64 src_v, const char *dest_sec, WDL_UINT64 dest_v);
|
||||
|
||||
#define LOCALIZE_FLAG_VERIFY_FMTS 1 // verifies translated format-string (%d should match %d, etc)
|
||||
#define LOCALIZE_FLAG_NOCACHE 2 // must use this if the string passed is not a persistent static string, or if in another thread
|
||||
#define LOCALIZE_FLAG_PAIR 4 // one \0 in string needed -- this is not doublenull terminated but just a special case
|
||||
#define LOCALIZE_FLAG_DOUBLENULL 8 // doublenull terminated string
|
||||
|
||||
|
||||
#ifdef LOCALIZE_DISABLE
|
||||
#define __LOCALIZE(str, ctx) str
|
||||
#define __LOCALIZE_2N(str,ctx) str
|
||||
#define __LOCALIZE_VERFMT(str, ctx) str
|
||||
#define __LOCALIZE_NOCACHE(str, ctx) str
|
||||
#define __LOCALIZE_VERFMT_NOCACHE(str, ctx) str
|
||||
#define __LOCALIZE_LCACHE(str, ctx, pp) const char *pp = str
|
||||
#define __LOCALIZE_VERFMT_LCACHE(str, ctx, pp) const char *pp = str
|
||||
#define LOCALIZE_GET_SCALE_STRING(ctx) ("")
|
||||
#else
|
||||
#define __LOCALIZE(str, ctx) __localizeFunc("" str "" , "" ctx "",0)
|
||||
#define __LOCALIZE_2N(str,ctx) __localizeFunc("" str "" , "" ctx "",LOCALIZE_FLAG_PAIR)
|
||||
#define __LOCALIZE_VERFMT(str, ctx) __localizeFunc("" str "", "" ctx "",LOCALIZE_FLAG_VERIFY_FMTS)
|
||||
#define __LOCALIZE_NOCACHE(str, ctx) __localizeFunc("" str "", "" ctx "",LOCALIZE_FLAG_NOCACHE)
|
||||
#define __LOCALIZE_VERFMT_NOCACHE(str, ctx) __localizeFunc("" str "", "" ctx "",LOCALIZE_FLAG_VERIFY_FMTS|LOCALIZE_FLAG_NOCACHE)
|
||||
#define __LOCALIZE_LCACHE(str, ctx, pp) static const char *pp; if (!pp) pp = __localizeFunc("" str "", "" ctx "",LOCALIZE_FLAG_NOCACHE)
|
||||
#define __LOCALIZE_VERFMT_LCACHE(str, ctx, pp) static const char *pp; if (!pp) pp = __localizeFunc("" str "", "" ctx "",LOCALIZE_FLAG_VERIFY_FMTS|LOCALIZE_FLAG_NOCACHE)
|
||||
#define LOCALIZE_GET_SCALE_STRING(ctx) __localizeFunc("__LOCALIZE_SCALE\0",ctx,LOCALIZE_FLAG_PAIR|LOCALIZE_FLAG_NOCACHE)
|
||||
#endif
|
||||
|
||||
#define __LOCALIZE_REG_ONLY(str, ctx) str
|
||||
|
||||
|
||||
// localize a string
|
||||
const char *__localizeFunc(const char *str, const char *subctx, int flags);
|
||||
|
||||
// localize a menu; rescat can be NULL, or a prefix
|
||||
void __localizeMenu(const char *rescat, HMENU hMenu, LPCSTR lpMenuName);
|
||||
|
||||
void __localizeInitializeDialog(HWND hwnd, const char *desc); // only use for certain child windows that we can't control creation of, pass desc of DLG_xyz etc
|
||||
|
||||
// localize a dialog; rescat can be NULL, or a prefix
|
||||
// if returns non-NULL, use retval as dlgproc and pass ptrs as LPARAM to dialogboxparam
|
||||
// nptrs should be at least 4 (might increase someday, but this will only ever be used by utilfunc.cpp or localize-import.h)
|
||||
DLGPROC __localizePrepareDialog(const char *rescat, HINSTANCE hInstance, const char *lpTemplate, DLGPROC dlgProc, LPARAM lParam, void **ptrs, int nptrs);
|
||||
|
||||
|
||||
#ifndef LOCALIZE_NO_DIALOG_MENU_REDEF
|
||||
#undef DialogBox
|
||||
#undef CreateDialog
|
||||
#undef DialogBoxParam
|
||||
#undef CreateDialogParam
|
||||
|
||||
#ifdef _WIN32
|
||||
#define DialogBoxParam(a,b,c,d,e) ((INT_PTR)__localizeDialog(a,b,c,d,e,1))
|
||||
#define CreateDialogParam(a,b,c,d,e) __localizeDialog(a,b,c,d,e,0)
|
||||
#else
|
||||
#define DialogBoxParam(a,b,c,d,e) ((INT_PTR)__localizeDialog(NULL,b,c,d,e,1))
|
||||
#define CreateDialogParam(a,b,c,d,e) __localizeDialog(NULL,b,c,d,e,0)
|
||||
#endif
|
||||
|
||||
#define DialogBox(hinst,lpt,hwndp,dlgproc) DialogBoxParam(hinst,lpt,hwndp,dlgproc,0)
|
||||
#define CreateDialog(hinst,lpt,hwndp,dlgproc) CreateDialogParam(hinst,lpt,hwndp,dlgproc,0)
|
||||
|
||||
|
||||
#undef LoadMenu
|
||||
#define LoadMenu __localizeLoadMenu
|
||||
#endif
|
||||
|
||||
HMENU __localizeLoadMenu(HINSTANCE hInstance, const char *lpMenuName);
|
||||
HWND __localizeDialog(HINSTANCE hInstance, const char * lpTemplate, HWND hwndParent, DLGPROC dlgProc, LPARAM lParam, int mode);
|
||||
|
||||
#define __localizeDialogBoxParam(a,b,c,d,e) ((INT_PTR)__localizeDialog(a,b,c,d,e,1))
|
||||
#define __localizeCreateDialogParam(a,b,c,d,e) __localizeDialog(a,b,c,d,e,0)
|
||||
|
||||
extern void (*localizePreInitDialogHook)(HWND hwndDlg);
|
||||
|
||||
#endif
|
||||
432
oversampling/WDL/localize/merge_langpacks.cpp
Normal file
432
oversampling/WDL/localize/merge_langpacks.cpp
Normal file
@@ -0,0 +1,432 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#ifndef _WIN32
|
||||
#define stricmp strcasecmp
|
||||
#include <ctype.h>
|
||||
#endif
|
||||
|
||||
#include "../assocarray.h"
|
||||
#include "../wdlstring.h"
|
||||
#include "../ptrlist.h"
|
||||
#include "../wdlcstring.h"
|
||||
|
||||
|
||||
|
||||
|
||||
// call at start of file with format_flag=-1
|
||||
// expect possible blank (\r or \n) lines, too, ignore them
|
||||
static void fgets_as_utf8(char *linebuf, int linebuf_size, FILE *fp, int *format_flag)
|
||||
{
|
||||
// format flag: 0=utf8, 1=utf16le, 2=utf16be, 3=ansi
|
||||
linebuf[0]=0;
|
||||
if (*format_flag>0)
|
||||
{
|
||||
int sz=0;
|
||||
while (sz < linebuf_size-8)
|
||||
{
|
||||
int a = fgetc(fp);
|
||||
int b = *format_flag==3 ? 0 : fgetc(fp);
|
||||
if (a<0 || b<0) break;
|
||||
if (*format_flag==2) a = (a<<8)+b;
|
||||
else a += b<<8;
|
||||
|
||||
|
||||
again:
|
||||
if (a >= 0xD800 && a < 0xDC00) // UTF-16 supplementary planes
|
||||
{
|
||||
int aa = fgetc(fp);
|
||||
int bb = fgetc(fp);
|
||||
if (aa < 0 || bb < 0) break;
|
||||
|
||||
if (*format_flag==2) aa = (aa<<8)+bb;
|
||||
else aa += bb<<8;
|
||||
|
||||
if (aa >= 0xDC00 && aa < 0xE000)
|
||||
{
|
||||
a = 0x10000 + ((a&0x3FF)<<10) + (aa&0x3FF);
|
||||
}
|
||||
else
|
||||
{
|
||||
a=aa;
|
||||
goto again;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (a < 0x80) linebuf[sz++] = a;
|
||||
else
|
||||
{
|
||||
if (a<0x800) // 11 bits (5+6 bits)
|
||||
{
|
||||
linebuf[sz++] = 0xC0 + ((a>>6)&31);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (a < 0x10000) // 16 bits (4+6+6 bits)
|
||||
{
|
||||
linebuf[sz++] = 0xE0 + ((a>>12)&15); // 4 bits
|
||||
}
|
||||
else // 21 bits yow
|
||||
{
|
||||
linebuf[sz++] = 0xF0 + ((a>>18)&7); // 3 bits
|
||||
linebuf[sz++] = 0x80 + ((a>>12)&63); // 6 bits
|
||||
}
|
||||
linebuf[sz++] = 0x80 + ((a>>6)&63); // 6 bits
|
||||
}
|
||||
linebuf[sz++] = 0x80 + (a&63); // 6 bits
|
||||
}
|
||||
|
||||
if (a == '\n') break;
|
||||
}
|
||||
linebuf[sz]=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
fgets(linebuf,linebuf_size,fp);
|
||||
}
|
||||
|
||||
if (linebuf[0] && *format_flag<0)
|
||||
{
|
||||
unsigned char *p=(unsigned char *)linebuf;
|
||||
if (p[0] == 0xEF && p[1] == 0xBB && p[2] == 0xBf)
|
||||
{
|
||||
*format_flag=0;
|
||||
memmove(linebuf,linebuf+3,strlen(linebuf+3)+1); // skip UTF-8 BOM
|
||||
}
|
||||
else if ((p[0] == 0xFF && p[1] == 0xFE) || (p[0] == 0xFE && p[1] == 0xFF))
|
||||
{
|
||||
fseek(fp,2,SEEK_SET);
|
||||
*format_flag=p[0] == 0xFE ? 2 : 1;
|
||||
fgets_as_utf8(linebuf,linebuf_size,fp,format_flag);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
const unsigned char *str=(unsigned char *)linebuf;
|
||||
while (*str)
|
||||
{
|
||||
unsigned char c = *str++;
|
||||
if (c >= 0xC0)
|
||||
{
|
||||
if (c <= 0xDF && str[0] >=0x80 && str[0] <= 0xBF) str++;
|
||||
else if (c <= 0xEF && str[0] >=0x80 && str[0] <= 0xBF && str[1] >=0x80 && str[1] <= 0xBF) str+=2;
|
||||
else if (c <= 0xF7 &&
|
||||
str[0] >=0x80 && str[0] <= 0xBF &&
|
||||
str[1] >=0x80 && str[1] <= 0xBF &&
|
||||
str[2] >=0x80 && str[2] <= 0xBF) str+=3;
|
||||
else break;
|
||||
}
|
||||
else if (c >= 128) break;
|
||||
}
|
||||
if (*str) break;
|
||||
|
||||
linebuf[0]=0;
|
||||
fgets(linebuf,linebuf_size,fp);
|
||||
if (!linebuf[0]) break;
|
||||
}
|
||||
*format_flag = linebuf[0] ? 3 : 0; // if scanned the whole file without an invalid UTF8 pair, then UTF-8 (0), otherwise ansi (3)
|
||||
fseek(fp,0,SEEK_SET);
|
||||
fgets_as_utf8(linebuf,linebuf_size,fp,format_flag);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool read_ini(const char *fn, WDL_StringKeyedArray< WDL_StringKeyedArray<char *> * > *sections, WDL_String *mod_name, int options)
|
||||
{
|
||||
FILE *fp = fopen(fn,"r");
|
||||
if (!fp) return false;
|
||||
|
||||
WDL_StringKeyedArray<char *> *cursec=NULL;
|
||||
|
||||
bool warn=false;
|
||||
int char_fmt=-1;
|
||||
char linebuf[16384];
|
||||
int linecnt=0;
|
||||
for (;;)
|
||||
{
|
||||
linebuf[0]=0;
|
||||
fgets_as_utf8(linebuf,sizeof(linebuf),fp,&char_fmt);
|
||||
if (!linebuf[0]) break;
|
||||
if (char_fmt==3 && !warn)
|
||||
{
|
||||
fprintf(stderr,"Warning: '%s' was not saved with UTF-8 or UTF-16 encoding, the merged Langpack might contain garbled characters.\n", fn);
|
||||
warn=true;
|
||||
}
|
||||
|
||||
char *p=linebuf;
|
||||
while (*p == ' ' || *p == '\t' || *p == '\n' || *p == '\r') p++;
|
||||
char *lbstart = p;
|
||||
while (*p) p++;
|
||||
p--;
|
||||
while (p >= lbstart)
|
||||
{
|
||||
if (options&1) { if (*p == '\n' || *p == '\r') p--; else break; }
|
||||
else { if (*p == ' ' || *p == '\t' || *p == '\n' || *p == '\r') p--; else break; }
|
||||
}
|
||||
p++;
|
||||
*p=0;
|
||||
|
||||
if (!linecnt && !strncmp(lbstart,"#NAME:",6))
|
||||
{
|
||||
mod_name->Set(lbstart+6);
|
||||
}
|
||||
|
||||
linecnt++;
|
||||
|
||||
if (!*lbstart || *lbstart == '#') continue;
|
||||
|
||||
if (*lbstart == '[')
|
||||
{
|
||||
if (cursec) cursec->Resort();
|
||||
|
||||
lbstart++;
|
||||
{
|
||||
char *tmp = lbstart;
|
||||
while (*tmp && *tmp != ']') tmp++;
|
||||
*tmp=0;
|
||||
}
|
||||
|
||||
cursec = sections->Get(lbstart);
|
||||
if (!cursec)
|
||||
{
|
||||
cursec = new WDL_StringKeyedArray<char *>(false,WDL_StringKeyedArray<char *>::freecharptr);
|
||||
sections->Insert(lbstart,cursec);
|
||||
}
|
||||
}
|
||||
else if (cursec)
|
||||
{
|
||||
char *eq = strstr(lbstart,"=");
|
||||
if (eq)
|
||||
{
|
||||
*eq++ = 0;
|
||||
cursec->AddUnsorted(lbstart,strdup(eq));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (cursec)
|
||||
cursec->Resort();
|
||||
|
||||
fclose(fp);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
char *GotKey(WDL_StringKeyedArray<char *> *cursec_modptr, WDL_StringKeyedArray<bool> *cursec_hadvals, char *key) // key[19], can be mangled
|
||||
{
|
||||
char *match=NULL;
|
||||
if (cursec_modptr)
|
||||
{
|
||||
int start_idx=2;
|
||||
match = cursec_modptr->Get(key+start_idx);
|
||||
if (!match)
|
||||
{
|
||||
start_idx=1;
|
||||
key[1]=';';
|
||||
match = cursec_modptr->Get(key+start_idx);
|
||||
}
|
||||
if (!match)
|
||||
{
|
||||
start_idx=0;
|
||||
key[0]=';';
|
||||
key[1]='^';
|
||||
match = cursec_modptr->Get(key+start_idx);
|
||||
}
|
||||
if (match)
|
||||
{
|
||||
printf("%s=%s\n",key+start_idx,match);
|
||||
cursec_hadvals->Insert(key+2,true);
|
||||
}
|
||||
}
|
||||
return match;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
int options = 0;
|
||||
for (i=3; i<argc; i++)
|
||||
{
|
||||
if (!strcmp(argv[i],"-p")) options|=1;
|
||||
else if (!strcmp(argv[i],"-c")) options|=2;
|
||||
else { options=0; break; }
|
||||
}
|
||||
if (argc<3 || (argc>3 && !options))
|
||||
{
|
||||
fprintf(stderr,"Usage: merge_langpacks new_template.txt my_language.txt [options] > new_language.txt\n");
|
||||
fprintf(stderr,"Options:\n");
|
||||
fprintf(stderr," -p: preserve trailing spaces/tabs\n");
|
||||
fprintf(stderr," -c: comment obsolete sections/strings\n");
|
||||
return 1;
|
||||
}
|
||||
FILE *reffp = fopen(argv[1],"r");
|
||||
if (!reffp)
|
||||
{
|
||||
fprintf(stderr,"Error reading '%s', invalid template langpack.\n",argv[1]);
|
||||
return 1;
|
||||
}
|
||||
WDL_StringKeyedArray<WDL_StringKeyedArray<char *> * > mods;
|
||||
WDL_String mod_name;
|
||||
if (!read_ini(argv[2],&mods,&mod_name,options)||!mods.GetSize())
|
||||
{
|
||||
fprintf(stderr,"Error reading '%s', invalid langpack.\n",argv[2]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int char_fmt=-1;
|
||||
|
||||
//printf("%c%c%c",0xEF,0xBB,0xBF); // UTF-8 BOM
|
||||
WDL_String cursec;
|
||||
WDL_StringKeyedArray<char *> *cursec_modptr=NULL;
|
||||
WDL_StringKeyedArray<bool> cursec_hadvals(false);
|
||||
WDL_PtrList<char> cursec_added;
|
||||
|
||||
bool warn=false;
|
||||
char key[2+16+1];
|
||||
int line_count=0;
|
||||
for (;;)
|
||||
{
|
||||
char buf[16384];
|
||||
buf[0]=0;
|
||||
fgets_as_utf8(buf,sizeof(buf),reffp,&char_fmt);
|
||||
if (char_fmt==3 && !warn)
|
||||
{
|
||||
fprintf(stderr,"Warning: '%s' was not saved with UTF-8 or UTF-16 encoding, the merged Langpack might contain garbled characters.\n", argv[1]);
|
||||
warn=true;
|
||||
}
|
||||
|
||||
bool wasZ = !buf[0];
|
||||
|
||||
// remove any trailing newlines
|
||||
char *p=buf;
|
||||
while (*p) p++;
|
||||
while (p>buf && (p[-1] == '\r'||p[-1] == '\n')) p--;
|
||||
*p=0;
|
||||
|
||||
// skip any leading space
|
||||
p=buf;
|
||||
while (*p == ' ' || *p == '\t' || *p == '\n' || *p == '\r') p++;
|
||||
|
||||
line_count++;
|
||||
if (line_count==1 && mod_name.Get()[0])
|
||||
{
|
||||
printf("#NAME:%s\n",mod_name.Get());
|
||||
if (!strncmp(p,"#NAME:",6)) continue; // ignore template #NAME: line, use modded
|
||||
}
|
||||
|
||||
char *np;
|
||||
if (wasZ || (p[0] == '[' && (np = strstr(p,"]")) && np > p+1))
|
||||
{
|
||||
if (cursec.Get()[0])
|
||||
{
|
||||
// finish current section
|
||||
if (cursec_added.GetSize())
|
||||
{
|
||||
printf("######## added in template (section: %s):\n",cursec.Get());
|
||||
int x;
|
||||
for(x=0;x<cursec_added.GetSize();x++)
|
||||
{
|
||||
printf("%s\n",cursec_added.Get(x));
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
if (cursec_modptr)
|
||||
{
|
||||
// print any non-comment lines in section that were not in template
|
||||
int x;
|
||||
int oc=0;
|
||||
for (x=0;x<cursec_modptr->GetSize();x++)
|
||||
{
|
||||
const char *nm=NULL;
|
||||
const char *val= cursec_modptr->Enumerate(x,&nm);
|
||||
if (!nm || !val) break;
|
||||
|
||||
if (nm[0] == ';') continue;
|
||||
|
||||
if (!cursec_hadvals.Get(nm))
|
||||
{
|
||||
if (!oc++) printf("######## not in template, possibly obsolete (section: %s):\n",cursec.Get());
|
||||
printf("%s%s=%s\n", (options&2) ? ";" : "", nm, val);
|
||||
}
|
||||
}
|
||||
if (oc) printf("\n");
|
||||
|
||||
}
|
||||
|
||||
mods.Delete(cursec.Get());
|
||||
cursec_hadvals.DeleteAll();
|
||||
cursec_added.Empty(true,free);
|
||||
cursec_modptr=NULL;
|
||||
}
|
||||
|
||||
if (wasZ) break;
|
||||
|
||||
printf("%s\n",buf);
|
||||
cursec.Set(p+1, (int)(np-p-1));
|
||||
cursec_modptr = mods.Get(cursec.Get());
|
||||
|
||||
// if any, preserve the scaling at the top of the section
|
||||
strcpy(key+2,"5CA1E00000000000");
|
||||
GotKey(cursec_modptr, &cursec_hadvals, key);
|
||||
// done, scaling lines are added by hand (not part of templates)
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (!cursec.Get()[0]) printf("%s\n",buf);
|
||||
else
|
||||
{
|
||||
char *eq = strstr(p,"=");
|
||||
if (!eq) printf("%s\n",buf);
|
||||
else
|
||||
{
|
||||
if (p[0] == ';' && *++p == '^') p++;
|
||||
if (eq-p==16)
|
||||
{
|
||||
lstrcpyn_safe(key+2, p, 17);
|
||||
if (!GotKey(cursec_modptr, &cursec_hadvals, key))
|
||||
{
|
||||
cursec_added.Add(strdup(buf));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("%s\n",buf);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fclose(reffp);
|
||||
|
||||
int x;
|
||||
for (x=0;x<mods.GetSize();x++)
|
||||
{
|
||||
const char *secname=NULL;
|
||||
cursec_modptr = mods.Enumerate(x,&secname);
|
||||
if (!cursec_modptr || !secname) break;
|
||||
printf("\n[%s]\n",secname);
|
||||
printf("######## possibly obsolete section!\n");
|
||||
int y;
|
||||
for (y=0;y<cursec_modptr->GetSize();y++)
|
||||
{
|
||||
const char *nm=NULL;
|
||||
const char *v=cursec_modptr->Enumerate(y,&nm);
|
||||
if (!nm || !v) break;
|
||||
printf("%s%s=%s\n", (options&2) && nm[0]!=';' ? ";" : "", nm, v);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user