svn: r4659
This commit is contained in:
Matthew Flatt 2006-10-20 13:56:06 +00:00
parent b433ce9a55
commit 1a994b9341
14 changed files with 1599 additions and 869 deletions

View File

@ -2106,6 +2106,20 @@ void MrEdQueueZoom(wxWindow *wx_window)
MrEdQueueWindowCallback(wx_window, CAST_SCP call_zoom, wx_window);
}
static Scheme_Object *call_toolbar(void *d, int, Scheme_Object **argv)
{
wxFrame *w = (wxFrame *)d;
w->OnToolbarButton();
return scheme_void;
}
void MrEdQueueToolbar(wxWindow *wx_window)
{
MrEdQueueWindowCallback(wx_window, CAST_SCP call_toolbar, wx_window);
}
static Scheme_Object *call_on_size(void *d, int, Scheme_Object **argv)
{
wxWindow *w = (wxWindow *)d;

View File

@ -383,6 +383,7 @@ scheme_os_setcwd
scheme_getdrive
scheme_split_path
scheme_build_path
scheme_path_to_directory_path
scheme_make_path
scheme_make_sized_path
scheme_make_sized_offset_path

View File

@ -390,6 +390,7 @@ scheme_os_setcwd
scheme_getdrive
scheme_split_path
scheme_build_path
scheme_path_to_directory_path
scheme_make_path
scheme_make_sized_path
scheme_make_sized_offset_path

View File

@ -375,6 +375,7 @@ EXPORTS
scheme_getdrive
scheme_split_path
scheme_build_path
scheme_path_to_directory_path
scheme_make_path
scheme_make_sized_path
scheme_make_sized_offset_path

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1475,81 +1475,138 @@ static int regcharclass(int c, char *map)
return 1;
}
static int is_posix_char_class(int pos, char *map)
static int is_posix_char_class(char *str, int pos, int len, char *map)
{
int c;
if (!scheme_strncmp(":alnum:", regparsestr XFORM_OK_PLUS pos, 7)) {
regcharclass('d', map);
for (c = 'a'; c <= 'z'; c++) {
map[c] = 1;
map[c - ('a' - 'A')] = 1;
if (pos + 8 <= len) {
if (!scheme_strncmp(":alnum:]", str XFORM_OK_PLUS pos, 8)) {
if (map) {
regcharclass('d', map);
for (c = 'a'; c <= 'z'; c++) {
map[c] = 1;
map[c - ('a' - 'A')] = 1;
}
}
return 1;
} else if (!scheme_strncmp(":alpha:]", str XFORM_OK_PLUS pos, 8)) {
if (map) {
for (c = 'a'; c <= 'z'; c++) {
map[c] = 1;
map[c - ('a' - 'A')] = 1;
}
}
return 1;
} else if (!scheme_strncmp(":ascii:]", str XFORM_OK_PLUS pos, 8)) {
if (map) {
for (c = 0; c <= 127; c++) {
map[c] = 1;
}
}
return 1;
} else if (!scheme_strncmp(":blank:]", str XFORM_OK_PLUS pos, 8)) {
if (map) {
map[' '] = 1;
map['\t'] = 1;
}
return 1;
} else if (!scheme_strncmp(":cntrl:]", str XFORM_OK_PLUS pos, 8)) {
if (map) {
for (c = 0; c <= 31; c++) {
map[c] = 1;
}
}
return 1;
} else if (!scheme_strncmp(":digit:]", str XFORM_OK_PLUS pos, 8)) {
if (map) {
regcharclass('d', map);
}
return 1;
} else if (!scheme_strncmp(":graph:]", str XFORM_OK_PLUS pos, 8)) {
if (map) {
for (c = 0; c <= 127; c++) {
if (scheme_isgraphic(c))
map[c] = 1;
}
}
return 1;
} else if (!scheme_strncmp(":lower:]", str XFORM_OK_PLUS pos, 8)) {
if (map) {
for (c = 'a'; c <= 'z'; c++) {
map[c] = 1;
}
}
return 1;
} else if (!scheme_strncmp(":print:]", str XFORM_OK_PLUS pos, 8)) {
if (map) {
for (c = 0; c <= 127; c++) {
if (scheme_isgraphic(c))
map[c] = 1;
}
map[' '] = 1;
map['\t'] = 1;
}
return 1;
} else if (!scheme_strncmp(":space:]", str XFORM_OK_PLUS pos, 8)) {
if (map) {
regcharclass('s', map);
}
return 1;
} else if (!scheme_strncmp(":upper:]", str XFORM_OK_PLUS pos, 8)) {
if (map) {
for (c = 'A'; c <= 'Z'; c++) {
map[c] = 1;
}
}
return 1;
}
}
if ((pos + 7 <= len)
&& !scheme_strncmp(":word:]", str XFORM_OK_PLUS pos, 7)) {
if (map) {
regcharclass('w', map);
}
return 1;
} else if (!scheme_strncmp(":alpha:", regparsestr XFORM_OK_PLUS pos, 7)) {
for (c = 'a'; c <= 'z'; c++) {
map[c] = 1;
map[c - ('a' - 'A')] = 1;
}
return 1;
} else if (!scheme_strncmp(":ascii:", regparsestr XFORM_OK_PLUS pos, 7)) {
for (c = 0; c <= 127; c++) {
map[c] = 1;
}
return 1;
} else if (!scheme_strncmp(":blank:", regparsestr XFORM_OK_PLUS pos, 7)) {
map[' '] = 1;
map['\t'] = 1;
return 1;
} else if (!scheme_strncmp(":cntrl:", regparsestr XFORM_OK_PLUS pos, 7)) {
for (c = 0; c <= 31; c++) {
map[c] = 1;
}
return 1;
} else if (!scheme_strncmp(":digit:", regparsestr XFORM_OK_PLUS pos, 7)) {
regcharclass('d', map);
return 1;
} else if (!scheme_strncmp(":graph:", regparsestr XFORM_OK_PLUS pos, 7)) {
for (c = 0; c <= 127; c++) {
if (scheme_isgraphic(c))
map[c] = 1;
}
return 1;
} else if (!scheme_strncmp(":lower:", regparsestr XFORM_OK_PLUS pos, 7)) {
for (c = 'a'; c <= 'z'; c++) {
map[c] = 1;
}
return 1;
} else if (!scheme_strncmp(":print:", regparsestr XFORM_OK_PLUS pos, 7)) {
for (c = 0; c <= 127; c++) {
if (scheme_isgraphic(c))
map[c] = 1;
}
map[' '] = 1;
map['\t'] = 1;
return 1;
} else if (!scheme_strncmp(":space:", regparsestr XFORM_OK_PLUS pos, 7)) {
regcharclass('s', map);
return 1;
} else if (!scheme_strncmp(":upper:", regparsestr XFORM_OK_PLUS pos, 7)) {
for (c = 'A'; c <= 'Z'; c++) {
map[c] = 1;
}
return 1;
} else if (!scheme_strncmp(":word:", regparsestr XFORM_OK_PLUS pos, 6)) {
regcharclass('w', map);
return 1;
} else if (!scheme_strncmp(":xdigit:", regparsestr XFORM_OK_PLUS pos, 8)) {
regcharclass('d', map);
for (c = 'a'; c <= 'f'; c++) {
map[c] = 1;
map[c - ('a' - 'A')] = 1;
}
if ((pos + 9 <= len)
&& !scheme_strncmp(":xdigit:]", str XFORM_OK_PLUS pos, 9)) {
if (map) {
regcharclass('d', map);
for (c = 'a'; c <= 'f'; c++) {
map[c] = 1;
map[c - ('a' - 'A')] = 1;
}
}
return 1;
}
return 0;
}
static int is_posix_char_class_in_unicode(mzchar *str, int pos, int len, char *map)
{
int ulen;
int i;
char buf[10];
if (pos + 7 > len)
return 0;
ulen = len - pos;
if (ulen > 9)
ulen = 9;
for (i = 0; i < ulen; i++) {
if (str[pos + i] > 127)
return 0;
buf[i] = (char)str[pos + i];
}
return is_posix_char_class(buf, 0, ulen, map);
}
static char *regrange(int parse_flags, char *map)
/* [ is already consumed; result is an array of 256 bytes of included chars */
{
@ -1622,7 +1679,7 @@ static char *regrange(int parse_flags, char *map)
} else if ((regparsestr[regparse] == '[')
&& (parse_flags & PARSE_PCRE)
&& (regparsestr[regparse+1] == ':')
&& is_posix_char_class(regparse + 1, map)) {
&& is_posix_char_class(regparsestr, regparse + 1, regparse_end, map)) {
regparse += 2;
while (regparsestr[regparse] != ']') {
regparse++;
@ -4135,8 +4192,17 @@ static int translate(unsigned char *s, int len, char **result, int pcre)
while ((k < len) && (s[k] != ']')) {
if (s[k] > 127)
saw_big = 1;
if (pcre && (s[k] == '\\') && (k + 1 < len))
else if (pcre && (s[k] == '\\') && (k + 1 < len))
k++;
else if (pcre
&& (s[k] == '[')
&& (k + 1 < len)
&& (s[k+1] == ':')
&& is_posix_char_class((char *)s, k + 1, len, NULL)) {
while (s[k] != ']') {
k++;
}
}
k++;
}
if ((k >= len) || (!saw_big && !not_mode)) {
@ -4260,6 +4326,7 @@ static int translate(unsigned char *s, int len, char **result, int pcre)
} else {
/* Let next iteration handle it.
(There's no danger of using it as a meta-character.) */
p++;
}
} else
FAIL("trailing \\ in pattern");
@ -4294,6 +4361,15 @@ static int translate(unsigned char *s, int len, char **result, int pcre)
}
}
p++;
} else if (pcre
&& (us[p] == '[')
&& ((p + 1) < ulen)
&& (us[p+1] == ':')
&& is_posix_char_class_in_unicode(us, p + 1, ulen, simple_on)) {
while (us[p] != ']') {
p++;
}
p++;
} else {
if (((p + 1) < ulen) && (us[p] == '-')) {
FAIL("misplaced hypen within square brackets in pattern");

View File

@ -776,6 +776,7 @@ MZ_EXTERN char *scheme_getdrive(void);
MZ_EXTERN Scheme_Object *scheme_split_path(const char *path, int len, Scheme_Object **base, int *isdir);
MZ_EXTERN Scheme_Object *scheme_build_path(int argc, Scheme_Object **argv);
MZ_EXTERN Scheme_Object *scheme_path_to_directory_path(Scheme_Object *p);
MZ_EXTERN Scheme_Object *scheme_make_path(const char *chars);
MZ_EXTERN Scheme_Object *scheme_make_sized_path(char *chars, long len, int copy);

View File

@ -648,6 +648,7 @@ int (*scheme_os_setcwd)(char *buf, int noexn);
char *(*scheme_getdrive)(void);
Scheme_Object *(*scheme_split_path)(const char *path, int len, Scheme_Object **base, int *isdir);
Scheme_Object *(*scheme_build_path)(int argc, Scheme_Object **argv);
Scheme_Object *(*scheme_path_to_directory_path)(Scheme_Object *p);
Scheme_Object *(*scheme_make_path)(const char *chars);
Scheme_Object *(*scheme_make_sized_path)(char *chars, long len, int copy);
Scheme_Object *(*scheme_make_sized_offset_path)(char *chars, long d, long len, int copy);

View File

@ -428,6 +428,7 @@
scheme_extension_table->scheme_getdrive = scheme_getdrive;
scheme_extension_table->scheme_split_path = scheme_split_path;
scheme_extension_table->scheme_build_path = scheme_build_path;
scheme_extension_table->scheme_path_to_directory_path = scheme_path_to_directory_path;
scheme_extension_table->scheme_make_path = scheme_make_path;
scheme_extension_table->scheme_make_sized_path = scheme_make_sized_path;
scheme_extension_table->scheme_make_sized_offset_path = scheme_make_sized_offset_path;

View File

@ -428,6 +428,7 @@
#define scheme_getdrive (scheme_extension_table->scheme_getdrive)
#define scheme_split_path (scheme_extension_table->scheme_split_path)
#define scheme_build_path (scheme_extension_table->scheme_build_path)
#define scheme_path_to_directory_path (scheme_extension_table->scheme_path_to_directory_path)
#define scheme_make_path (scheme_extension_table->scheme_make_path)
#define scheme_make_sized_path (scheme_extension_table->scheme_make_sized_path)
#define scheme_make_sized_offset_path (scheme_extension_table->scheme_make_sized_offset_path)

View File

@ -13,7 +13,7 @@
#define USE_COMPILED_STARTUP 1
#define EXPECTED_PRIM_COUNT 875
#define EXPECTED_PRIM_COUNT 878
#ifdef MZSCHEME_SOMETHING_OMITTED
# undef USE_COMPILED_STARTUP

View File

@ -9,6 +9,6 @@
#define MZSCHEME_VERSION_MAJOR 352
#define MZSCHEME_VERSION_MINOR 7
#define MZSCHEME_VERSION_MINOR 8
#define MZSCHEME_VERSION "352.7" _MZ_SPECIAL_TAG
#define MZSCHEME_VERSION "352.8" _MZ_SPECIAL_TAG

View File

@ -36,6 +36,7 @@ extern int wx_activate_anyway;
extern void MrEdQueuePaint(wxWindow *wx_window);
extern void MrEdQueueClose(wxWindow *wx_window);
extern void MrEdQueueZoom(wxWindow *wx_window);
extern void MrEdQueueToolbar(wxWindow *wx_window);
extern void MrEdQueueUnfocus(wxWindow *wx_window);
extern void MrEdQueueDrop(wxWindow *wx_window, char *s);
@ -254,14 +255,16 @@ wxFrame::wxFrame // Constructor (for frame window)
{
/* Handle some events. */
EventTypeSpec spec[3];
EventTypeSpec spec[4];
spec[0].eventClass = kEventClassWindow;
spec[0].eventKind = kEventWindowClose;
spec[1].eventClass = kEventClassWindow;
spec[1].eventKind = kEventWindowZoom;
spec[2].eventClass = kEventClassWindow;
spec[2].eventKind = kEventWindowBoundsChanging;
InstallEventHandler(GetWindowEventTarget(theMacWindow), window_evt_handler, 3, spec, refcon, NULL);
spec[3].eventClass = kEventClassWindow;
spec[3].eventKind = kEventWindowToolbarSwitchMode;
InstallEventHandler(GetWindowEventTarget(theMacWindow), window_evt_handler, 4, spec, refcon, NULL);
}
{
@ -301,6 +304,9 @@ static OSStatus window_evt_handler(EventHandlerCallRef inHandlerCallRef,
case kEventWindowZoom:
MrEdQueueZoom(f);
break;
case kEventWindowToolbarSwitchMode:
MrEdQueueToolbar(f);
break;
case kEventWindowBoundsChanging:
if (os_x_post_tiger > 0) {
UInt32 a;