350.4
svn: r3629
This commit is contained in:
parent
673866d972
commit
6f29e3f0c0
|
@ -220,7 +220,7 @@ int FindReady(MrEdContext *c, MSG *msg, int remove, MrEdContext **c_return)
|
||||||
MSG pmsg;
|
MSG pmsg;
|
||||||
while (PeekMessage(&pmsg, NULL, 0x4000, 0xFFFF, PM_REMOVE)) {
|
while (PeekMessage(&pmsg, NULL, 0x4000, 0xFFFF, PM_REMOVE)) {
|
||||||
found_nothing = 0;
|
found_nothing = 0;
|
||||||
TranslateMessage(&pmsg);
|
wxTranslateMessage(&pmsg);
|
||||||
DispatchMessage(&pmsg);
|
DispatchMessage(&pmsg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -314,7 +314,7 @@ void MrEdDispatchEvent(MSG *msg)
|
||||||
fflush(log);
|
fflush(log);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TranslateMessage(msg);
|
wxTranslateMessage(msg);
|
||||||
|
|
||||||
can_trampoline_win = msg->hwnd;
|
can_trampoline_win = msg->hwnd;
|
||||||
last_msg_time = msg->time;
|
last_msg_time = msg->time;
|
||||||
|
|
|
@ -702,3 +702,23 @@ wxWindow *wxLocationToWindow(int x, int y)
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int wxLocaleStringToChar(char *str, int slen)
|
||||||
|
{
|
||||||
|
Scheme_Object *s;
|
||||||
|
s = scheme_make_locale_string(str);
|
||||||
|
if (SCHEME_CHAR_STRLEN_VAL(s))
|
||||||
|
return SCHEME_CHAR_STR_VAL(s)[0];
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int wxUTF8StringToChar(char *str, int slen)
|
||||||
|
{
|
||||||
|
mzchar s[1];
|
||||||
|
s[0] = 0;
|
||||||
|
scheme_utf8_decode((unsigned char *)str, 0, slen,
|
||||||
|
s, 0, 1,
|
||||||
|
NULL, 0, '?');
|
||||||
|
return (int)s[0];
|
||||||
|
}
|
||||||
|
|
|
@ -63,6 +63,8 @@ class wxKeycode
|
||||||
TF_Flag( metaOn );
|
TF_Flag( metaOn );
|
||||||
TF_Flag( metaOff );
|
TF_Flag( metaOff );
|
||||||
|
|
||||||
|
TF_Flag( checkOther );
|
||||||
|
|
||||||
TF_Flag( fullset );
|
TF_Flag( fullset );
|
||||||
#undef TF_Flag
|
#undef TF_Flag
|
||||||
|
|
||||||
|
@ -164,7 +166,7 @@ void wxKeymap::SetBreakSequenceCallback(wxBreakSequenceFunction f,
|
||||||
fold(dataold);
|
fold(dataold);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxKeycode *wxKeymap::FindKey(long code,
|
wxKeycode *wxKeymap::FindKey(long code, long other_code,
|
||||||
Bool shift, Bool ctrl,
|
Bool shift, Bool ctrl,
|
||||||
Bool alt, Bool meta,
|
Bool alt, Bool meta,
|
||||||
wxKeycode *prefix)
|
wxKeycode *prefix)
|
||||||
|
@ -172,13 +174,17 @@ wxKeycode *wxKeymap::FindKey(long code,
|
||||||
wxKeycode *key;
|
wxKeycode *key;
|
||||||
wxKeycode *bestKey = NULL;
|
wxKeycode *bestKey = NULL;
|
||||||
int bestScore = -1;
|
int bestScore = -1;
|
||||||
|
int iter;
|
||||||
|
|
||||||
if (!keys)
|
if (!keys)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
key = (wxKeycode *)keys->Get(code);
|
for (iter = 0; iter < 2; iter++) {
|
||||||
|
key = (wxKeycode *)keys->Get(iter ? other_code : code);
|
||||||
while (key) {
|
while (key) {
|
||||||
if (key->code == code
|
if (((key->code == code)
|
||||||
|
|| (key->checkOther
|
||||||
|
&& (key->code == other_code)))
|
||||||
&& ((key->shiftOn && shift)
|
&& ((key->shiftOn && shift)
|
||||||
|| (key->shiftOff && !shift)
|
|| (key->shiftOff && !shift)
|
||||||
|| (!key->shiftOn && !key->shiftOff))
|
|| (!key->shiftOn && !key->shiftOff))
|
||||||
|
@ -200,6 +206,7 @@ wxKeycode *wxKeymap::FindKey(long code,
|
||||||
}
|
}
|
||||||
key = key->next;
|
key = key->next;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return bestKey;
|
return bestKey;
|
||||||
}
|
}
|
||||||
|
@ -288,7 +295,7 @@ static Keybind keylist[]
|
||||||
{ NULL, 0 }};
|
{ NULL, 0 }};
|
||||||
|
|
||||||
wxKeycode *wxKeymap::MapFunction(long code, int shift, int ctrl,
|
wxKeycode *wxKeymap::MapFunction(long code, int shift, int ctrl,
|
||||||
int alt, int meta,
|
int alt, int meta, int checkOther,
|
||||||
char *fname, wxKeycode *prev, int type)
|
char *fname, wxKeycode *prev, int type)
|
||||||
{
|
{
|
||||||
wxKeycode *key, *newkey;
|
wxKeycode *key, *newkey;
|
||||||
|
@ -305,6 +312,7 @@ wxKeycode *wxKeymap::MapFunction(long code, int shift, int ctrl,
|
||||||
&& (key->altOff == (alt < 0))
|
&& (key->altOff == (alt < 0))
|
||||||
&& (key->metaOn == (meta > 0))
|
&& (key->metaOn == (meta > 0))
|
||||||
&& (key->metaOff == (meta < 0))
|
&& (key->metaOff == (meta < 0))
|
||||||
|
&& (key->checkOther == (checkOther ? 1 : 0))
|
||||||
&& key->seqprefix == prev)
|
&& key->seqprefix == prev)
|
||||||
break;
|
break;
|
||||||
key = key->next;
|
key = key->next;
|
||||||
|
@ -342,9 +350,9 @@ wxKeycode *wxKeymap::MapFunction(long code, int shift, int ctrl,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (keystr)
|
if (keystr)
|
||||||
sprintf(buffer, "keymap: \"%s%s\" ", modbuf, keystr);
|
sprintf(buffer, "keymap: \"%s%s%s\" ", modbuf, checkOther ? "?" : "", keystr);
|
||||||
else
|
else
|
||||||
sprintf(buffer, "keymap: \"%s%c\" ", modbuf, (char)code);
|
sprintf(buffer, "keymap: \"%s%s%c\" ", modbuf, checkOther ? "?" : "", (char)code);
|
||||||
|
|
||||||
strcat(buffer, "is already mapped as a ");
|
strcat(buffer, "is already mapped as a ");
|
||||||
if (!key->isprefix)
|
if (!key->isprefix)
|
||||||
|
@ -373,6 +381,7 @@ wxKeycode *wxKeymap::MapFunction(long code, int shift, int ctrl,
|
||||||
newkey->altOff = (alt < 0);
|
newkey->altOff = (alt < 0);
|
||||||
newkey->metaOn = (meta > 0);
|
newkey->metaOn = (meta > 0);
|
||||||
newkey->metaOff = (meta < 0);
|
newkey->metaOff = (meta < 0);
|
||||||
|
newkey->checkOther = (checkOther ? 1 : 0);
|
||||||
newkey->score = ((newkey->shiftOn ? 1 : 0)
|
newkey->score = ((newkey->shiftOn ? 1 : 0)
|
||||||
+ (newkey->shiftOff ? 5 : 0)
|
+ (newkey->shiftOff ? 5 : 0)
|
||||||
+ (newkey->ctrlOn ? 1 : 0)
|
+ (newkey->ctrlOn ? 1 : 0)
|
||||||
|
@ -380,7 +389,8 @@ wxKeycode *wxKeymap::MapFunction(long code, int shift, int ctrl,
|
||||||
+ (newkey->altOn ? 1 : 0)
|
+ (newkey->altOn ? 1 : 0)
|
||||||
+ (newkey->altOff ? 5 : 0)
|
+ (newkey->altOff ? 5 : 0)
|
||||||
+ (newkey->metaOn ? 1 : 0)
|
+ (newkey->metaOn ? 1 : 0)
|
||||||
+ (newkey->metaOn ? 5 : 0));
|
+ (newkey->metaOn ? 5 : 0)
|
||||||
|
+ (newkey->checkOther ? 0 : 20));
|
||||||
newkey->fullset = 0;
|
newkey->fullset = 0;
|
||||||
newkey->fname = copystring(fname);
|
newkey->fname = copystring(fname);
|
||||||
newkey->next = NULL;
|
newkey->next = NULL;
|
||||||
|
@ -420,11 +430,14 @@ static long GetCode(unsigned char *keyseq, int *_kp, int *fullset)
|
||||||
for (i = 1; keyseq[kp] && (keyseq[kp] != ';'); i++, kp++) {
|
for (i = 1; keyseq[kp] && (keyseq[kp] != ';'); i++, kp++) {
|
||||||
if (i >= MAX_BUF - 1)
|
if (i >= MAX_BUF - 1)
|
||||||
return 0;
|
return 0;
|
||||||
buffer[i] = tolower(keyseq[kp]);
|
buffer[i] = keyseq[kp];
|
||||||
|
if (buffer[i] < 128)
|
||||||
|
buffer[i] = tolower(buffer[i]);
|
||||||
}
|
}
|
||||||
buffer[i] = 0;
|
buffer[i] = 0;
|
||||||
code = 0;
|
code = 0;
|
||||||
if (buffer[1]) {
|
if (buffer[1]) {
|
||||||
|
if (buffer[0] < 128)
|
||||||
buffer[0] = tolower(buffer[0]);
|
buffer[0] = tolower(buffer[0]);
|
||||||
for (i = 0; keylist[i].str; i++) {
|
for (i = 0; keylist[i].str; i++) {
|
||||||
if (!strcmp((char *)buffer, keylist[i].str)) {
|
if (!strcmp((char *)buffer, keylist[i].str)) {
|
||||||
|
@ -449,7 +462,7 @@ void wxKeymap::MapFunction(char *keys, char *fname)
|
||||||
char *keyseq = keys;
|
char *keyseq = keys;
|
||||||
int num_keys, num_new_keys, kp, start_keys;
|
int num_keys, num_new_keys, kp, start_keys;
|
||||||
wxKeycode **key, **new_key;
|
wxKeycode **key, **new_key;
|
||||||
int shift, ctrl, alt, meta, mod;
|
int shift, ctrl, alt, meta, mod, checkOther;
|
||||||
int part = 1, i, j;
|
int part = 1, i, j;
|
||||||
long code;
|
long code;
|
||||||
int fullset;
|
int fullset;
|
||||||
|
@ -466,6 +479,7 @@ void wxKeymap::MapFunction(char *keys, char *fname)
|
||||||
shift = ctrl = alt = meta = 0;
|
shift = ctrl = alt = meta = 0;
|
||||||
code = 0;
|
code = 0;
|
||||||
fullset = 0;
|
fullset = 0;
|
||||||
|
checkOther = 0;
|
||||||
|
|
||||||
while (keyseq[kp] && (keyseq[kp] != ';')) {
|
while (keyseq[kp] && (keyseq[kp] != ';')) {
|
||||||
mod = 1;
|
mod = 1;
|
||||||
|
@ -484,7 +498,11 @@ void wxKeymap::MapFunction(char *keys, char *fname)
|
||||||
kp++;
|
kp++;
|
||||||
} else if (keyseq[kp + 1] == ':') {
|
} else if (keyseq[kp + 1] == ':') {
|
||||||
do_mod:
|
do_mod:
|
||||||
switch (tolower(keyseq[kp])) {
|
unsigned char mch;
|
||||||
|
mch = keyseq[kp];
|
||||||
|
if (mch < 128)
|
||||||
|
mch = tolower(mch);
|
||||||
|
switch (mch) {
|
||||||
case 's':
|
case 's':
|
||||||
shift = mod;
|
shift = mod;
|
||||||
break;
|
break;
|
||||||
|
@ -510,6 +528,14 @@ void wxKeymap::MapFunction(char *keys, char *fname)
|
||||||
case 'a':
|
case 'a':
|
||||||
alt = mod;
|
alt = mod;
|
||||||
break;
|
break;
|
||||||
|
case '?':
|
||||||
|
if (mod == 1) {
|
||||||
|
checkOther = 1;
|
||||||
|
} else {
|
||||||
|
errstr = "cannot negate ? modifier";
|
||||||
|
goto key_error;
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
errstr = "bad modifier";
|
errstr = "bad modifier";
|
||||||
goto key_error;
|
goto key_error;
|
||||||
|
@ -527,10 +553,16 @@ void wxKeymap::MapFunction(char *keys, char *fname)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (code) {
|
if (code) {
|
||||||
if ((code > 0) && (code < 256) && isalpha(code)) {
|
if ((code > 0) && (code < 127) && isalpha(code)) {
|
||||||
if (shift > 0)
|
if (shift > 0) {
|
||||||
|
#ifdef wx_mac
|
||||||
|
if (!meta)
|
||||||
|
#endif
|
||||||
|
#ifdef wx_msw
|
||||||
|
if (!ctrl || meta)
|
||||||
|
#endif
|
||||||
code = toupper(code);
|
code = toupper(code);
|
||||||
else if (isupper(code))
|
} else if (isupper(code))
|
||||||
shift = TRUE;
|
shift = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -539,7 +571,7 @@ void wxKeymap::MapFunction(char *keys, char *fname)
|
||||||
|
|
||||||
for (i = 0, j = 0; i < num_keys; i++) {
|
for (i = 0, j = 0; i < num_keys; i++) {
|
||||||
wxKeycode *mf;
|
wxKeycode *mf;
|
||||||
mf = MapFunction(code, shift, ctrl, alt, meta, fname, key[i],
|
mf = MapFunction(code, shift, ctrl, alt, meta, checkOther, fname, key[i],
|
||||||
keyseq[kp] ? wxKEY_PREFIX : wxKEY_FINAL);
|
keyseq[kp] ? wxKEY_PREFIX : wxKEY_FINAL);
|
||||||
mf->fullset = fullset;
|
mf->fullset = fullset;
|
||||||
new_key[j++] = mf;
|
new_key[j++] = mf;
|
||||||
|
@ -570,13 +602,13 @@ void wxKeymap::MapFunction(char *keys, char *fname)
|
||||||
wxsKeymapError(buffer);
|
wxsKeymapError(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxKeymap::HandleEvent(long code, Bool shift, Bool ctrl,
|
int wxKeymap::HandleEvent(long code, long other_code, Bool shift, Bool ctrl,
|
||||||
Bool alt, Bool meta, int score,
|
Bool alt, Bool meta, int score,
|
||||||
char **fname, int *fullset)
|
char **fname, int *fullset)
|
||||||
{
|
{
|
||||||
wxKeycode *key;
|
wxKeycode *key;
|
||||||
|
|
||||||
key = FindKey(code, shift, ctrl, alt, meta, prefix);
|
key = FindKey(code, other_code, shift, ctrl, alt, meta, prefix);
|
||||||
|
|
||||||
prefix = NULL;
|
prefix = NULL;
|
||||||
|
|
||||||
|
@ -595,13 +627,13 @@ int wxKeymap::HandleEvent(long code, Bool shift, Bool ctrl,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxKeymap::GetBestScore(long code, Bool shift, Bool ctrl,
|
int wxKeymap::GetBestScore(long code, long other_code, Bool shift, Bool ctrl,
|
||||||
Bool alt, Bool meta)
|
Bool alt, Bool meta)
|
||||||
{
|
{
|
||||||
wxKeycode *key;
|
wxKeycode *key;
|
||||||
int s, i;
|
int s, i;
|
||||||
|
|
||||||
key = FindKey(code, shift, ctrl, alt, meta, prefix);
|
key = FindKey(code, other_code, shift, ctrl, alt, meta, prefix);
|
||||||
|
|
||||||
if (key)
|
if (key)
|
||||||
s = key->score;
|
s = key->score;
|
||||||
|
@ -610,7 +642,7 @@ int wxKeymap::GetBestScore(long code, Bool shift, Bool ctrl,
|
||||||
|
|
||||||
for (i = 0; i < chainCount; i++) {
|
for (i = 0; i < chainCount; i++) {
|
||||||
int r;
|
int r;
|
||||||
r = chainTo[i]->GetBestScore(code, shift, ctrl, alt, meta);
|
r = chainTo[i]->GetBestScore(code, other_code, shift, ctrl, alt, meta);
|
||||||
if (r > s)
|
if (r > s)
|
||||||
s = r;
|
s = r;
|
||||||
}
|
}
|
||||||
|
@ -648,6 +680,7 @@ Bool wxKeymap::HandleKeyEvent(UNKNOWN_OBJ media, wxKeyEvent *event)
|
||||||
int wxKeymap::GetBestScore(wxKeyEvent *event)
|
int wxKeymap::GetBestScore(wxKeyEvent *event)
|
||||||
{
|
{
|
||||||
return GetBestScore(event->keyCode,
|
return GetBestScore(event->keyCode,
|
||||||
|
event->otherKeyCode,
|
||||||
event->shiftDown,
|
event->shiftDown,
|
||||||
event->controlDown,
|
event->controlDown,
|
||||||
event->altDown,
|
event->altDown,
|
||||||
|
@ -703,6 +736,7 @@ int wxKeymap::ChainHandleKeyEvent(UNKNOWN_OBJ media, wxKeyEvent *event,
|
||||||
return OtherHandleKeyEvent(media, event, grab, grabData, -1, score);
|
return OtherHandleKeyEvent(media, event, grab, grabData, -1, score);
|
||||||
|
|
||||||
if (HandleEvent(event->keyCode,
|
if (HandleEvent(event->keyCode,
|
||||||
|
event->otherKeyCode,
|
||||||
event->shiftDown,
|
event->shiftDown,
|
||||||
event->controlDown,
|
event->controlDown,
|
||||||
event->altDown,
|
event->altDown,
|
||||||
|
@ -795,6 +829,7 @@ int wxKeymap::GetBestScore(wxMouseEvent *event)
|
||||||
}
|
}
|
||||||
|
|
||||||
return GetBestScore(code,
|
return GetBestScore(code,
|
||||||
|
-1,
|
||||||
event->shiftDown,
|
event->shiftDown,
|
||||||
event->controlDown,
|
event->controlDown,
|
||||||
event->altDown,
|
event->altDown,
|
||||||
|
@ -895,6 +930,7 @@ int wxKeymap::ChainHandleMouseEvent(UNKNOWN_OBJ media, wxMouseEvent *event,
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (HandleEvent(code,
|
if (HandleEvent(code,
|
||||||
|
-1,
|
||||||
event->shiftDown,
|
event->shiftDown,
|
||||||
event->controlDown,
|
event->controlDown,
|
||||||
event->altDown,
|
event->altDown,
|
||||||
|
|
|
@ -62,10 +62,10 @@ class wxKeymap : public wxObject
|
||||||
wxBreakSequenceFunction onBreak;
|
wxBreakSequenceFunction onBreak;
|
||||||
void *onBreakData;
|
void *onBreakData;
|
||||||
|
|
||||||
class wxKeycode *FindKey(long, Bool, Bool, Bool, Bool, class wxKeycode *);
|
class wxKeycode *FindKey(long, long, Bool, Bool, Bool, Bool, class wxKeycode *);
|
||||||
int HandleEvent(long code, Bool shift, Bool ctrl, Bool alt, Bool meta,
|
int HandleEvent(long code, long, Bool shift, Bool ctrl, Bool alt, Bool meta,
|
||||||
int score, char **fname, int *fullset);
|
int score, char **fname, int *fullset);
|
||||||
int GetBestScore(long code, Bool shift, Bool ctrl, Bool alt, Bool meta);
|
int GetBestScore(long code, long, Bool shift, Bool ctrl, Bool alt, Bool meta);
|
||||||
|
|
||||||
Bool CycleCheck(wxKeymap *km);
|
Bool CycleCheck(wxKeymap *km);
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ class wxKeymap : public wxObject
|
||||||
void SetBreakSequenceCallback(wxBreakSequenceFunction f, void *data);
|
void SetBreakSequenceCallback(wxBreakSequenceFunction f, void *data);
|
||||||
|
|
||||||
class wxKeycode *MapFunction(long code, int shift, int ctrl,
|
class wxKeycode *MapFunction(long code, int shift, int ctrl,
|
||||||
int alt, int meta,
|
int alt, int meta, int check_alt,
|
||||||
char *fname, class wxKeycode *prevkey=NULL,
|
char *fname, class wxKeycode *prevkey=NULL,
|
||||||
int keytype = wxKEY_FINAL);
|
int keytype = wxKEY_FINAL);
|
||||||
void MapFunction(char *keyname, char *fname);
|
void MapFunction(char *keyname, char *fname);
|
||||||
|
|
|
@ -1458,6 +1458,10 @@ static Scheme_Object *bundle_symset_keyCode(int v) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static long GetOtherKey(wxKeyEvent *k) { return k->otherKeyCode; }
|
||||||
|
static void SetOtherKey(wxKeyEvent *k, long c) { k->otherKeyCode = c; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1494,6 +1498,50 @@ os_wxKeyEvent::~os_wxKeyEvent()
|
||||||
objscheme_destroy(this, (Scheme_Object *) __gc_external);
|
objscheme_destroy(this, (Scheme_Object *) __gc_external);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Scheme_Object *os_wxKeyEventSetOtherKey(int n, Scheme_Object *p[])
|
||||||
|
{
|
||||||
|
WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
|
||||||
|
REMEMBER_VAR_STACK();
|
||||||
|
objscheme_check_valid(os_wxKeyEvent_class, "set-other-shift-key-code in key-event%", n, p);
|
||||||
|
long x0 INIT_NULLED_OUT;
|
||||||
|
|
||||||
|
SETUP_VAR_STACK_REMEMBERED(2);
|
||||||
|
VAR_STACK_PUSH(0, p);
|
||||||
|
VAR_STACK_PUSH(1, x0);
|
||||||
|
|
||||||
|
|
||||||
|
x0 = (SCHEME_FALSEP(p[POFFSET+0]) ? 0 : unbundle_symset_keyCode(p[POFFSET+0], METHODNAME("key-event%","get-other-shift-key-code")));
|
||||||
|
|
||||||
|
|
||||||
|
WITH_VAR_STACK(SetOtherKey(((wxKeyEvent *)((Scheme_Class_Object *)p[0])->primdata), x0));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
READY_TO_RETURN;
|
||||||
|
return scheme_void;
|
||||||
|
}
|
||||||
|
|
||||||
|
static Scheme_Object *os_wxKeyEventGetOtherKey(int n, Scheme_Object *p[])
|
||||||
|
{
|
||||||
|
WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
|
||||||
|
REMEMBER_VAR_STACK();
|
||||||
|
long r;
|
||||||
|
objscheme_check_valid(os_wxKeyEvent_class, "get-other-shift-key-code in key-event%", n, p);
|
||||||
|
|
||||||
|
SETUP_VAR_STACK_REMEMBERED(1);
|
||||||
|
VAR_STACK_PUSH(0, p);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
r = WITH_VAR_STACK(GetOtherKey(((wxKeyEvent *)((Scheme_Class_Object *)p[0])->primdata)));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
READY_TO_RETURN;
|
||||||
|
return (r ? bundle_symset_keyCode(r) : scheme_false);
|
||||||
|
}
|
||||||
|
|
||||||
static Scheme_Object *objscheme_wxKeyEvent_GetkeyCode(int n, Scheme_Object *p[])
|
static Scheme_Object *objscheme_wxKeyEvent_GetkeyCode(int n, Scheme_Object *p[])
|
||||||
{
|
{
|
||||||
Scheme_Class_Object *cobj INIT_NULLED_OUT;
|
Scheme_Class_Object *cobj INIT_NULLED_OUT;
|
||||||
|
@ -1842,8 +1890,10 @@ void objscheme_setup_wxKeyEvent(Scheme_Env *env)
|
||||||
|
|
||||||
wxREGGLOB(os_wxKeyEvent_class);
|
wxREGGLOB(os_wxKeyEvent_class);
|
||||||
|
|
||||||
os_wxKeyEvent_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "key-event%", "event%", (Scheme_Method_Prim *)os_wxKeyEvent_ConstructScheme, 16));
|
os_wxKeyEvent_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "key-event%", "event%", (Scheme_Method_Prim *)os_wxKeyEvent_ConstructScheme, 18));
|
||||||
|
|
||||||
|
WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeyEvent_class, "set-other-shift-key-code" " method", (Scheme_Method_Prim *)os_wxKeyEventSetOtherKey, 1, 1));
|
||||||
|
WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeyEvent_class, "get-other-shift-key-code" " method", (Scheme_Method_Prim *)os_wxKeyEventGetOtherKey, 0, 0));
|
||||||
|
|
||||||
WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeyEvent_class,"get-key-code" " method", (Scheme_Method_Prim *)objscheme_wxKeyEvent_GetkeyCode, 0, 0));
|
WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeyEvent_class,"get-key-code" " method", (Scheme_Method_Prim *)objscheme_wxKeyEvent_GetkeyCode, 0, 0));
|
||||||
WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeyEvent_class,"set-key-code" " method", (Scheme_Method_Prim *)objscheme_wxKeyEvent_SetkeyCode, 1, 1));
|
WITH_VAR_STACK(scheme_add_method_w_arity(os_wxKeyEvent_class,"set-key-code" " method", (Scheme_Method_Prim *)objscheme_wxKeyEvent_SetkeyCode, 1, 1));
|
||||||
|
@ -1924,6 +1974,43 @@ class wxKeyEvent *objscheme_unbundle_wxKeyEvent(Scheme_Object *obj, const char *
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int wxKeySymbolToInteger(int v) { return v; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static Scheme_Object *wxKeyEventGlobalwxKeySymbolToInteger(int n, Scheme_Object *p[])
|
||||||
|
{
|
||||||
|
WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
|
||||||
|
REMEMBER_VAR_STACK();
|
||||||
|
int r;
|
||||||
|
int x0;
|
||||||
|
|
||||||
|
SETUP_VAR_STACK_REMEMBERED(1);
|
||||||
|
VAR_STACK_PUSH(0, p);
|
||||||
|
|
||||||
|
|
||||||
|
x0 = WITH_VAR_STACK(unbundle_symset_keyCode(p[0+0], NULL));
|
||||||
|
|
||||||
|
|
||||||
|
r = WITH_VAR_STACK(wxKeySymbolToInteger(x0));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
READY_TO_RETURN;
|
||||||
|
return scheme_make_integer(r);
|
||||||
|
}
|
||||||
|
|
||||||
|
void objscheme_setup_wxKeyEventGlobal(Scheme_Env *env)
|
||||||
|
{
|
||||||
|
Scheme_Object *functmp INIT_NULLED_OUT;
|
||||||
|
SETUP_VAR_STACK(1);
|
||||||
|
VAR_STACK_PUSH(0, env);
|
||||||
|
functmp = WITH_VAR_STACK(scheme_make_prim_w_arity((Scheme_Prim *)wxKeyEventGlobalwxKeySymbolToInteger, "key-symbol-to-integer", 1, 1));
|
||||||
|
WITH_VAR_STACK(scheme_install_xc_global("key-symbol-to-integer", functmp, env));
|
||||||
|
READY_TO_RETURN;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static Scheme_Object *mouseEventType_wxEVENT_TYPE_LEFT_DOWN_sym = NULL;
|
static Scheme_Object *mouseEventType_wxEVENT_TYPE_LEFT_DOWN_sym = NULL;
|
||||||
static Scheme_Object *mouseEventType_wxEVENT_TYPE_LEFT_UP_sym = NULL;
|
static Scheme_Object *mouseEventType_wxEVENT_TYPE_LEFT_UP_sym = NULL;
|
||||||
static Scheme_Object *mouseEventType_wxEVENT_TYPE_MIDDLE_DOWN_sym = NULL;
|
static Scheme_Object *mouseEventType_wxEVENT_TYPE_MIDDLE_DOWN_sym = NULL;
|
||||||
|
|
|
@ -30,6 +30,9 @@ int objscheme_istype_wxKeyEvent(Scheme_Object *obj, const char *stop, int nullOK
|
||||||
Scheme_Object *objscheme_bundle_wxKeyEvent(class wxKeyEvent *realobj);
|
Scheme_Object *objscheme_bundle_wxKeyEvent(class wxKeyEvent *realobj);
|
||||||
class wxKeyEvent *objscheme_unbundle_wxKeyEvent(Scheme_Object *obj, const char *where, int nullOK);
|
class wxKeyEvent *objscheme_unbundle_wxKeyEvent(Scheme_Object *obj, const char *where, int nullOK);
|
||||||
#endif
|
#endif
|
||||||
|
void objscheme_setup_wxKeyEventGlobal(Scheme_Env *env);
|
||||||
|
#ifndef WXS_SETUP_ONLY
|
||||||
|
#endif
|
||||||
void objscheme_setup_wxMouseEvent(Scheme_Env *env);
|
void objscheme_setup_wxMouseEvent(Scheme_Env *env);
|
||||||
#ifndef WXS_SETUP_ONLY
|
#ifndef WXS_SETUP_ONLY
|
||||||
int objscheme_istype_wxMouseEvent(Scheme_Object *obj, const char *stop, int nullOK);
|
int objscheme_istype_wxMouseEvent(Scheme_Object *obj, const char *stop, int nullOK);
|
||||||
|
|
|
@ -220,6 +220,11 @@ wxMouseEvent_ext::wxMouseEvent_ext(int et, int ld, int mdd, int rd, int xv, int
|
||||||
@SYM "release" : WXK_RELEASE
|
@SYM "release" : WXK_RELEASE
|
||||||
@ENDSYMBOLS
|
@ENDSYMBOLS
|
||||||
|
|
||||||
|
@MACRO bKeyOrFalse = ({x} ? bundle_symset_keyCode({x}) : scheme_false)
|
||||||
|
@MACRO ubKeyOrFalse = (SCHEME_FALSEP({x}) ? 0 : unbundle_symset_keyCode({x}, METHODNAME("key-event%","get-other-shift-key-code")))
|
||||||
|
static long GetOtherKey(wxKeyEvent *k) { return k->otherKeyCode; }
|
||||||
|
static void SetOtherKey(wxKeyEvent *k, long c) { k->otherKeyCode = c; }
|
||||||
|
|
||||||
@CLASSBASE wxKeyEvent=wxKeyEvent_ext "key-event":"event" / nofnl
|
@CLASSBASE wxKeyEvent=wxKeyEvent_ext "key-event":"event" / nofnl
|
||||||
|
|
||||||
@CREATOR (SYM[keyCode]=0, bool=0, bool=0, bool=0, bool=0, int=0, int=0, ExactLong=0)
|
@CREATOR (SYM[keyCode]=0, bool=0, bool=0, bool=0, bool=0, int=0, int=0, ExactLong=0)
|
||||||
|
@ -235,6 +240,17 @@ wxMouseEvent_ext::wxMouseEvent_ext(int et, int ld, int mdd, int rd, int xv, int
|
||||||
@IVAR "x" : int x
|
@IVAR "x" : int x
|
||||||
@IVAR "y" : int y
|
@IVAR "y" : int y
|
||||||
|
|
||||||
|
@ m "get-other-shift-key-code" : long/bKeyOrFalse GetOtherKey();
|
||||||
|
@ m "set-other-shift-key-code" : void SetOtherKey(long//ubKeyOrFalse////push);
|
||||||
|
|
||||||
|
@END
|
||||||
|
|
||||||
|
static int wxKeySymbolToInteger(int v) { return v; }
|
||||||
|
|
||||||
|
@GLOBAL wxKeyEventGlobal
|
||||||
|
|
||||||
|
@ "key-symbol-to-integer" : int wxKeySymbolToInteger(SYMZ[keyCode])
|
||||||
|
|
||||||
@END
|
@END
|
||||||
|
|
||||||
@BEGINSYMBOLS mouseEventType > ONE > PRED
|
@BEGINSYMBOLS mouseEventType > ONE > PRED
|
||||||
|
|
|
@ -3261,6 +3261,7 @@ static void wxScheme_Install(Scheme_Env *global_env)
|
||||||
objscheme_setup_wxPopupEvent(global_env);
|
objscheme_setup_wxPopupEvent(global_env);
|
||||||
objscheme_setup_wxScrollEvent(global_env);
|
objscheme_setup_wxScrollEvent(global_env);
|
||||||
objscheme_setup_wxKeyEvent(global_env);
|
objscheme_setup_wxKeyEvent(global_env);
|
||||||
|
objscheme_setup_wxKeyEventGlobal(global_env);
|
||||||
objscheme_setup_wxMouseEvent(global_env);
|
objscheme_setup_wxMouseEvent(global_env);
|
||||||
objscheme_setup_wxDC(global_env);
|
objscheme_setup_wxDC(global_env);
|
||||||
objscheme_setup_wxDCGlobal(global_env);
|
objscheme_setup_wxDCGlobal(global_env);
|
||||||
|
|
|
@ -735,7 +735,8 @@ typedef struct {
|
||||||
typedef struct Scheme_Hash_Table
|
typedef struct Scheme_Hash_Table
|
||||||
{
|
{
|
||||||
Scheme_Inclhash_Object iso;
|
Scheme_Inclhash_Object iso;
|
||||||
int size, count, step;
|
int size; /* power of 2 */
|
||||||
|
int count;
|
||||||
Scheme_Object **keys;
|
Scheme_Object **keys;
|
||||||
Scheme_Object **vals;
|
Scheme_Object **vals;
|
||||||
void (*make_hash_indices)(void *v, long *h1, long *h2);
|
void (*make_hash_indices)(void *v, long *h1, long *h2);
|
||||||
|
@ -755,7 +756,8 @@ typedef struct Scheme_Bucket
|
||||||
typedef struct Scheme_Bucket_Table
|
typedef struct Scheme_Bucket_Table
|
||||||
{
|
{
|
||||||
Scheme_Object so;
|
Scheme_Object so;
|
||||||
int size, count, step;
|
int size; /* power of 2 */
|
||||||
|
int count;
|
||||||
Scheme_Bucket **buckets;
|
Scheme_Bucket **buckets;
|
||||||
char weak, with_home;
|
char weak, with_home;
|
||||||
void (*make_hash_indices)(void *v, long *h1, long *h2);
|
void (*make_hash_indices)(void *v, long *h1, long *h2);
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -62,13 +62,7 @@ long PTR_TO_LONG(Scheme_Object *o)
|
||||||
|
|
||||||
#define FILL_FACTOR 1.4
|
#define FILL_FACTOR 1.4
|
||||||
|
|
||||||
#define MIN_HTABLE_SIZE 7
|
#define MIN_HTABLE_SIZE 8
|
||||||
|
|
||||||
long scheme_hash_primes[] =
|
|
||||||
{MIN_HTABLE_SIZE, 31, 61, 127, 257, 521, 1031, 2053, 4099, 8209, 16411,
|
|
||||||
32779, 65543, 131101, 262147, 425329, 1048583, 2097169,
|
|
||||||
4194319, 8388617, 16777259, 33554467, 67108879, 134217757,
|
|
||||||
268435459, 536870923, 1073741827};
|
|
||||||
|
|
||||||
typedef int (*Hash_Compare_Proc)(void*, void*);
|
typedef int (*Hash_Compare_Proc)(void*, void*);
|
||||||
|
|
||||||
|
@ -131,7 +125,6 @@ Scheme_Hash_Table *scheme_make_hash_table(int type)
|
||||||
|
|
||||||
table = MALLOC_ONE_TAGGED(Scheme_Hash_Table);
|
table = MALLOC_ONE_TAGGED(Scheme_Hash_Table);
|
||||||
|
|
||||||
table->step = 0;
|
|
||||||
table->size = 0;
|
table->size = 0;
|
||||||
|
|
||||||
table->iso.so.type = scheme_hash_table_type;
|
table->iso.so.type = scheme_hash_table_type;
|
||||||
|
@ -156,23 +149,24 @@ static Scheme_Object *do_hash(Scheme_Hash_Table *table, Scheme_Object *key, int
|
||||||
{
|
{
|
||||||
Scheme_Object *tkey, **keys;
|
Scheme_Object *tkey, **keys;
|
||||||
hash_v_t h, h2, useme = 0;
|
hash_v_t h, h2, useme = 0;
|
||||||
unsigned long size = table->size;
|
unsigned long mask;
|
||||||
|
|
||||||
rehash_key:
|
rehash_key:
|
||||||
|
|
||||||
|
mask = table->size - 1;
|
||||||
|
|
||||||
if (table->make_hash_indices) {
|
if (table->make_hash_indices) {
|
||||||
table->make_hash_indices((void *)key, (long *)&h, (long *)&h2);
|
table->make_hash_indices((void *)key, (long *)&h, (long *)&h2);
|
||||||
h = h % size;
|
h = h & mask;
|
||||||
h2 = h2 % size;
|
h2 = h2 & mask;
|
||||||
} else {
|
} else {
|
||||||
unsigned long lkey;
|
unsigned long lkey;
|
||||||
lkey = (unsigned long)PTR_TO_LONG((Scheme_Object *)key);
|
lkey = (unsigned long)PTR_TO_LONG((Scheme_Object *)key);
|
||||||
h = (lkey >> 2) % size;
|
h = (lkey >> 2) & mask;
|
||||||
h2 = (lkey >> 3) % size;
|
h2 = (lkey >> 3) & mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!h2)
|
h2 |= 1;
|
||||||
h2 = 2;
|
|
||||||
|
|
||||||
keys = table->keys;
|
keys = table->keys;
|
||||||
|
|
||||||
|
@ -196,7 +190,7 @@ static Scheme_Object *do_hash(Scheme_Hash_Table *table, Scheme_Object *key, int
|
||||||
return table->vals[h];
|
return table->vals[h];
|
||||||
}
|
}
|
||||||
scheme_hash_iteration_count++;
|
scheme_hash_iteration_count++;
|
||||||
h = (h + h2) % size;
|
h = (h + h2) & mask;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
scheme_hash_request_count++;
|
scheme_hash_request_count++;
|
||||||
|
@ -218,7 +212,7 @@ static Scheme_Object *do_hash(Scheme_Hash_Table *table, Scheme_Object *key, int
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
scheme_hash_iteration_count++;
|
scheme_hash_iteration_count++;
|
||||||
h = (h + h2) % size;
|
h = (h + h2) & mask;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -227,14 +221,14 @@ static Scheme_Object *do_hash(Scheme_Hash_Table *table, Scheme_Object *key, int
|
||||||
|
|
||||||
if (set == 1)
|
if (set == 1)
|
||||||
h = useme;
|
h = useme;
|
||||||
else if (table->mcount * FILL_FACTOR >= size) {
|
else if (table->mcount * FILL_FACTOR >= table->size) {
|
||||||
/* Rehash */
|
/* Rehash */
|
||||||
int i, oldsize = table->size;
|
int i, oldsize = table->size, size;
|
||||||
Scheme_Object **oldkeys = table->keys;
|
Scheme_Object **oldkeys = table->keys;
|
||||||
Scheme_Object **oldvals = table->vals;
|
Scheme_Object **oldvals = table->vals;
|
||||||
|
|
||||||
table->size = scheme_hash_primes[++table->step];
|
size = oldsize << 1;
|
||||||
size = table->size;
|
table->size = size;
|
||||||
|
|
||||||
{
|
{
|
||||||
Scheme_Object **ba;
|
Scheme_Object **ba;
|
||||||
|
@ -268,7 +262,7 @@ void scheme_hash_set(Scheme_Hash_Table *table, Scheme_Object *key, Scheme_Object
|
||||||
if (!table->vals) {
|
if (!table->vals) {
|
||||||
Scheme_Object **ba;
|
Scheme_Object **ba;
|
||||||
|
|
||||||
table->size = scheme_hash_primes[0];
|
table->size = 8;
|
||||||
|
|
||||||
ba = MALLOC_N(Scheme_Object *, table->size);
|
ba = MALLOC_N(Scheme_Object *, table->size);
|
||||||
table->vals = ba;
|
table->vals = ba;
|
||||||
|
@ -345,16 +339,15 @@ Scheme_Hash_Table *scheme_clone_hash_table(Scheme_Hash_Table *ht)
|
||||||
|
|
||||||
void scheme_reset_hash_table(Scheme_Hash_Table *table, int *history)
|
void scheme_reset_hash_table(Scheme_Hash_Table *table, int *history)
|
||||||
{
|
{
|
||||||
if (!table->step
|
if ((table->size <= 8)
|
||||||
|| ((table->count * FILL_FACTOR > (scheme_hash_primes[table->step - 1])))) {
|
|| (table->count * FILL_FACTOR > (table->size >> 1))) {
|
||||||
/* Keep same size */
|
/* Keep same size */
|
||||||
memset(table->vals, 0, sizeof(Scheme_Object *) * table->size);
|
memset(table->vals, 0, sizeof(Scheme_Object *) * table->size);
|
||||||
memset(table->keys, 0, sizeof(Scheme_Object *) * table->size);
|
memset(table->keys, 0, sizeof(Scheme_Object *) * table->size);
|
||||||
} else {
|
} else {
|
||||||
/* Shrink by one step */
|
/* Shrink by one step */
|
||||||
Scheme_Object **ba;
|
Scheme_Object **ba;
|
||||||
--table->step;
|
table->size >>= 1;
|
||||||
table->size = scheme_hash_primes[table->step];
|
|
||||||
ba = MALLOC_N(Scheme_Object *, table->size);
|
ba = MALLOC_N(Scheme_Object *, table->size);
|
||||||
memcpy(ba, table->vals, sizeof(Scheme_Object *) * table->size);
|
memcpy(ba, table->vals, sizeof(Scheme_Object *) * table->size);
|
||||||
table->vals = ba;
|
table->vals = ba;
|
||||||
|
@ -378,11 +371,10 @@ scheme_make_bucket_table (int size, int type)
|
||||||
|
|
||||||
table = MALLOC_ONE_TAGGED(Scheme_Bucket_Table);
|
table = MALLOC_ONE_TAGGED(Scheme_Bucket_Table);
|
||||||
|
|
||||||
table->step = 0;
|
table->size = 1;
|
||||||
while (scheme_hash_primes[table->step] < size) {
|
while (table->size < size) {
|
||||||
table->step++;
|
table->size <<= 1;
|
||||||
}
|
}
|
||||||
table->size = scheme_hash_primes[table->step];
|
|
||||||
|
|
||||||
table->count = 0;
|
table->count = 0;
|
||||||
|
|
||||||
|
@ -409,7 +401,6 @@ Scheme_Bucket_Table *scheme_clone_bucket_table(Scheme_Bucket_Table *bt)
|
||||||
table->so.type = scheme_bucket_table_type;
|
table->so.type = scheme_bucket_table_type;
|
||||||
table->size = bt->size;
|
table->size = bt->size;
|
||||||
table->count = bt->count;
|
table->count = bt->count;
|
||||||
table->step = bt->step;
|
|
||||||
table->weak = bt->weak;
|
table->weak = bt->weak;
|
||||||
table->with_home = 0;
|
table->with_home = 0;
|
||||||
table->make_hash_indices = bt->make_hash_indices;
|
table->make_hash_indices = bt->make_hash_indices;
|
||||||
|
@ -436,27 +427,24 @@ get_bucket (Scheme_Bucket_Table *table, const char *key, int add, Scheme_Bucket
|
||||||
hash_v_t h, h2;
|
hash_v_t h, h2;
|
||||||
Scheme_Bucket *bucket;
|
Scheme_Bucket *bucket;
|
||||||
Compare_Proc compare = table->compare;
|
Compare_Proc compare = table->compare;
|
||||||
unsigned long size;
|
unsigned long mask;
|
||||||
|
|
||||||
rehash_key:
|
rehash_key:
|
||||||
|
|
||||||
size = table->size;
|
mask = table->size - 1;
|
||||||
|
|
||||||
if (table->make_hash_indices) {
|
if (table->make_hash_indices) {
|
||||||
table->make_hash_indices((void *)key, (long *)&h, (long *)&h2);
|
table->make_hash_indices((void *)key, (long *)&h, (long *)&h2);
|
||||||
h = h % size;
|
h = h & mask;
|
||||||
h2 = h2 % size;
|
h2 = h2 & mask;
|
||||||
} else {
|
} else {
|
||||||
unsigned long lkey;
|
unsigned long lkey;
|
||||||
lkey = (unsigned long)PTR_TO_LONG((Scheme_Object *)key);
|
lkey = (unsigned long)PTR_TO_LONG((Scheme_Object *)key);
|
||||||
h = (lkey >> 2) % size;
|
h = (lkey >> 2) & mask;
|
||||||
h2 = (lkey >> 3) % size;
|
h2 = (lkey >> 3) & mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!h2)
|
h2 |= 0x1;
|
||||||
h2 = 2;
|
|
||||||
else if (h2 & 0x1)
|
|
||||||
h2++;
|
|
||||||
|
|
||||||
if (table->weak) {
|
if (table->weak) {
|
||||||
scheme_hash_request_count++;
|
scheme_hash_request_count++;
|
||||||
|
@ -477,7 +465,7 @@ get_bucket (Scheme_Bucket_Table *table, const char *key, int add, Scheme_Bucket
|
||||||
} else if (add)
|
} else if (add)
|
||||||
break;
|
break;
|
||||||
scheme_hash_iteration_count++;
|
scheme_hash_iteration_count++;
|
||||||
h = (h + h2) % size;
|
h = (h + h2) & mask;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
scheme_hash_request_count++;
|
scheme_hash_request_count++;
|
||||||
|
@ -487,7 +475,7 @@ get_bucket (Scheme_Bucket_Table *table, const char *key, int add, Scheme_Bucket
|
||||||
else if (compare && !compare((void *)bucket->key, (void *)key))
|
else if (compare && !compare((void *)bucket->key, (void *)key))
|
||||||
return bucket;
|
return bucket;
|
||||||
scheme_hash_iteration_count++;
|
scheme_hash_iteration_count++;
|
||||||
h = (h + h2) % size;
|
h = (h + h2) & mask;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -514,12 +502,12 @@ get_bucket (Scheme_Bucket_Table *table, const char *key, int add, Scheme_Bucket
|
||||||
}
|
}
|
||||||
|
|
||||||
if (actual * FILL_FACTOR < table->count) {
|
if (actual * FILL_FACTOR < table->count) {
|
||||||
/* Decrement step so that the table won't actually grow. */
|
/* Decrement size so that the table won't actually grow. */
|
||||||
--table->step;
|
table->size >>= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
table->size = scheme_hash_primes[++table->step];
|
table->size <<= 1;
|
||||||
|
|
||||||
asize = (size_t)table->size * sizeof(Scheme_Bucket *);
|
asize = (size_t)table->size * sizeof(Scheme_Bucket *);
|
||||||
{
|
{
|
||||||
|
|
|
@ -9,6 +9,6 @@
|
||||||
|
|
||||||
|
|
||||||
#define MZSCHEME_VERSION_MAJOR 350
|
#define MZSCHEME_VERSION_MAJOR 350
|
||||||
#define MZSCHEME_VERSION_MINOR 3
|
#define MZSCHEME_VERSION_MINOR 4
|
||||||
|
|
||||||
#define MZSCHEME_VERSION "350.3" _MZ_SPECIAL_TAG
|
#define MZSCHEME_VERSION "350.4" _MZ_SPECIAL_TAG
|
||||||
|
|
|
@ -803,10 +803,10 @@ static int maybe_add_chain_cache(Scheme_Stx *stx)
|
||||||
/* ok to skip, but don't count toward needing a cache */
|
/* ok to skip, but don't count toward needing a cache */
|
||||||
} else if (SCHEME_HASHTP(p)) {
|
} else if (SCHEME_HASHTP(p)) {
|
||||||
/* Hack: we store the depth of the table in the chain
|
/* Hack: we store the depth of the table in the chain
|
||||||
in the `step' fields, at least until the table is initialized: */
|
in the `size' fields, at least until the table is initialized: */
|
||||||
Scheme_Hash_Table *ht2 = (Scheme_Hash_Table *)p;
|
Scheme_Hash_Table *ht2 = (Scheme_Hash_Table *)p;
|
||||||
if (!ht2->count)
|
if (!ht2->count)
|
||||||
pos = ht2->step;
|
pos = ht2->size;
|
||||||
else {
|
else {
|
||||||
p = scheme_hash_get(ht2, scheme_make_integer(2));
|
p = scheme_hash_get(ht2, scheme_make_integer(2));
|
||||||
pos = SCHEME_INT_VAL(p);
|
pos = SCHEME_INT_VAL(p);
|
||||||
|
@ -825,7 +825,7 @@ static int maybe_add_chain_cache(Scheme_Stx *stx)
|
||||||
|
|
||||||
ht = scheme_make_hash_table(SCHEME_hash_ptr);
|
ht = scheme_make_hash_table(SCHEME_hash_ptr);
|
||||||
|
|
||||||
ht->step = pos;
|
ht->size = pos;
|
||||||
|
|
||||||
p = scheme_make_pair((Scheme_Object *)ht, stx->wraps);
|
p = scheme_make_pair((Scheme_Object *)ht, stx->wraps);
|
||||||
stx->wraps = p;
|
stx->wraps = p;
|
||||||
|
@ -878,8 +878,8 @@ static void fill_chain_cache(Scheme_Object *wraps)
|
||||||
|
|
||||||
scheme_hash_set(ht, scheme_make_integer(5), NULL);
|
scheme_hash_set(ht, scheme_make_integer(5), NULL);
|
||||||
} else {
|
} else {
|
||||||
pos = ht->step;
|
pos = ht->size;
|
||||||
ht->step = 0;
|
ht->size = 0;
|
||||||
|
|
||||||
wraps = SCHEME_CDR(wraps);
|
wraps = SCHEME_CDR(wraps);
|
||||||
|
|
||||||
|
@ -913,11 +913,11 @@ static void fill_chain_cache(Scheme_Object *wraps)
|
||||||
/* ok to skip */
|
/* ok to skip */
|
||||||
} else if (SCHEME_HASHTP(p)) {
|
} else if (SCHEME_HASHTP(p)) {
|
||||||
/* Hack: we store the depth of the table in the chain
|
/* Hack: we store the depth of the table in the chain
|
||||||
in the `step' fields, at least until the table is initialized: */
|
in the `size' fields, at least until the table is initialized: */
|
||||||
Scheme_Hash_Table *ht2 = (Scheme_Hash_Table *)p;
|
Scheme_Hash_Table *ht2 = (Scheme_Hash_Table *)p;
|
||||||
int pos2;
|
int pos2;
|
||||||
if (!ht2->count)
|
if (!ht2->count)
|
||||||
pos2 = ht2->step;
|
pos2 = ht2->size;
|
||||||
else {
|
else {
|
||||||
p = scheme_hash_get(ht2, scheme_make_integer(2));
|
p = scheme_hash_get(ht2, scheme_make_integer(2));
|
||||||
pos2 = SCHEME_INT_VAL(p);
|
pos2 = SCHEME_INT_VAL(p);
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include "schgc.h"
|
#include "schgc.h"
|
||||||
|
|
||||||
# define HASH_TABLE_SIZE_STEP 4
|
# define HASH_TABLE_INIT_SIZE 256
|
||||||
#ifdef SMALL_HASH_TABLES
|
#ifdef SMALL_HASH_TABLES
|
||||||
# define FILL_FACTOR 1.30
|
# define FILL_FACTOR 1.30
|
||||||
#else
|
#else
|
||||||
|
@ -74,8 +74,6 @@ static int gensym_counter;
|
||||||
typedef unsigned long hash_v_t;
|
typedef unsigned long hash_v_t;
|
||||||
#define HASH_SEED 0xF0E1D2C3
|
#define HASH_SEED 0xF0E1D2C3
|
||||||
|
|
||||||
extern long scheme_hash_primes[];
|
|
||||||
|
|
||||||
#define SYMTAB_LOST_CELL scheme_false
|
#define SYMTAB_LOST_CELL scheme_false
|
||||||
|
|
||||||
#ifdef MZ_PRECISE_GC
|
#ifdef MZ_PRECISE_GC
|
||||||
|
@ -90,11 +88,14 @@ static Scheme_Object *symbol_bucket(Scheme_Hash_Table *table,
|
||||||
Scheme_Object *naya)
|
Scheme_Object *naya)
|
||||||
{
|
{
|
||||||
hash_v_t h, h2;
|
hash_v_t h, h2;
|
||||||
|
unsigned long mask;
|
||||||
Scheme_Object *bucket;
|
Scheme_Object *bucket;
|
||||||
|
|
||||||
/* WARNING: key may be GC-misaligned... */
|
/* WARNING: key may be GC-misaligned... */
|
||||||
|
|
||||||
rehash_key:
|
rehash_key:
|
||||||
|
mask = table->size - 1;
|
||||||
|
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
i = 0;
|
i = 0;
|
||||||
|
@ -110,14 +111,11 @@ static Scheme_Object *symbol_bucket(Scheme_Hash_Table *table,
|
||||||
h ^= (h << 5) + (h >> 2) + 0xA0A0;
|
h ^= (h << 5) + (h >> 2) + 0xA0A0;
|
||||||
h ^= (h << 5) + (h >> 2) + 0x0505;
|
h ^= (h << 5) + (h >> 2) + 0x0505;
|
||||||
|
|
||||||
h = h % table->size;
|
h = h & mask;
|
||||||
h2 = h2 % table->size;
|
h2 = h2 & mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!h2)
|
h2 |= 0x1;
|
||||||
h2 = 2;
|
|
||||||
else if (h2 & 0x1)
|
|
||||||
h2++; /* note: table size is never even, so no % needed */
|
|
||||||
|
|
||||||
while ((bucket = table->keys[WEAK_ARRAY_HEADSIZE + h])) {
|
while ((bucket = table->keys[WEAK_ARRAY_HEADSIZE + h])) {
|
||||||
if (SAME_OBJ(bucket, SYMTAB_LOST_CELL)) {
|
if (SAME_OBJ(bucket, SYMTAB_LOST_CELL)) {
|
||||||
|
@ -130,7 +128,7 @@ static Scheme_Object *symbol_bucket(Scheme_Hash_Table *table,
|
||||||
} else if (((int)length == SCHEME_SYM_LEN(bucket))
|
} else if (((int)length == SCHEME_SYM_LEN(bucket))
|
||||||
&& !memcmp(key, SCHEME_SYM_VAL(bucket), length))
|
&& !memcmp(key, SCHEME_SYM_VAL(bucket), length))
|
||||||
return bucket;
|
return bucket;
|
||||||
h = (h + h2) % table->size;
|
h = (h + h2) & mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* In case it's GC-misaligned: */
|
/* In case it's GC-misaligned: */
|
||||||
|
@ -155,9 +153,9 @@ static Scheme_Object *symbol_bucket(Scheme_Hash_Table *table,
|
||||||
lostc++;
|
lostc++;
|
||||||
}
|
}
|
||||||
if ((lostc * 2) < table->count)
|
if ((lostc * 2) < table->count)
|
||||||
table->step++;
|
newsize = oldsize << 1;
|
||||||
|
else
|
||||||
newsize = scheme_hash_primes[table->step];
|
newsize = oldsize;
|
||||||
|
|
||||||
asize = (size_t)newsize * sizeof(Scheme_Object *);
|
asize = (size_t)newsize * sizeof(Scheme_Object *);
|
||||||
{
|
{
|
||||||
|
@ -241,8 +239,7 @@ static Scheme_Hash_Table *init_one_symbol_table()
|
||||||
|
|
||||||
symbol_table = scheme_make_hash_table(SCHEME_hash_ptr);
|
symbol_table = scheme_make_hash_table(SCHEME_hash_ptr);
|
||||||
|
|
||||||
symbol_table->step = HASH_TABLE_SIZE_STEP;
|
symbol_table->size = HASH_TABLE_INIT_SIZE;
|
||||||
symbol_table->size = scheme_hash_primes[symbol_table->step];
|
|
||||||
|
|
||||||
size = symbol_table->size * sizeof(Scheme_Object *);
|
size = symbol_table->size * sizeof(Scheme_Object *);
|
||||||
#ifdef MZ_PRECISE_GC
|
#ifdef MZ_PRECISE_GC
|
||||||
|
|
|
@ -2201,7 +2201,7 @@ sub PrintBundleVar
|
||||||
$var = "&$var" unless $outgoing;
|
$var = "&$var" unless $outgoing;
|
||||||
&PrintBundleObject($var, $paramtype, $wvs);
|
&PrintBundleObject($var, $paramtype, $wvs);
|
||||||
} elsif (substr($paramtype, 0, 3) eq 'SYM') {
|
} elsif (substr($paramtype, 0, 3) eq 'SYM') {
|
||||||
$paramtype =~ /SYM\[(.*)\]/;
|
$paramtype =~ /SYMZ?\[(.*)\]/;
|
||||||
$symtype = $1;
|
$symtype = $1;
|
||||||
print "$wvs(bundle_symset_${symtype}($var))";
|
print "$wvs(bundle_symset_${symtype}($var))";
|
||||||
} else {
|
} else {
|
||||||
|
@ -2427,6 +2427,10 @@ sub PrintUnbundleVar
|
||||||
substr($paramtype, -1) = '';
|
substr($paramtype, -1) = '';
|
||||||
print "*" if ($outgoing);
|
print "*" if ($outgoing);
|
||||||
&PrintUnbundleObject("$var", $paramtype, 0, $mname);
|
&PrintUnbundleObject("$var", $paramtype, 0, $mname);
|
||||||
|
} elsif (substr($paramtype, 0, 4) eq 'SYMZ') {
|
||||||
|
$paramtype =~ /SYMZ\[(.*)\]/;
|
||||||
|
$symtype = $1;
|
||||||
|
print "WITH_VAR_STACK(unbundle_symset_${symtype}($var, NULL))";
|
||||||
} elsif (substr($paramtype, 0, 3) eq 'SYM') {
|
} elsif (substr($paramtype, 0, 3) eq 'SYM') {
|
||||||
$paramtype =~ /SYM\[(.*)\]/;
|
$paramtype =~ /SYM\[(.*)\]/;
|
||||||
$symtype = $1;
|
$symtype = $1;
|
||||||
|
@ -2798,7 +2802,7 @@ sub PrintTypecheck
|
||||||
substr($paramtype, -1) = '';
|
substr($paramtype, -1) = '';
|
||||||
&PrintTypecheckObj("$var", $paramtype, $stop);
|
&PrintTypecheckObj("$var", $paramtype, $stop);
|
||||||
} elsif (substr($paramtype, 0, 3) eq 'SYM') {
|
} elsif (substr($paramtype, 0, 3) eq 'SYM') {
|
||||||
$paramtype =~ /SYM\[(.*)\]/;
|
$paramtype =~ /SYMZ?\[(.*)\]/;
|
||||||
$symtype = $1;
|
$symtype = $1;
|
||||||
print "WITH_REMEMBERED_STACK(istype_symset_${symtype}($var, $stop))";
|
print "WITH_REMEMBERED_STACK(istype_symset_${symtype}($var, $stop))";
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -188,10 +188,11 @@ class wxKeyEvent: public wxEvent
|
||||||
int y ;
|
int y ;
|
||||||
long keyCode;
|
long keyCode;
|
||||||
long keyUpCode;
|
long keyUpCode;
|
||||||
|
long otherKeyCode;
|
||||||
Bool controlDown;
|
Bool controlDown;
|
||||||
Bool shiftDown;
|
Bool shiftDown;
|
||||||
Bool altDown;
|
Bool altDown;
|
||||||
Bool metaDown; //mflatt
|
Bool metaDown;
|
||||||
|
|
||||||
wxKeyEvent(WXTYPE keyType);
|
wxKeyEvent(WXTYPE keyType);
|
||||||
|
|
||||||
|
|
|
@ -429,7 +429,7 @@ void wxApp::doMacMouseUp(void)
|
||||||
theMouseEvent->metaDown = cCurrentEvent.modifiers & cmdKey;
|
theMouseEvent->metaDown = cCurrentEvent.modifiers & cmdKey;
|
||||||
theMouseEvent->x = hitX;
|
theMouseEvent->x = hitX;
|
||||||
theMouseEvent->y = hitY;
|
theMouseEvent->y = hitY;
|
||||||
theMouseEvent->timeStamp = SCALE_TIMESTAMP(cCurrentEvent.when); // mflatt
|
theMouseEvent->timeStamp = SCALE_TIMESTAMP(cCurrentEvent.when);
|
||||||
|
|
||||||
/* Grab is now only used for grabbing on mouse-down for canvases & panels: */
|
/* Grab is now only used for grabbing on mouse-down for canvases & panels: */
|
||||||
if (wxSubType(mouseWindow->__type, wxTYPE_CANVAS)
|
if (wxSubType(mouseWindow->__type, wxTYPE_CANVAS)
|
||||||
|
@ -472,7 +472,7 @@ void wxApp::doMacMouseUp(void)
|
||||||
theMouseEvent->metaDown = cCurrentEvent.modifiers & cmdKey;
|
theMouseEvent->metaDown = cCurrentEvent.modifiers & cmdKey;
|
||||||
theMouseEvent->x = hitX;
|
theMouseEvent->x = hitX;
|
||||||
theMouseEvent->y = hitY;
|
theMouseEvent->y = hitY;
|
||||||
theMouseEvent->timeStamp = SCALE_TIMESTAMP(cCurrentEvent.when); // mflatt
|
theMouseEvent->timeStamp = SCALE_TIMESTAMP(cCurrentEvent.when);
|
||||||
|
|
||||||
macWxFrame->SeekMouseEventArea(theMouseEvent, &metal_drag_ok);
|
macWxFrame->SeekMouseEventArea(theMouseEvent, &metal_drag_ok);
|
||||||
}
|
}
|
||||||
|
@ -497,7 +497,7 @@ void wxApp::doMacMouseMotion(void)
|
||||||
theMouseEvent->controlDown = FALSE;
|
theMouseEvent->controlDown = FALSE;
|
||||||
theMouseEvent->altDown = isAltKey;
|
theMouseEvent->altDown = isAltKey;
|
||||||
theMouseEvent->metaDown = cCurrentEvent.modifiers & cmdKey;
|
theMouseEvent->metaDown = cCurrentEvent.modifiers & cmdKey;
|
||||||
theMouseEvent->timeStamp = SCALE_TIMESTAMP(cCurrentEvent.when); // mflatt
|
theMouseEvent->timeStamp = SCALE_TIMESTAMP(cCurrentEvent.when);
|
||||||
|
|
||||||
if (wxWindow::gMouseWindow)
|
if (wxWindow::gMouseWindow)
|
||||||
{
|
{
|
||||||
|
@ -560,7 +560,7 @@ void wxApp::doMacMouseLeave(void)
|
||||||
theMouseEvent->controlDown = FALSE;
|
theMouseEvent->controlDown = FALSE;
|
||||||
theMouseEvent->altDown = isAltKey;
|
theMouseEvent->altDown = isAltKey;
|
||||||
theMouseEvent->metaDown = cCurrentEvent.modifiers & cmdKey;
|
theMouseEvent->metaDown = cCurrentEvent.modifiers & cmdKey;
|
||||||
theMouseEvent->timeStamp = SCALE_TIMESTAMP(cCurrentEvent.when); // mflatt
|
theMouseEvent->timeStamp = SCALE_TIMESTAMP(cCurrentEvent.when);
|
||||||
|
|
||||||
rc = (void *)cCurrentEvent.message;
|
rc = (void *)cCurrentEvent.message;
|
||||||
win = (wxWindow*)GET_SAFEREF(rc);
|
win = (wxWindow*)GET_SAFEREF(rc);
|
||||||
|
@ -601,7 +601,7 @@ void wxApp::doMacKeyUpDown(Bool down)
|
||||||
{
|
{
|
||||||
wxFrame* theMacWxFrame;
|
wxFrame* theMacWxFrame;
|
||||||
wxKeyEvent *theKeyEvent;
|
wxKeyEvent *theKeyEvent;
|
||||||
int key;
|
int key, otherKey = 0;
|
||||||
|
|
||||||
theMacWxFrame = findMacWxFrame(MrEdKeyWindow());
|
theMacWxFrame = findMacWxFrame(MrEdKeyWindow());
|
||||||
|
|
||||||
|
@ -742,16 +742,22 @@ void wxApp::doMacKeyUpDown(Bool down)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
|
int iter, akey, orig_key = key;
|
||||||
|
|
||||||
|
key = 0; /* let compiler know that key is assigned */
|
||||||
|
for (iter = 0; iter < ((cCurrentEvent.modifiers & cmdKey) ? 2 : 1); iter++) {
|
||||||
char cstr[3];
|
char cstr[3];
|
||||||
int from_str = 0;
|
int from_str = 0;
|
||||||
|
|
||||||
if (cCurrentEvent.modifiers & wxMacDisableMods) {
|
akey = orig_key;
|
||||||
|
|
||||||
|
if (cCurrentEvent.modifiers & (wxMacDisableMods | cmdKey)) {
|
||||||
/* The following code manually translates the virtual key event
|
/* The following code manually translates the virtual key event
|
||||||
into a character. We'd use this code all the time, except
|
into a character. We'd use this code all the time, except
|
||||||
that dead keys have already been filtered before we get here,
|
that dead keys have already been filtered before we get here,
|
||||||
which means that option-e-e doesn't produce an accented e.
|
which means that option-e-e doesn't produce an accented e.
|
||||||
So, instead, we only use this code to find out what would
|
So, instead, we only use this code to find out what would
|
||||||
happen if the control key weren't pressed. */
|
happen if the control/option key wasn't pressed. */
|
||||||
int mods;
|
int mods;
|
||||||
OSStatus status;
|
OSStatus status;
|
||||||
UniCharCount len;
|
UniCharCount len;
|
||||||
|
@ -759,8 +765,17 @@ void wxApp::doMacKeyUpDown(Bool down)
|
||||||
SInt16 currentKeyLayoutID;
|
SInt16 currentKeyLayoutID;
|
||||||
static UCKeyboardLayout *key_layout;
|
static UCKeyboardLayout *key_layout;
|
||||||
|
|
||||||
|
mods = cCurrentEvent.modifiers;
|
||||||
|
if (mods & cmdKey) {
|
||||||
|
/* Strip control and option modifiers when command is pressed: */
|
||||||
|
mods -= (mods & (optionKey | controlKey | cmdKey | shiftKey));
|
||||||
|
/* On second iteration, set the shift key: */
|
||||||
|
if (iter)
|
||||||
|
mods |= shiftKey;
|
||||||
|
} else {
|
||||||
/* Remove effect of anything in wxMacDisableMods: */
|
/* Remove effect of anything in wxMacDisableMods: */
|
||||||
mods = cCurrentEvent.modifiers - (cCurrentEvent.modifiers & wxMacDisableMods);
|
mods -= (mods & wxMacDisableMods);
|
||||||
|
}
|
||||||
|
|
||||||
currentKeyLayoutID = GetScriptVariable(GetScriptManagerVariable(smKeyScript), smScriptKeys);
|
currentKeyLayoutID = GetScriptVariable(GetScriptManagerVariable(smKeyScript), smScriptKeys);
|
||||||
if ((!uchrHandle && !KCHRHandle) || (currentKeyLayoutID != lastKeyLayoutID)) {
|
if ((!uchrHandle && !KCHRHandle) || (currentKeyLayoutID != lastKeyLayoutID)) {
|
||||||
|
@ -775,10 +790,10 @@ void wxApp::doMacKeyUpDown(Bool down)
|
||||||
|
|
||||||
if (!uchrHandle) {
|
if (!uchrHandle) {
|
||||||
if (!KCHRHandle) {
|
if (!KCHRHandle) {
|
||||||
key = '?';
|
akey = '?';
|
||||||
} else {
|
} else {
|
||||||
int trans;
|
int trans;
|
||||||
trans = KeyTranslate(*KCHRHandle, key | mods, &key_state);
|
trans = KeyTranslate(*KCHRHandle, akey | mods, &key_state);
|
||||||
if (trans & 0xFF0000) {
|
if (trans & 0xFF0000) {
|
||||||
/* 2-byte result */
|
/* 2-byte result */
|
||||||
cstr[0] = (trans & 0xFF0000) >> 16;
|
cstr[0] = (trans & 0xFF0000) >> 16;
|
||||||
|
@ -790,14 +805,14 @@ void wxApp::doMacKeyUpDown(Bool down)
|
||||||
cstr[1] = 0;
|
cstr[1] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
key = '?'; /* temporary */
|
akey = '?'; /* temporary */
|
||||||
from_str = 1;
|
from_str = 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
key_layout = (UCKeyboardLayout *)*uchrHandle;
|
key_layout = (UCKeyboardLayout *)*uchrHandle;
|
||||||
|
|
||||||
status = UCKeyTranslate(key_layout,
|
status = UCKeyTranslate(key_layout,
|
||||||
key,
|
akey,
|
||||||
cCurrentEvent.what - keyDown,
|
cCurrentEvent.what - keyDown,
|
||||||
mods >> 8,
|
mods >> 8,
|
||||||
LMGetKbdType(),
|
LMGetKbdType(),
|
||||||
|
@ -808,12 +823,12 @@ void wxApp::doMacKeyUpDown(Bool down)
|
||||||
keys);
|
keys);
|
||||||
|
|
||||||
if (status == noErr)
|
if (status == noErr)
|
||||||
key = keys[0];
|
akey = keys[0];
|
||||||
else
|
else
|
||||||
key = '?';
|
akey = '?';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
key = '?'; /* temporary */
|
akey = '?'; /* temporary */
|
||||||
cstr[0] = cCurrentEvent.message & charCodeMask;
|
cstr[0] = cCurrentEvent.message & charCodeMask;
|
||||||
cstr[1] = 0;
|
cstr[1] = 0;
|
||||||
from_str = 1;
|
from_str = 1;
|
||||||
|
@ -837,7 +852,13 @@ void wxApp::doMacKeyUpDown(Bool down)
|
||||||
} else
|
} else
|
||||||
keys[0] = '?';
|
keys[0] = '?';
|
||||||
|
|
||||||
key = keys[0];
|
akey = keys[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!iter)
|
||||||
|
key = akey;
|
||||||
|
else
|
||||||
|
otherKey = akey;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // end switch
|
} // end switch
|
||||||
|
@ -850,6 +871,7 @@ void wxApp::doMacKeyUpDown(Bool down)
|
||||||
theKeyEvent->keyCode = WXK_RELEASE;
|
theKeyEvent->keyCode = WXK_RELEASE;
|
||||||
theKeyEvent->keyUpCode = key;
|
theKeyEvent->keyUpCode = key;
|
||||||
}
|
}
|
||||||
|
theKeyEvent->otherKeyCode = otherKey;
|
||||||
|
|
||||||
{
|
{
|
||||||
wxWindow *in_win;
|
wxWindow *in_win;
|
||||||
|
@ -1152,7 +1174,7 @@ void wxApp::doMacContentClick(wxFrame* frame)
|
||||||
theMouseEvent->controlDown = FALSE;
|
theMouseEvent->controlDown = FALSE;
|
||||||
theMouseEvent->altDown = isAltKey;
|
theMouseEvent->altDown = isAltKey;
|
||||||
theMouseEvent->metaDown = cCurrentEvent.modifiers & cmdKey;
|
theMouseEvent->metaDown = cCurrentEvent.modifiers & cmdKey;
|
||||||
theMouseEvent->timeStamp = SCALE_TIMESTAMP(cCurrentEvent.when); // mflatt
|
theMouseEvent->timeStamp = SCALE_TIMESTAMP(cCurrentEvent.when);
|
||||||
|
|
||||||
hitX = cCurrentEvent.where.h; // screen window c.s.
|
hitX = cCurrentEvent.where.h; // screen window c.s.
|
||||||
hitY = cCurrentEvent.where.v; // screen window c.s.
|
hitY = cCurrentEvent.where.v; // screen window c.s.
|
||||||
|
@ -1354,3 +1376,80 @@ void wxPrimDialogCleanUp()
|
||||||
event.message = (long)w;
|
event.message = (long)w;
|
||||||
QueueMrEdEvent(&event);
|
QueueMrEdEvent(&event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------
|
||||||
|
|
||||||
|
int wxKeyCodeToVirtualKey(int wxk) {
|
||||||
|
switch (wxk) {
|
||||||
|
# define wxKEYF(code, wxk) case wxk: return code
|
||||||
|
wxKEYF(122, WXK_F1);
|
||||||
|
wxKEYF(120, WXK_F2);
|
||||||
|
wxKEYF(99, WXK_F3);
|
||||||
|
wxKEYF(118, WXK_F4);
|
||||||
|
wxKEYF(96, WXK_F5);
|
||||||
|
wxKEYF(97, WXK_F6);
|
||||||
|
wxKEYF(98, WXK_F7);
|
||||||
|
wxKEYF(100, WXK_F8);
|
||||||
|
wxKEYF(101, WXK_F9);
|
||||||
|
wxKEYF(109, WXK_F10);
|
||||||
|
wxKEYF(103, WXK_F11);
|
||||||
|
wxKEYF(111, WXK_F12);
|
||||||
|
wxKEYF(105, WXK_F13);
|
||||||
|
wxKEYF(107, WXK_F14);
|
||||||
|
wxKEYF(113, WXK_F15);
|
||||||
|
case WXK_UP:
|
||||||
|
return 0x7e;
|
||||||
|
case WXK_DOWN:
|
||||||
|
return 0x7d;
|
||||||
|
case WXK_LEFT:
|
||||||
|
return 0x7b;
|
||||||
|
case WXK_RIGHT:
|
||||||
|
return 0x7c;
|
||||||
|
case WXK_RETURN:
|
||||||
|
return 0x24;
|
||||||
|
case WXK_TAB:
|
||||||
|
return 0x30;
|
||||||
|
case WXK_BACK:
|
||||||
|
return 0x33;
|
||||||
|
case WXK_DELETE:
|
||||||
|
return 0x75;
|
||||||
|
case WXK_HOME:
|
||||||
|
return 0x73;
|
||||||
|
case WXK_END:
|
||||||
|
return 0x77;
|
||||||
|
case WXK_PRIOR:
|
||||||
|
return 0x74;
|
||||||
|
case WXK_NEXT:
|
||||||
|
return 0x79;
|
||||||
|
case WXK_ADD:
|
||||||
|
return 0x45;
|
||||||
|
case WXK_SUBTRACT:
|
||||||
|
return 78;
|
||||||
|
case WXK_MULTIPLY:
|
||||||
|
return 0x43;
|
||||||
|
case WXK_DIVIDE:
|
||||||
|
return 0x4B;
|
||||||
|
case WXK_SEPARATOR:
|
||||||
|
return 71;
|
||||||
|
case WXK_DECIMAL:
|
||||||
|
return 65;
|
||||||
|
case 3:
|
||||||
|
return 76;
|
||||||
|
case WXK_NUMPAD0:
|
||||||
|
case WXK_NUMPAD1:
|
||||||
|
case WXK_NUMPAD2:
|
||||||
|
case WXK_NUMPAD3:
|
||||||
|
case WXK_NUMPAD4:
|
||||||
|
case WXK_NUMPAD5:
|
||||||
|
case WXK_NUMPAD6:
|
||||||
|
case WXK_NUMPAD7:
|
||||||
|
return (wxk - WXK_NUMPAD0) + 82;
|
||||||
|
case WXK_NUMPAD8:
|
||||||
|
return 91;
|
||||||
|
case WXK_NUMPAD9:
|
||||||
|
return 92;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1189,7 +1189,7 @@ void wxGL::Reset(wxGLConfig *cfg, CGrafPtr gp, int offscreen, int w, int h)
|
||||||
aglSetDrawable(ctx, NULL);
|
aglSetDrawable(ctx, NULL);
|
||||||
aglDestroyContext(ctx);
|
aglDestroyContext(ctx);
|
||||||
|
|
||||||
gl_ctx = NULL;
|
gl_ctx = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gp) {
|
if (gp) {
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
int wxNumHelpItems;
|
int wxNumHelpItems;
|
||||||
MenuHandle wxHelpMenu;
|
MenuHandle wxHelpMenu;
|
||||||
|
|
||||||
|
extern int wxKeyCodeToVirtualKey(int wxk);
|
||||||
|
|
||||||
void wxSetUpAppleMenu(wxMenuBar *mbar);
|
void wxSetUpAppleMenu(wxMenuBar *mbar);
|
||||||
|
|
||||||
extern int wxCan_Do_Pref();
|
extern int wxCan_Do_Pref();
|
||||||
|
@ -219,10 +221,10 @@ wxMenu::~wxMenu(void)
|
||||||
// setupstr should be used with AppendItem; the result should then be used with SetMenuItemText
|
// setupstr should be used with AppendItem; the result should then be used with SetMenuItemText
|
||||||
// If stripCmds is TRUE, instead of replacing wxMenu string special chars,
|
// If stripCmds is TRUE, instead of replacing wxMenu string special chars,
|
||||||
// we delete them. This is appropriate for the menu text of a pulldown Menu.
|
// we delete them. This is appropriate for the menu text of a pulldown Menu.
|
||||||
char *wxBuildMacMenuString(StringPtr setupstr, char *itemName, Bool stripCmds)
|
char *wxBuildMacMenuString(StringPtr setupstr, char *itemName,
|
||||||
|
int *spc, int *modifiers, int *is_virt)
|
||||||
{
|
{
|
||||||
int s, d;
|
int s, d;
|
||||||
char spc = '\0';
|
|
||||||
char *showstr;
|
char *showstr;
|
||||||
|
|
||||||
showstr = copystring(itemName);
|
showstr = copystring(itemName);
|
||||||
|
@ -232,9 +234,27 @@ char *wxBuildMacMenuString(StringPtr setupstr, char *itemName, Bool stripCmds)
|
||||||
showstr[d++] = ' ';
|
showstr[d++] = ' ';
|
||||||
for (s = 0; itemName[s] != '\0'; ) {
|
for (s = 0; itemName[s] != '\0'; ) {
|
||||||
if (itemName[s] == '\t') {
|
if (itemName[s] == '\t') {
|
||||||
|
if (spc) {
|
||||||
s++;
|
s++;
|
||||||
if (strncmp("Cmd+", itemName + s, 4) == 0)
|
if (strncmp("Cmd+", itemName + s, 4) == 0) {
|
||||||
spc = itemName[s+4];
|
*spc = itemName[s+4];
|
||||||
|
*modifiers = 0;
|
||||||
|
*is_virt = 0;
|
||||||
|
}
|
||||||
|
if (strncmp("Cut=", itemName + s, 4) == 0) {
|
||||||
|
/* 1 byte for modfiers, then string version of a integer: */
|
||||||
|
int vk;
|
||||||
|
*modifiers = itemName[s+4] - 'A';
|
||||||
|
vk = strtol(itemName XFORM_OK_PLUS (s + 5), NULL, 10);
|
||||||
|
*spc = vk;
|
||||||
|
vk = wxKeyCodeToVirtualKey(*spc);
|
||||||
|
if (vk) {
|
||||||
|
*spc = vk;
|
||||||
|
*is_virt = 1;
|
||||||
|
} else
|
||||||
|
*is_virt = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -247,11 +267,6 @@ char *wxBuildMacMenuString(StringPtr setupstr, char *itemName, Bool stripCmds)
|
||||||
showstr = wxItemStripLabel(showstr);
|
showstr = wxItemStripLabel(showstr);
|
||||||
if (setupstr) {
|
if (setupstr) {
|
||||||
setupstr[1] = 'X'; // temporary menu item name
|
setupstr[1] = 'X'; // temporary menu item name
|
||||||
if (spc && !stripCmds) {
|
|
||||||
setupstr[2] = '/';
|
|
||||||
setupstr[3] = spc;
|
|
||||||
setupstr[0] = 3;
|
|
||||||
} else
|
|
||||||
setupstr[0] = 1;
|
setupstr[0] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -266,6 +281,7 @@ MenuHandle wxMenu::CreateCopy(char *title, Bool doabouthack, MenuHandle toHandle
|
||||||
int helpflg;
|
int helpflg;
|
||||||
int hId;
|
int hId;
|
||||||
int cnt;
|
int cnt;
|
||||||
|
int spc, modifiers, is_virt;
|
||||||
wxNode* node;
|
wxNode* node;
|
||||||
wxMenuItem* menuItem;
|
wxMenuItem* menuItem;
|
||||||
|
|
||||||
|
@ -300,6 +316,7 @@ MenuHandle wxMenu::CreateCopy(char *title, Bool doabouthack, MenuHandle toHandle
|
||||||
// Try to recreate from the wxMenuItem
|
// Try to recreate from the wxMenuItem
|
||||||
menuItem = (wxMenuItem*)node->Data();
|
menuItem = (wxMenuItem*)node->Data();
|
||||||
hId = 0;
|
hId = 0;
|
||||||
|
spc = 0;
|
||||||
if (menuItem->itemId == -1) {
|
if (menuItem->itemId == -1) {
|
||||||
// Separator
|
// Separator
|
||||||
title = "-";
|
title = "-";
|
||||||
|
@ -307,12 +324,12 @@ MenuHandle wxMenu::CreateCopy(char *title, Bool doabouthack, MenuHandle toHandle
|
||||||
tempString[1] = '-';
|
tempString[1] = '-';
|
||||||
} else if (menuItem->subMenu) {
|
} else if (menuItem->subMenu) {
|
||||||
wxMenu *subMenu;
|
wxMenu *subMenu;
|
||||||
title = wxBuildMacMenuString(tempString, menuItem->itemName, TRUE);
|
title = wxBuildMacMenuString(tempString, menuItem->itemName, NULL, NULL, NULL);
|
||||||
subMenu = menuItem->subMenu;
|
subMenu = menuItem->subMenu;
|
||||||
subMenu->wxMacInsertSubmenu();
|
subMenu->wxMacInsertSubmenu();
|
||||||
hId = subMenu->cMacMenuId;
|
hId = subMenu->cMacMenuId;
|
||||||
} else {
|
} else {
|
||||||
title = wxBuildMacMenuString(tempString, menuItem->itemName, FALSE);
|
title = wxBuildMacMenuString(tempString, menuItem->itemName, &spc, &modifiers, &is_virt);
|
||||||
if (!i && doabouthack && helpflg && (!strncmp("About", title, 5))) {
|
if (!i && doabouthack && helpflg && (!strncmp("About", title, 5))) {
|
||||||
if (menu_bar) {
|
if (menu_bar) {
|
||||||
// This is a very sad hack !
|
// This is a very sad hack !
|
||||||
|
@ -327,6 +344,10 @@ MenuHandle wxMenu::CreateCopy(char *title, Bool doabouthack, MenuHandle toHandle
|
||||||
::SetMenuItemTextWithCFString(nmh, i + offset, ct);
|
::SetMenuItemTextWithCFString(nmh, i + offset, ct);
|
||||||
CFRelease(ct);
|
CFRelease(ct);
|
||||||
}
|
}
|
||||||
|
if (spc) {
|
||||||
|
SetMenuItemCommandKey(nmh, i + offset, is_virt, spc);
|
||||||
|
SetMenuItemModifiers(nmh, i + offset, modifiers);
|
||||||
|
}
|
||||||
{
|
{
|
||||||
Bool v;
|
Bool v;
|
||||||
v = menuItem->IsChecked();
|
v = menuItem->IsChecked();
|
||||||
|
@ -809,6 +830,7 @@ void wxMenu::Append(int Id, char* Label, char* helpString, Bool checkable)
|
||||||
// assert(Id >= 1);
|
// assert(Id >= 1);
|
||||||
wxMenuItem* item;
|
wxMenuItem* item;
|
||||||
Str255 menusetup;
|
Str255 menusetup;
|
||||||
|
int spc = 0, modifiers, is_virt;
|
||||||
|
|
||||||
item = new WXGC_PTRS wxMenuItem(this, checkable);
|
item = new WXGC_PTRS wxMenuItem(this, checkable);
|
||||||
|
|
||||||
|
@ -818,7 +840,7 @@ void wxMenu::Append(int Id, char* Label, char* helpString, Bool checkable)
|
||||||
menuItems->Append(item);
|
menuItems->Append(item);
|
||||||
no_items ++;
|
no_items ++;
|
||||||
|
|
||||||
Label = wxBuildMacMenuString(menusetup, item->itemName, FALSE);
|
Label = wxBuildMacMenuString(menusetup, item->itemName, &spc, &modifiers, &is_virt);
|
||||||
wxPrepareMenuDraw();
|
wxPrepareMenuDraw();
|
||||||
::AppendMenu(cMacMenu, menusetup);
|
::AppendMenu(cMacMenu, menusetup);
|
||||||
{
|
{
|
||||||
|
@ -827,6 +849,10 @@ void wxMenu::Append(int Id, char* Label, char* helpString, Bool checkable)
|
||||||
::SetMenuItemTextWithCFString(cMacMenu, no_items, ct);
|
::SetMenuItemTextWithCFString(cMacMenu, no_items, ct);
|
||||||
CFRelease(ct);
|
CFRelease(ct);
|
||||||
}
|
}
|
||||||
|
if (spc) {
|
||||||
|
SetMenuItemCommandKey(cMacMenu, no_items, is_virt, spc);
|
||||||
|
SetMenuItemModifiers(cMacMenu, no_items, modifiers);
|
||||||
|
}
|
||||||
wxDoneMenuDraw();
|
wxDoneMenuDraw();
|
||||||
CheckHelpHack();
|
CheckHelpHack();
|
||||||
}
|
}
|
||||||
|
@ -859,7 +885,7 @@ void wxMenu::Append(int Id, char* Label, wxMenu* SubMenu, char* helpString)
|
||||||
menuItems->Append(item);
|
menuItems->Append(item);
|
||||||
no_items++;
|
no_items++;
|
||||||
|
|
||||||
Label = wxBuildMacMenuString(menusetup, item->itemName, TRUE);
|
Label = wxBuildMacMenuString(menusetup, item->itemName, NULL, NULL, NULL);
|
||||||
|
|
||||||
wxPrepareMenuDraw();
|
wxPrepareMenuDraw();
|
||||||
::AppendMenu(cMacMenu, menusetup);
|
::AppendMenu(cMacMenu, menusetup);
|
||||||
|
|
|
@ -13,7 +13,8 @@
|
||||||
#include "wx_utils.h"
|
#include "wx_utils.h"
|
||||||
#include "wx_mac_utils.h"
|
#include "wx_mac_utils.h"
|
||||||
|
|
||||||
extern char *wxBuildMacMenuString(StringPtr setupstr, char *itemName, Bool stripCmds);
|
extern char *wxBuildMacMenuString(StringPtr setupstr, char *itemName,
|
||||||
|
int *spc, int *modifiers, int *is_virt);
|
||||||
|
|
||||||
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
// Constructors
|
// Constructors
|
||||||
|
@ -146,20 +147,28 @@ void wxMenuItem::SetLabel(char* label)
|
||||||
Str255 tempString;
|
Str255 tempString;
|
||||||
char *s;
|
char *s;
|
||||||
MenuHandle nmh;
|
MenuHandle nmh;
|
||||||
|
int spc = 0, modifiers, is_virt;
|
||||||
|
|
||||||
nmh = parentMenu->MacMenu();
|
nmh = parentMenu->MacMenu();
|
||||||
|
|
||||||
s = wxBuildMacMenuString(tempString, label, 0);
|
s = wxBuildMacMenuString(tempString, label,
|
||||||
|
&spc, &modifiers, &is_virt);
|
||||||
|
|
||||||
/* Add item such the command keys are set */
|
/* Effectively clears shortcuts, if any: */
|
||||||
::DeleteMenuItem(nmh, macMenuItem);
|
::DeleteMenuItem(nmh, macMenuItem);
|
||||||
::InsertMenuItem(nmh, tempString, macMenuItem - 1);
|
::InsertMenuItem(nmh, tempString, macMenuItem - 1);
|
||||||
|
|
||||||
/* Install the real label */
|
/* Install the label */
|
||||||
ct = wxCFString(s);
|
ct = wxCFString(s);
|
||||||
::SetMenuItemTextWithCFString(nmh, macMenuItem, ct);
|
::SetMenuItemTextWithCFString(nmh, macMenuItem, ct);
|
||||||
CFRelease(ct);
|
CFRelease(ct);
|
||||||
|
|
||||||
|
/* Set the command key: */
|
||||||
|
if (spc) {
|
||||||
|
SetMenuItemCommandKey(nmh, macMenuItem, is_virt, spc);
|
||||||
|
SetMenuItemModifiers(nmh, macMenuItem, modifiers);
|
||||||
|
}
|
||||||
|
|
||||||
/* restore the submenu id, if any */
|
/* restore the submenu id, if any */
|
||||||
if (subMenu)
|
if (subMenu)
|
||||||
::SetMenuItemHierarchicalID(nmh, macMenuItem, subMenu->cMacMenuId);
|
::SetMenuItemHierarchicalID(nmh, macMenuItem, subMenu->cMacMenuId);
|
||||||
|
|
|
@ -183,6 +183,7 @@ class wxKeyEvent: public wxEvent
|
||||||
int y ;
|
int y ;
|
||||||
long keyCode;
|
long keyCode;
|
||||||
long keyUpCode;
|
long keyUpCode;
|
||||||
|
long otherKeyCode;
|
||||||
Bool controlDown;
|
Bool controlDown;
|
||||||
Bool shiftDown;
|
Bool shiftDown;
|
||||||
Bool altDown;
|
Bool altDown;
|
||||||
|
|
|
@ -129,4 +129,8 @@ int wxCharCodeWXToMSW(int id, Bool *IsVirtual);
|
||||||
int wxEventTrampoline(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam,
|
int wxEventTrampoline(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam,
|
||||||
LRESULT *res, WNDPROC proc);
|
LRESULT *res, WNDPROC proc);
|
||||||
|
|
||||||
|
extern wxKeyEvent *wxMakeCharEvent(BOOL just_check, WORD wParam, LPARAM lParam, Bool isASCII, Bool isRelease, HWND handle);
|
||||||
|
|
||||||
|
extern BOOL wxTranslateMessage(MSG *m);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -245,8 +245,6 @@ static int skip_next_return;
|
||||||
extern int wx_start_win_event(const char *who, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, int tramp, LONG *_retval);
|
extern int wx_start_win_event(const char *who, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, int tramp, LONG *_retval);
|
||||||
extern void wx_end_win_event(const char *who, HWND hWnd, UINT message, int tramp);
|
extern void wx_end_win_event(const char *who, HWND hWnd, UINT message, int tramp);
|
||||||
|
|
||||||
extern wxKeyEvent *wxMakeCharEvent(WORD wParam, LPARAM lParam, Bool isASCII, Bool isRelease, HWND handle);
|
|
||||||
|
|
||||||
LONG wxDoItemPres(wxItem *item, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam,
|
LONG wxDoItemPres(wxItem *item, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam,
|
||||||
long *result, int tramp)
|
long *result, int tramp)
|
||||||
{
|
{
|
||||||
|
@ -426,7 +424,7 @@ LONG wxDoItemPres(wxItem *item, HWND hWnd, UINT message, WPARAM wParam, LPARAM l
|
||||||
|
|
||||||
event = new wxKeyEvent(wxEVENT_TYPE_CHAR);
|
event = new wxKeyEvent(wxEVENT_TYPE_CHAR);
|
||||||
|
|
||||||
event = wxMakeCharEvent(wParam, lParam,
|
event = wxMakeCharEvent(FALSE, wParam, lParam,
|
||||||
((message == WM_CHAR) || (message == WM_SYSCHAR)),
|
((message == WM_CHAR) || (message == WM_SYSCHAR)),
|
||||||
FALSE, hWnd);
|
FALSE, hWnd);
|
||||||
|
|
||||||
|
|
|
@ -1128,18 +1128,9 @@ static LONG WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, in
|
||||||
wxUnhideCursor();
|
wxUnhideCursor();
|
||||||
retval = wnd->DefWindowProc(message, wParam, lParam);
|
retval = wnd->DefWindowProc(message, wParam, lParam);
|
||||||
}
|
}
|
||||||
case WM_KEYUP:
|
case WM_KEYUP: /* ^^^ fallthrough */
|
||||||
case WM_KEYDOWN: /* ^^^ fallthrough */
|
case WM_KEYDOWN: /* ^^^ fallthrough */
|
||||||
{
|
{
|
||||||
// Avoid duplicate messages to OnChar
|
|
||||||
if ((message == WM_KEYUP)
|
|
||||||
|| ((wParam != VK_ESCAPE)
|
|
||||||
&& (wParam != VK_SHIFT)
|
|
||||||
&& (wParam != VK_CONTROL)
|
|
||||||
&& (wParam != VK_SPACE)
|
|
||||||
&& (wParam != VK_RETURN)
|
|
||||||
&& (wParam != VK_TAB)
|
|
||||||
&& (wParam != VK_BACK)))
|
|
||||||
wnd->OnChar((WORD)wParam, lParam, FALSE, message == WM_KEYUP);
|
wnd->OnChar((WORD)wParam, lParam, FALSE, message == WM_KEYUP);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2011,122 +2002,75 @@ static int dot_scan_code;
|
||||||
|
|
||||||
static int generic_ascii_code[256];
|
static int generic_ascii_code[256];
|
||||||
|
|
||||||
|
static const char *find_shift_alts = "!@#$%^&*()_+-=\\|[]{}:\";',.<>/?~`";
|
||||||
|
static int shift_alt_key_codes[36], sakc_initialized;
|
||||||
|
|
||||||
#define THE_SCAN_CODE(lParam) ((((unsigned long)lParam) >> 16) & 0x1FF)
|
#define THE_SCAN_CODE(lParam) ((((unsigned long)lParam) >> 16) & 0x1FF)
|
||||||
|
|
||||||
wxKeyEvent *wxMakeCharEvent(WORD wParam, LPARAM lParam, Bool isASCII, Bool isRelease, HWND handle)
|
wxKeyEvent *wxMakeCharEvent(BOOL just_check, WORD wParam, LPARAM lParam, Bool isASCII, Bool isRelease, HWND handle)
|
||||||
{
|
{
|
||||||
int id;
|
int id, other_id = 0;
|
||||||
Bool tempControlDown;
|
Bool tempControlDown, tempAltDown;
|
||||||
|
|
||||||
tempControlDown = (::GetKeyState(VK_CONTROL) >> 1);
|
tempControlDown = (::GetKeyState(VK_CONTROL) >> 1);
|
||||||
|
tempAltDown = ((HIWORD(lParam) & KF_ALTDOWN) == KF_ALTDOWN);
|
||||||
|
|
||||||
if (isASCII) {
|
if (isASCII) {
|
||||||
int sc;
|
int sc;
|
||||||
|
|
||||||
// If 1 -> 26, translate to CTRL plus a letter.
|
|
||||||
id = wParam;
|
id = wParam;
|
||||||
if ((id > 0) && (id < 27) && tempControlDown) {
|
|
||||||
id = id + 96;
|
|
||||||
}
|
|
||||||
// Map id 28 to ctl+backslash
|
|
||||||
if (tempControlDown) {
|
|
||||||
switch (id) {
|
|
||||||
case 27:
|
|
||||||
id = '[';
|
|
||||||
break;
|
|
||||||
case 28:
|
|
||||||
id = '\\';
|
|
||||||
break;
|
|
||||||
case 29:
|
|
||||||
id = ']';
|
|
||||||
break;
|
|
||||||
case 30:
|
|
||||||
id = '^';
|
|
||||||
break;
|
|
||||||
case 31:
|
|
||||||
id = '_';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Ignore character created by numpad, since it's
|
/* Remember scan codes to help with some key-release events: */
|
||||||
already handled as WM_KEYDOWN */
|
|
||||||
sc = THE_SCAN_CODE(lParam);
|
sc = THE_SCAN_CODE(lParam);
|
||||||
if (sc) {
|
|
||||||
if ((id >= '0') && (id <= '9')) {
|
|
||||||
if (numpad_scan_codes[id - '0'] == sc)
|
|
||||||
id = -1;
|
|
||||||
} else if (id == '+') {
|
|
||||||
if (sc == plus_scan_code)
|
|
||||||
id = -1;
|
|
||||||
} else if (id == '-') {
|
|
||||||
if (sc == minus_scan_code)
|
|
||||||
id = -1;
|
|
||||||
} else if (id == '*') {
|
|
||||||
if (sc == times_scan_code)
|
|
||||||
id = -1;
|
|
||||||
} else if (id == '/') {
|
|
||||||
if (sc == divide_scan_code)
|
|
||||||
id = -1;
|
|
||||||
} else if (id == '.') {
|
|
||||||
if (sc == dot_scan_code)
|
|
||||||
id = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((id >= 0) && (id <= 255))
|
if ((id >= 0) && (id <= 255))
|
||||||
generic_ascii_code[id] = sc;
|
generic_ascii_code[id] = sc;
|
||||||
} else {
|
} else {
|
||||||
|
int override_mapping = (tempControlDown && !tempAltDown);
|
||||||
|
|
||||||
if ((id = wxCharCodeMSWToWX(wParam)) == 0) {
|
if ((id = wxCharCodeMSWToWX(wParam)) == 0) {
|
||||||
if (tempControlDown) {
|
if (override_mapping || isRelease) {
|
||||||
int sd;
|
int j;
|
||||||
sd = (::GetKeyState(VK_SHIFT) >> 1);
|
|
||||||
switch(wParam) {
|
id = MapVirtualKey(wParam, 2);
|
||||||
case VK_OEM_1:
|
id &= 0xFFFF;
|
||||||
id = (sd ? ':' : ';');
|
if (!id)
|
||||||
break;
|
|
||||||
case VK_OEM_2:
|
|
||||||
id = (sd ? '|' : -1);
|
|
||||||
break;
|
|
||||||
case VK_OEM_3:
|
|
||||||
id = (sd ? '~' : '`');
|
|
||||||
break;
|
|
||||||
case VK_OEM_7:
|
|
||||||
id = (sd ? '"' : '\'');
|
|
||||||
break;
|
|
||||||
case VK_OEM_PLUS:
|
|
||||||
id = (sd ? '+' : '=');
|
|
||||||
break;
|
|
||||||
case VK_OEM_MINUS:
|
|
||||||
id = (sd ? -1 : '-');
|
|
||||||
break;
|
|
||||||
case VK_OEM_PERIOD:
|
|
||||||
id = (sd ? '>' : '.');
|
|
||||||
break;
|
|
||||||
case VK_OEM_COMMA:
|
|
||||||
id = (sd ? '<' : ',');
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
id = -1;
|
id = -1;
|
||||||
|
else if (id < 128)
|
||||||
|
id = tolower(id);
|
||||||
|
|
||||||
|
/* Look for shifted alternate: */
|
||||||
|
if (!sakc_initialized) {
|
||||||
|
for (j = 0; find_shift_alts[j]; j++) {
|
||||||
|
shift_alt_key_codes[j] = VkKeyScan(find_shift_alts[j]) & 0xFF;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
for (j = 0; find_shift_alts[j]; j++) {
|
||||||
|
if (shift_alt_key_codes[j] == wParam) {
|
||||||
|
if (find_shift_alts[j] != id) {
|
||||||
|
other_id = find_shift_alts[j];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} else
|
} else
|
||||||
id = -1;
|
id = -1;
|
||||||
|
} else {
|
||||||
|
/* Don't generat control-key down events: */
|
||||||
|
if (!isRelease && (wParam == VK_CONTROL))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if (!override_mapping && !isRelease) {
|
||||||
|
/* Let these get translated to WM_CHAR or skipped
|
||||||
|
entirely: */
|
||||||
|
if ((wParam == VK_ESCAPE)
|
||||||
|
|| (wParam == VK_SHIFT)
|
||||||
|
|| (wParam == VK_CONTROL)
|
||||||
|
|| (wParam == VK_SPACE)
|
||||||
|
|| (wParam == VK_RETURN)
|
||||||
|
|| (wParam == VK_TAB)
|
||||||
|
|| (wParam == VK_BACK))
|
||||||
|
id = -1;
|
||||||
}
|
}
|
||||||
if ((id >= WXK_NUMPAD0) && (id <= WXK_NUMPAD9)) {
|
|
||||||
/* remember scan code so we can ignore the WM_CHAR part */
|
|
||||||
numpad_scan_codes[id - WXK_NUMPAD0] = THE_SCAN_CODE(lParam);
|
|
||||||
} else if (id == WXK_ADD) {
|
|
||||||
plus_scan_code = THE_SCAN_CODE(lParam);
|
|
||||||
} else if (id == WXK_SUBTRACT) {
|
|
||||||
minus_scan_code = THE_SCAN_CODE(lParam);
|
|
||||||
} else if (id == WXK_MULTIPLY) {
|
|
||||||
times_scan_code = THE_SCAN_CODE(lParam);
|
|
||||||
} else if (id == WXK_DIVIDE) {
|
|
||||||
divide_scan_code = THE_SCAN_CODE(lParam);
|
|
||||||
} else if (id == WXK_DECIMAL) {
|
|
||||||
dot_scan_code = THE_SCAN_CODE(lParam);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isRelease && (id < 0)) {
|
if (isRelease && (id < 0)) {
|
||||||
|
@ -2136,10 +2080,16 @@ wxKeyEvent *wxMakeCharEvent(WORD wParam, LPARAM lParam, Bool isASCII, Bool isRel
|
||||||
for (i = 0; i < 256; i++) {
|
for (i = 0; i < 256; i++) {
|
||||||
if (generic_ascii_code[i] == sc) {
|
if (generic_ascii_code[i] == sc) {
|
||||||
id = i;
|
id = i;
|
||||||
|
if (id < 127)
|
||||||
|
id = tolower(id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (id < 0) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (id > -1) {
|
if (id > -1) {
|
||||||
|
@ -2147,18 +2097,22 @@ wxKeyEvent *wxMakeCharEvent(WORD wParam, LPARAM lParam, Bool isASCII, Bool isRel
|
||||||
RECT rect;
|
RECT rect;
|
||||||
wxKeyEvent *event;
|
wxKeyEvent *event;
|
||||||
|
|
||||||
|
if (just_check)
|
||||||
|
return (wxKeyEvent *)0x1;
|
||||||
|
|
||||||
event = new wxKeyEvent(wxEVENT_TYPE_CHAR);
|
event = new wxKeyEvent(wxEVENT_TYPE_CHAR);
|
||||||
|
|
||||||
if (::GetKeyState(VK_SHIFT) >> 1)
|
if (::GetKeyState(VK_SHIFT) >> 1)
|
||||||
event->shiftDown = TRUE;
|
event->shiftDown = TRUE;
|
||||||
if (tempControlDown)
|
if (tempControlDown)
|
||||||
event->controlDown = TRUE;
|
event->controlDown = TRUE;
|
||||||
if ((HIWORD(lParam) & KF_ALTDOWN) == KF_ALTDOWN)
|
if (tempAltDown)
|
||||||
event->metaDown = TRUE;
|
event->metaDown = TRUE;
|
||||||
|
|
||||||
event->keyCode = (isRelease ? WXK_RELEASE : id);
|
event->keyCode = (isRelease ? WXK_RELEASE : id);
|
||||||
event->keyUpCode = (isRelease ? id : WXK_PRESS);
|
event->keyUpCode = (isRelease ? id : WXK_PRESS);
|
||||||
event->SetTimestamp(last_msg_time); /* MATTHEW: timeStamp */
|
event->otherKeyCode = other_id;
|
||||||
|
event->SetTimestamp(last_msg_time);
|
||||||
|
|
||||||
GetCursorPos(&pt);
|
GetCursorPos(&pt);
|
||||||
GetWindowRect(handle,&rect);
|
GetWindowRect(handle,&rect);
|
||||||
|
@ -2173,11 +2127,23 @@ wxKeyEvent *wxMakeCharEvent(WORD wParam, LPARAM lParam, Bool isASCII, Bool isRel
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL wxTranslateMessage(MSG *m)
|
||||||
|
{
|
||||||
|
if ((m->message == WM_KEYDOWN) || (m->message == WM_SYSKEYDOWN)
|
||||||
|
|| (m->message == WM_KEYUP) || (m->message == WM_SYSKEYUP))
|
||||||
|
if (!wxMakeCharEvent(TRUE, m->wParam, m->lParam, FALSE,
|
||||||
|
(m->message == WM_KEYUP) || (m->message == WM_SYSKEYUP),
|
||||||
|
m->hwnd))
|
||||||
|
return TranslateMessage(m);
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
void wxWnd::OnChar(WORD wParam, LPARAM lParam, Bool isASCII, Bool isRelease)
|
void wxWnd::OnChar(WORD wParam, LPARAM lParam, Bool isASCII, Bool isRelease)
|
||||||
{
|
{
|
||||||
wxKeyEvent *event;
|
wxKeyEvent *event;
|
||||||
|
|
||||||
event = wxMakeCharEvent(wParam, lParam, isASCII, isRelease, handle);
|
event = wxMakeCharEvent(FALSE, wParam, lParam, isASCII, isRelease, handle);
|
||||||
|
|
||||||
if (event && wx_window) {
|
if (event && wx_window) {
|
||||||
if (!wx_window->CallPreOnChar(wx_window->PreWindow(), event))
|
if (!wx_window->CallPreOnChar(wx_window->PreWindow(), event))
|
||||||
|
|
|
@ -128,6 +128,7 @@ class wxKeyEvent: public wxEvent
|
||||||
int y ;
|
int y ;
|
||||||
long keyCode;
|
long keyCode;
|
||||||
long keyUpCode;
|
long keyUpCode;
|
||||||
|
long otherKeyCode;
|
||||||
Bool controlDown;
|
Bool controlDown;
|
||||||
Bool shiftDown;
|
Bool shiftDown;
|
||||||
Bool altDown;
|
Bool altDown;
|
||||||
|
|
|
@ -58,6 +58,8 @@
|
||||||
static Atom utf8_atom = 0, net_wm_name_atom, net_wm_icon_name_atom;
|
static Atom utf8_atom = 0, net_wm_name_atom, net_wm_icon_name_atom;
|
||||||
|
|
||||||
extern void wxSetSensitive(Widget, Bool enabled);
|
extern void wxSetSensitive(Widget, Bool enabled);
|
||||||
|
extern int wxLocaleStringToChar(char *str, int slen);
|
||||||
|
extern int wxUTF8StringToChar(char *str, int slen);
|
||||||
|
|
||||||
static wxWindow *grabbing_panel;
|
static wxWindow *grabbing_panel;
|
||||||
static Time grabbing_panel_time;
|
static Time grabbing_panel_time;
|
||||||
|
@ -1571,12 +1573,73 @@ extern Bool wxIsAlt(KeySym key_sym);
|
||||||
static XComposeStatus compose_status;
|
static XComposeStatus compose_status;
|
||||||
#ifndef NO_XMB_LOOKUP_STRING
|
#ifndef NO_XMB_LOOKUP_STRING
|
||||||
# define XMB_KC_STATUS(status) (status == XLookupKeySym) || (status == XLookupBoth)
|
# define XMB_KC_STATUS(status) (status == XLookupKeySym) || (status == XLookupBoth)
|
||||||
|
# define XMB_STR_STATUS(status) (status == XLookupChars) || (status == XLookupBoth)
|
||||||
# define DEFAULT_XMB_STATUS XLookupKeySym
|
# define DEFAULT_XMB_STATUS XLookupKeySym
|
||||||
|
# ifdef X_HAVE_UTF8_STRING
|
||||||
|
# define X___LookupString Xutf8LookupString
|
||||||
|
# else
|
||||||
|
# define X___LookupString XmbLookupString
|
||||||
|
# endif
|
||||||
#else
|
#else
|
||||||
# define XMB_KC_STATUS(status) (status)
|
# define XMB_KC_STATUS(status) (status)
|
||||||
|
# define XMB_STR_STATUS(status) 0
|
||||||
# define DEFAULT_XMB_STATUS 1
|
# define DEFAULT_XMB_STATUS 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
Status wxWindow::LookupKey(int unshifted, Widget w, wxWindow *win, XEvent *xev, KeySym *_keysym, char *str, int *_len)
|
||||||
|
{
|
||||||
|
KeySym keysym;
|
||||||
|
Status status;
|
||||||
|
int len;
|
||||||
|
XKeyPressedEvent evt;
|
||||||
|
|
||||||
|
memcpy(&evt, &(xev->xkey), sizeof(XKeyPressedEvent));
|
||||||
|
if (unshifted) {
|
||||||
|
if (evt.state & ShiftMask)
|
||||||
|
evt.state -= ShiftMask;
|
||||||
|
else
|
||||||
|
evt.state |= ShiftMask;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef NO_XMB_LOOKUP_STRING
|
||||||
|
if (!the_im) {
|
||||||
|
the_im = XOpenIM(wxAPP_DISPLAY, NULL, NULL, NULL);
|
||||||
|
}
|
||||||
|
if (the_im) {
|
||||||
|
if (!win->X->ic) {
|
||||||
|
win->X->ic = XCreateIC(the_im,
|
||||||
|
XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
|
||||||
|
NULL);
|
||||||
|
win->X->us_ic = XCreateIC(the_im,
|
||||||
|
XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (win->X->ic && (xev->xany.type == KeyPress)) {
|
||||||
|
XIC ic;
|
||||||
|
ic = unshifted ? win->X->ic : win->X->ic;
|
||||||
|
XSetICValues(ic,
|
||||||
|
XNClientWindow, XtWindow(w),
|
||||||
|
XNFocusWindow, XtWindow(w),
|
||||||
|
NULL);
|
||||||
|
XSetICFocus(ic);
|
||||||
|
|
||||||
|
len = X___LookupString(ic, &evt, str, 10, &keysym, &status);
|
||||||
|
} else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
(void)XLookupString(&evt, str, 10, &keysym, &compose_status);
|
||||||
|
status = DEFAULT_XMB_STATUS;
|
||||||
|
len = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
*_len = len;
|
||||||
|
*_keysym = keysym;
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
void wxWindow::WindowEventHandler(Widget w,
|
void wxWindow::WindowEventHandler(Widget w,
|
||||||
wxWindow **winp,
|
wxWindow **winp,
|
||||||
XEvent *xev,
|
XEvent *xev,
|
||||||
|
@ -1639,38 +1702,16 @@ void wxWindow::WindowEventHandler(Widget w,
|
||||||
win->current_state = xev->xkey.state;
|
win->current_state = xev->xkey.state;
|
||||||
{ /* ^^^ fallthrough !!!! ^^^ */
|
{ /* ^^^ fallthrough !!!! ^^^ */
|
||||||
wxKeyEvent *wxevent;
|
wxKeyEvent *wxevent;
|
||||||
KeySym keysym;
|
KeySym keysym, other_keysym;
|
||||||
long kc;
|
long kc, other_kc;
|
||||||
Status status;
|
Status status, other_status;
|
||||||
char str[10];
|
char str[10], other_str[10];
|
||||||
|
int slen, other_slen;
|
||||||
|
|
||||||
wxevent = new wxKeyEvent(wxEVENT_TYPE_CHAR);
|
wxevent = new wxKeyEvent(wxEVENT_TYPE_CHAR);
|
||||||
|
|
||||||
#ifndef NO_XMB_LOOKUP_STRING
|
status = LookupKey(0, w, win, xev, &keysym, str, &slen);
|
||||||
if (!the_im) {
|
other_status = LookupKey(1, w, win, xev, &other_keysym, other_str, &other_slen);
|
||||||
the_im = XOpenIM(wxAPP_DISPLAY, NULL, NULL, NULL);
|
|
||||||
}
|
|
||||||
if (!win->X->ic) {
|
|
||||||
if (the_im) {
|
|
||||||
win->X->ic = XCreateIC(the_im,
|
|
||||||
XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
|
|
||||||
NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (win->X->ic && (xev->xany.type == KeyPress)) {
|
|
||||||
XSetICValues(win->X->ic,
|
|
||||||
XNClientWindow, XtWindow(w),
|
|
||||||
XNFocusWindow, XtWindow(w),
|
|
||||||
NULL);
|
|
||||||
XSetICFocus(win->X->ic);
|
|
||||||
(void)XmbLookupString(win->X->ic, &(xev->xkey), str, 10, &keysym, &status);
|
|
||||||
} else
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
(void)XLookupString(&(xev->xkey), str, 10, &keysym, &compose_status);
|
|
||||||
status = DEFAULT_XMB_STATUS;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (xev->xany.type == KeyPress) {
|
if (xev->xany.type == KeyPress) {
|
||||||
static int handle_alt = 0;
|
static int handle_alt = 0;
|
||||||
|
@ -1689,15 +1730,39 @@ void wxWindow::WindowEventHandler(Widget w,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (XMB_KC_STATUS(status))
|
if (XMB_STR_STATUS(status)) {
|
||||||
|
if (slen > 9)
|
||||||
|
slen = 9;
|
||||||
|
str[slen] = 0;
|
||||||
|
#ifdef X_HAVE_UTF8_STRING
|
||||||
|
kc = wxUTF8StringToChar(str, slen);
|
||||||
|
#else
|
||||||
|
kc = wxLocaleStringToChar(str, slen);
|
||||||
|
#endif
|
||||||
|
} else if (XMB_KC_STATUS(status))
|
||||||
kc = CharCodeXToWX(keysym);
|
kc = CharCodeXToWX(keysym);
|
||||||
else
|
else
|
||||||
kc = 0;
|
kc = 0;
|
||||||
|
|
||||||
|
if (XMB_STR_STATUS(other_status)) {
|
||||||
|
if (other_slen > 9)
|
||||||
|
other_slen = 9;
|
||||||
|
other_str[other_slen] = 0;
|
||||||
|
#ifdef X_HAVE_UTF8_STRING
|
||||||
|
other_kc = wxUTF8StringToChar(other_str, other_slen);
|
||||||
|
#else
|
||||||
|
other_kc = wxLocaleStringToChar(other_str, other_slen);
|
||||||
|
#endif
|
||||||
|
} else if (XMB_KC_STATUS(other_status))
|
||||||
|
other_kc = CharCodeXToWX(other_keysym);
|
||||||
|
else
|
||||||
|
other_kc = 0;
|
||||||
|
|
||||||
// set wxWindows event structure
|
// set wxWindows event structure
|
||||||
wxevent->eventHandle = (char*)xev;
|
wxevent->eventHandle = (char*)xev;
|
||||||
wxevent->keyCode = (xev->xany.type == KeyPress) ? kc : WXK_RELEASE;
|
wxevent->keyCode = (xev->xany.type == KeyPress) ? kc : WXK_RELEASE;
|
||||||
wxevent->keyUpCode = (xev->xany.type == KeyRelease) ? kc : WXK_PRESS;
|
wxevent->keyUpCode = (xev->xany.type == KeyRelease) ? kc : WXK_PRESS;
|
||||||
|
wxevent->otherKeyCode = other_kc;
|
||||||
wxevent->x = xev->xkey.x;
|
wxevent->x = xev->xkey.x;
|
||||||
wxevent->y = xev->xkey.y;
|
wxevent->y = xev->xkey.y;
|
||||||
wxevent->altDown = /* xev->xkey.state & Mod3Mask */ FALSE;
|
wxevent->altDown = /* xev->xkey.state & Mod3Mask */ FALSE;
|
||||||
|
|
|
@ -44,6 +44,7 @@ public:
|
||||||
unsigned int last_clickbutton; // if a double click has arrived
|
unsigned int last_clickbutton; // if a double click has arrived
|
||||||
#ifndef NO_XMB_LOOKUP_STRING
|
#ifndef NO_XMB_LOOKUP_STRING
|
||||||
XIC ic;
|
XIC ic;
|
||||||
|
XIC us_ic;
|
||||||
XIM im;
|
XIM im;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@ -192,6 +193,7 @@ protected:
|
||||||
static void WindowEventHandler(Widget w, wxWindow **win,
|
static void WindowEventHandler(Widget w, wxWindow **win,
|
||||||
XEvent *ev, Boolean *continue_to_dispatch_return);
|
XEvent *ev, Boolean *continue_to_dispatch_return);
|
||||||
static void ScrollEventHandler(Widget w, wxWindow **win, XtPointer p_XfwfScrollInfo);
|
static void ScrollEventHandler(Widget w, wxWindow **win, XtPointer p_XfwfScrollInfo);
|
||||||
|
static Status wxWindow::LookupKey(int unshifted, Widget w, wxWindow *win, XEvent *xev, KeySym *_keysym, char *s, int *_len);
|
||||||
void RegisterAll(Widget ww);
|
void RegisterAll(Widget ww);
|
||||||
# endif
|
# endif
|
||||||
protected:
|
protected:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user