|
From: Alex M. S. <arc...@us...> - 2004-04-02 06:44:05
|
Update of /cvsroot/nettle/nettle/c In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11512/c Modified Files: chardefn choices socket zapgen Log Message: Backing out last night's changes.nn*cvsssh --ext update -kk -j 1.15 -j 1.14 c/chardefnn*cvsssh --ext update -kk -j 1.40 -j 1.39 c/choicesn*cvsssh --ext update -kk -j 1.37 -j 1.36 c/socketn*cvsssh --ext update -kk -j 1.38 -j 1.37 c/zapgenn*cvsssh --ext update -kk -j 1.7 -j 1.6 h/chardefnn*cvsssh --ext update -kk -j 1.88 -j 1.87 h/globalsn*cvsssh --ext update -kk -j 1.14 -j 1.13 h/zapredraw Index: chardefn =================================================================== RCS file: /cvsroot/nettle/nettle/c/chardefn,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** chardefn 1 Apr 2004 22:31:59 -0000 1.15 --- chardefn 2 Apr 2004 06:31:59 -0000 1.16 *************** *** 1,10 **** /** - * * Zap font character definitions * ! * © Nettle developers 2000-2004 ! * ! * @version $Id$ ! * */ --- 1,7 ---- /** * Zap font character definitions + * (C) Nettle developers 2000-2001 * ! * $Id$ */ *************** *** 16,74 **** #include "zapredraw.h" ! /** ! * Takes 2 characters, puts upper in the topleft of a character, and ! * lower in the bottomright of a chracter, and stores it in area ! * ! * @param area Character to be filled in ! * @param step Step size in bytes ! * @param height Height of the character ! * @param base Base of ZapRedraw font area ! * @param upper Character to be used in upper-left corner ! * @param lower Character to be used in lower-right corner ! */ static void copypair (char *area, int step, int height, ! const char *base, char upper, char lower); - /** - * Takes a character area, and underlines it - * - * @param area Character to be filled in - * @param step Step size in bytes - * @param height Height of the character - */ - static void make_underline (char *area, int step, int height); ! /** ! * Takes an array of character data, and fills in the undefined characters ! * (ie. those not defined by the Zap font) required by Nettle ! * ! * @param int_area pointer to character data ! * @param first_char first character defined by the Zap font ! * @param last_char last character defined by the Zap font ! * @param char_size size of character in bytes ! * @param width width of character ! * @param height height of character ! */ ! static void define_undefined_characters(int *int_area, ! int first_char, ! int last_char, ! int char_size, ! int width, int height); ! /* ----------------------------------------------------------------------- */ ! char *chardefn_define_cursors(int *int_area, int char_size, ! int width, int height, cursor_t cursor_type) { int loop; int step=char_size/height; char *area=(char *) int_area; /* define characters */ area += 0x100 * char_size; ! /* initialise cursor character area to 0 */ ! memset (area, 0, cursor_last * char_size); /* Active Cursor 0x100 */ --- 13,72 ---- #include "zapredraw.h" ! /* Define Zap graphics characters */ ! static void copypair (char *area, int step, int height, ! const char *base, char upper, char lower) ! { ! int x, y; ! const char *ptr = base + upper * step * height; ! for (y = 0; y < height; y++) ! { ! memcpy (area, ptr, step); ! if ((height & 1) && y == height / 2) ! ptr = base + lower * step * height; ! else ! ptr += step; ! for (x = step - 1; x >= 0; x--) ! area[x] |= ptr[x]; ! if ((height & 1) == 0 && y == (height - 1) / 2) ! ptr = base + lower * step * height; ! else ! ptr += step; ! area += step; ! } ! } ! static void make_underline (char *area, int step, int height) ! { ! char pixels[8] = {0}; /* hmm, trouble if the font is > 64 pixels wide... */ ! int x; ! area += step * height; ! while (--height > 1) ! { ! area -= step; ! for (x = step - 1; x >= 0; --x) ! { ! area[x >> 3] |= area[(x >> 3) - 2 * step] & ~pixels[x >> 3]; ! pixels[x >> 3] |= area[x >> 3]; ! } ! } ! } ! ! void define_zap_chars(int *int_area, int char_size, int width, int height) { int loop; int step=char_size/height; char *area=(char *) int_area; + const char *base = area; /* define characters */ area += 0x100 * char_size; ! /* initialise extra character area (chars 0x100-<end>) to 0 */ ! memset (area, 0, EXTRA_ZAP_CHARS * char_size); /* Active Cursor 0x100 */ *************** *** 132,162 **** area+=char_size; - return area; - } - - /* ----------------------------------------------------------------------- */ - - void chardefn_define_characters(int *int_area, int first_char, - int last_char, int char_size, - int width, int height, cursor_t cursor_type) - { - int loop; - int step=char_size/height; - char *area=(char *) int_area; - const char *base = area; - /* define characters */ - area += 0x100 * char_size; - - /* initialise extra character area (chars 0x100-<end>) to 0 */ - memset (area, 0, EXTRA_ZAP_CHARS * char_size); - - /* define the undefined characters */ - define_undefined_characters(int_area, first_char, last_char, char_size, - width, height); - - /* define the cursor characters */ - area = chardefn_define_cursors(int_area, char_size, width, height, - cursor_type); - /* Diamond 0x102 */ { --- 130,133 ---- *************** *** 368,421 **** } - /* ----------------------------------------------------------------------- */ ! static void copypair (char *area, int step, int height, ! const char *base, char upper, char lower) ! { ! int x, y; ! const char *ptr = base + upper * step * height; ! for (y = 0; y < height; y++) ! { ! memcpy (area, ptr, step); ! if ((height & 1) && y == height / 2) ! ptr = base + lower * step * height; ! else ! ptr += step; ! for (x = step - 1; x >= 0; x--) ! area[x] |= ptr[x]; ! if ((height & 1) == 0 && y == (height - 1) / 2) ! ptr = base + lower * step * height; ! else ! ptr += step; ! area += step; ! } ! } ! ! /* ----------------------------------------------------------------------- */ ! ! static void make_underline (char *area, int step, int height) ! { ! char pixels[8] = {0}; /* hmm, trouble if the font is > 64 pixels wide... */ ! int x; ! ! area += step * height; ! ! while (--height > 1) ! { ! area -= step; ! for (x = step - 1; x >= 0; --x) ! { ! area[x >> 3] |= area[(x >> 3) - 2 * step] & ~pixels[x >> 3]; ! pixels[x >> 3] |= area[x >> 3]; ! } ! } ! } ! ! /* ----------------------------------------------------------------------- */ ! ! static void define_undefined_characters(int *int_area, ! int first_char, ! int last_char, int char_size, ! int width, int height) { char *area = (char *)int_area; --- 339,345 ---- } ! void define_zap_undef_chars(int *int_area, int first_char, int last_char, ! int char_size, int width, int height) { char *area = (char *)int_area; *************** *** 467,471 **** } } - - /* ----------------------------------------------------------------------- */ - --- 391,392 ---- Index: choices =================================================================== RCS file: /cvsroot/nettle/nettle/c/choices,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** choices 1 Apr 2004 22:31:59 -0000 1.40 --- choices 2 Apr 2004 06:31:59 -0000 1.41 *************** *** 536,541 **** * stressful operation anyhow */ ! zapredraw_update_cursors(zap_font_area, cursor_type); ! zapredraw_update_cursors(zap_lowres_font_area, cursor_type); } } --- 536,541 ---- * stressful operation anyhow */ ! update_cursors(zap_font_area); ! update_cursors(zap_lowres_font_area); } } Index: socket =================================================================== RCS file: /cvsroot/nettle/nettle/c/socket,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** socket 1 Apr 2004 22:31:59 -0000 1.37 --- socket 2 Apr 2004 06:31:59 -0000 1.38 *************** *** 54,63 **** } - if (setsockopt(socket_handle, SOL_SOCKET, SO_OOBINLINE, (char *) &data, sizeof(data))) - { - close(socket_handle); - return -1; - } - socketwatch_register(socket_handle); --- 54,57 ---- Index: zapgen =================================================================== RCS file: /cvsroot/nettle/nettle/c/zapgen,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** zapgen 1 Apr 2004 22:31:59 -0000 1.38 --- zapgen 2 Apr 2004 06:31:59 -0000 1.39 *************** *** 306,319 **** ! ! void zapredraw_update_cursors(int *font_area, cursor_t cursor_type) { ! int width = font_area[2]; ! int height = font_area[3]; int char_size = ((width+ 7) & ~7)*height/8; /* fill in graphics chars */ ! chardefn_define_cursors(font_area+8, char_size, width, height, ! cursor_type); } --- 306,325 ---- ! /* ! * Description: Update the cursors in a given font_area ! * Parameters: font_area-> the area, as returned from load_font ! * Returns: none ! * Note: Will also update all the other special characters; ! * this is not intentional and should be replaced with ! * /just/ the cursors being updated. ! */ ! void update_cursors(int *font_area) { ! int width = font_area[2]; ! int height = font_area[3]; int char_size = ((width+ 7) & ~7)*height/8; /* fill in graphics chars */ ! define_zap_chars(font_area+8, char_size, width, height); } *************** *** 467,475 **** fclose(file_handle); ! /* fill in graphics characters and undefined characters */ ! /* FIXME: cursor_type is a global here, we shouldn't have globals */ ! chardefn_define_characters(zap_load_area+8, first_char, ! last_char, char_size, width, ! height, cursor_type); zap_load_area[4]=0; --- 473,482 ---- fclose(file_handle); ! /* fill in graphics chars */ ! define_zap_chars(zap_load_area+8, char_size, width, height); ! ! /* fill in some undefined characters in range 0x00-0xFF*/ ! define_zap_undef_chars (zap_load_area+8, first_char, last_char, ! char_size, width, height); zap_load_area[4]=0; |