/* * Copyright (c) 1994 by Xerox Corporation. All rights reserved. * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * * Permission is hereby granted to use or copy this program * for any purpose, provided the above notices are retained on all copies. * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice.
*/
/* * The MS Windows specific part of de. * This started as the generic Windows application template * but significant parts didn't survive to the final version. * * This was written by a nonexpert windows programmer.
*/ #ifdefined(__BORLANDC__) || defined(__CYGWIN__) || defined(__MINGW32__) \
|| defined(__NT__) || defined(_WIN32) || defined(WIN32)
/* Empirically, the command line does not include the command name ... if (command_line != 0) { while (isspace(*command_line)) command_line++; while (*command_line != 0 && !isspace(*command_line)) command_line++; while (isspace(*command_line)) command_line++;
} */
/* Return the argument with all control characters replaced by blanks. */ char * plain_chars(char * text, size_t len)
{ char * result = (char *)GC_MALLOC_ATOMIC(len + 1);
size_t i;
if (NULL == result) return NULL; for (i = 0; i < len; i++) { if (iscntrl(((unsignedchar *)text)[i])) {
result[i] = ' ';
} else {
result[i] = text[i];
}
}
result[len] = '\0'; return(result);
}
/* Return the argument with all non-control-characters replaced by */ /* blank, and all control characters c replaced by c + 64. */ char * control_chars(char * text, size_t len)
{ char * result = (char *)GC_MALLOC_ATOMIC(len + 1);
size_t i;
if (NULL == result) return NULL; for (i = 0; i < len; i++) { if (iscntrl(((unsignedchar *)text)[i])) {
result[i] = (char)(text[i] + 0x40);
} else {
result[i] = ' ';
}
}
result[len] = '\0'; return(result);
}
int char_width; int char_height;
void get_line_rect(int line_arg, int win_width, RECT * rectp)
{
rectp -> top = line_arg * (LONG)char_height;
rectp -> bottom = rectp->top + char_height;
rectp -> left = 0;
rectp -> right = win_width;
}
int caret_visible = 0; /* Caret is currently visible. */
int screen_was_painted = 0;/* Screen has been painted at least once. */
case WM_COMMAND:
id = LOWORD(wParam); if (id & EDIT_CMD_FLAG) { if (id & REPEAT_FLAG) do_command(REPEAT);
do_command(CHAR_CMD(id)); return( 0 );
} else { switch(id) { case IDM_FILEEXIT:
SendMessage(hwnd_arg, WM_CLOSE, 0, 0L); return( 0 );
if (!screen_was_painted) return; /* Invalidating a rectangle before painting seems result in a */ /* major performance problem. */
get_line_rect(i, COLS*char_width, &line_r);
InvalidateRect(hwnd, &line_r, FALSE);
}
#else
externint GC_quiet; /* ANSI C doesn't allow translation units to be empty. */ /* So we guarantee this one is nonempty. */
#endif/* !WIN32 */
Messung V0.5
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.