diff options
author | Andrew Cagney <cagney@redhat.com> | 2004-02-07 20:57:02 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2004-02-07 20:57:02 +0000 |
commit | 6d012f143df40b0870ee1f64940080c1591801a3 (patch) | |
tree | 03c02968dd85d7b77298a7c13c9b9878d01ae89e /gdb/tui/tui-win.c | |
parent | 1c80067325ac5c90f84154900ac057780b7869af (diff) | |
download | gdb-6d012f143df40b0870ee1f64940080c1591801a3.zip gdb-6d012f143df40b0870ee1f64940080c1591801a3.tar.gz gdb-6d012f143df40b0870ee1f64940080c1591801a3.tar.bz2 |
2004-02-07 Andrew Cagney <cagney@redhat.com>
* tui/tui.h: Do not include <stdarg.h>, <string.h>, and
"ansidecl.h". Do not undef "reg" and "chtype". Fix case of
fields and variables.
* tui/tui-wingeneral.h (m_beVisible): Delete macro.
(m_beInvisible): Delete macro.
* tui/tui-data.h: Fix case case fields and variables.
(m_genWinPtrIsNull): Delete macro.
(tui_win_list): Rename winList.
(TUI_SRC_WIN): Rename srcWin.
(TUI_DISASM_WIN): Rename disassemWin.
(TUI_DATA_WIN): Rename dataWin.
(TUI_CMD_WIN): Rename cmdWin.
(m_genWinPtrNotNull): Delete macro.
(m_winPtrIsNull): Delete macro.
(m_winPtrNotNull): Delete macro.
(tui_win_is_source_type): Replace m_winIsSourceType
(tui_win_is_auxillary): Replace m_winIsAuzillary.
(tui_win_has_locator): Replace m_hasLocator.
(tui_set_win_highlight): Replace m_setWinHighlightOn and
m_setWinHighlightOff.
* tui/tui-data.c: Update references.
(tui_win_is_source_type, tui_set_win_highlight): New functions.
(tui_win_has_locator, tui_win_is_auxillary): New functions.
* tui/tui-command.c, tui/tui-disasm.c: Update references.
* tui/tui-io.c, tui/tui-layout.c, tui/tui-regs.c: Ditto.
* tui/tui-regs.h, tui/tui-source.c, tui/tui-stack.c: Ditto.
* tui/tui-win.c, tui/tui-windata.c, tui/tui-wingeneral.c: Ditto.
* tui/tui-winsource.c, tui/tui.c: Ditto.
Diffstat (limited to 'gdb/tui/tui-win.c')
-rw-r--r-- | gdb/tui/tui-win.c | 316 |
1 files changed, 158 insertions, 158 deletions
diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c index d95c38a..6e5f204 100644 --- a/gdb/tui/tui-win.c +++ b/gdb/tui/tui-win.c @@ -415,28 +415,28 @@ tui_update_gdb_sizes () rl_get_screen_size (&screenheight, &screenwidth); /* Set to TUI command window dimension or use readline values. */ sprintf (cmd, "set width %d", - tui_active ? cmdWin->generic.width : screenwidth); + tui_active ? TUI_CMD_WIN->generic.width : screenwidth); execute_command (cmd, 0); sprintf (cmd, "set height %d", - tui_active ? cmdWin->generic.height : screenheight); + tui_active ? TUI_CMD_WIN->generic.height : screenheight); execute_command (cmd, 0); } -/* Set the logical focus to winInfo. */ +/* Set the logical focus to win_info. */ void -tui_set_win_focus_to (struct tui_win_info * winInfo) +tui_set_win_focus_to (struct tui_win_info * win_info) { - if (m_winPtrNotNull (winInfo)) + if (win_info != NULL) { struct tui_win_info * winWithFocus = tui_win_with_focus (); - if (m_winPtrNotNull (winWithFocus) && - winWithFocus->generic.type != CMD_WIN) + if (winWithFocus != NULL + && winWithFocus->generic.type != CMD_WIN) tui_unhighlight_win (winWithFocus); - tui_set_win_with_focus (winInfo); - if (winInfo->generic.type != CMD_WIN) - tui_highlight_win (winInfo); + tui_set_win_with_focus (win_info); + if (win_info->generic.type != CMD_WIN) + tui_highlight_win (win_info); } return; @@ -446,7 +446,7 @@ tui_set_win_focus_to (struct tui_win_info * winInfo) void tui_scroll_forward (struct tui_win_info * winToScroll, int numToScroll) { - if (winToScroll != cmdWin) + if (winToScroll != TUI_CMD_WIN) { int _numToScroll = numToScroll; @@ -458,11 +458,11 @@ tui_scroll_forward (struct tui_win_info * winToScroll, int numToScroll) ** only what is in the viewport. If winToScroll is the ** command window do nothing since the term should handle it. */ - if (winToScroll == srcWin) + if (winToScroll == TUI_SRC_WIN) tui_vertical_source_scroll (FORWARD_SCROLL, _numToScroll); - else if (winToScroll == disassemWin) + else if (winToScroll == TUI_DISASM_WIN) tui_vertical_disassem_scroll (FORWARD_SCROLL, _numToScroll); - else if (winToScroll == dataWin) + else if (winToScroll == TUI_DATA_WIN) tui_vertical_data_scroll (FORWARD_SCROLL, _numToScroll); } } @@ -470,7 +470,7 @@ tui_scroll_forward (struct tui_win_info * winToScroll, int numToScroll) void tui_scroll_backward (struct tui_win_info * winToScroll, int numToScroll) { - if (winToScroll != cmdWin) + if (winToScroll != TUI_CMD_WIN) { int _numToScroll = numToScroll; @@ -482,11 +482,11 @@ tui_scroll_backward (struct tui_win_info * winToScroll, int numToScroll) ** only what is in the viewport. If winToScroll is the ** command window do nothing since the term should handle it. */ - if (winToScroll == srcWin) + if (winToScroll == TUI_SRC_WIN) tui_vertical_source_scroll (BACKWARD_SCROLL, _numToScroll); - else if (winToScroll == disassemWin) + else if (winToScroll == TUI_DISASM_WIN) tui_vertical_disassem_scroll (BACKWARD_SCROLL, _numToScroll); - else if (winToScroll == dataWin) + else if (winToScroll == TUI_DATA_WIN) tui_vertical_data_scroll (BACKWARD_SCROLL, _numToScroll); } } @@ -495,7 +495,7 @@ tui_scroll_backward (struct tui_win_info * winToScroll, int numToScroll) void tui_scroll_left (struct tui_win_info * winToScroll, int numToScroll) { - if (winToScroll != cmdWin) + if (winToScroll != TUI_CMD_WIN) { int _numToScroll = numToScroll; @@ -507,7 +507,7 @@ tui_scroll_left (struct tui_win_info * winToScroll, int numToScroll) ** only what is in the viewport. If winToScroll is the ** command window do nothing since the term should handle it. */ - if (winToScroll == srcWin || winToScroll == disassemWin) + if (winToScroll == TUI_SRC_WIN || winToScroll == TUI_DISASM_WIN) tui_horizontal_source_scroll (winToScroll, LEFT_SCROLL, _numToScroll); } } @@ -516,7 +516,7 @@ tui_scroll_left (struct tui_win_info * winToScroll, int numToScroll) void tui_scroll_right (struct tui_win_info * winToScroll, int numToScroll) { - if (winToScroll != cmdWin) + if (winToScroll != TUI_CMD_WIN) { int _numToScroll = numToScroll; @@ -528,7 +528,7 @@ tui_scroll_right (struct tui_win_info * winToScroll, int numToScroll) ** only what is in the viewport. If winToScroll is the ** command window do nothing since the term should handle it. */ - if (winToScroll == srcWin || winToScroll == disassemWin) + if (winToScroll == TUI_SRC_WIN || winToScroll == TUI_DISASM_WIN) tui_horizontal_source_scroll (winToScroll, RIGHT_SCROLL, _numToScroll); } } @@ -566,19 +566,19 @@ tui_refresh_all_win (void) enum tui_win_type type; clearok (curscr, TRUE); - tui_refresh_all (winList); + tui_refresh_all (tui_win_list); for (type = SRC_WIN; type < MAX_MAJOR_WINDOWS; type++) { - if (winList[type] && winList[type]->generic.isVisible) + if (tui_win_list[type] && tui_win_list[type]->generic.is_visible) { switch (type) { case SRC_WIN: case DISASSEM_WIN: - tui_show_source_content (winList[type]); - tui_check_and_display_highlight_if_needed (winList[type]); - tui_erase_exec_info_content (winList[type]); - tui_update_exec_info (winList[type]); + tui_show_source_content (tui_win_list[type]); + tui_check_and_display_highlight_if_needed (tui_win_list[type]); + tui_erase_exec_info_content (tui_win_list[type]); + tui_update_exec_info (tui_win_list[type]); break; case DATA_WIN: tui_refresh_data_win (); @@ -617,8 +617,8 @@ tuiResizeAll (void) int newHeight, splitDiff, cmdSplitDiff, numWinsDisplayed = 2; /* turn keypad off while we resize */ - if (winWithFocus != cmdWin) - keypad (cmdWin->generic.handle, FALSE); + if (winWithFocus != TUI_CMD_WIN) + keypad (TUI_CMD_WIN->generic.handle, FALSE); tui_update_gdb_sizes (); tui_set_term_height_to (screenheight); tui_set_term_width_to (screenwidth); @@ -656,26 +656,26 @@ tuiResizeAll (void) newHeight = firstWin->generic.height + splitDiff; _makeInvisibleAndSetNewHeight (firstWin, newHeight); - cmdWin->generic.origin.y = locator->origin.y + 1; - cmdWin->generic.width += widthDiff; - newHeight = screenheight - cmdWin->generic.origin.y; - _makeInvisibleAndSetNewHeight (cmdWin, newHeight); + TUI_CMD_WIN->generic.origin.y = locator->origin.y + 1; + TUI_CMD_WIN->generic.width += widthDiff; + newHeight = screenheight - TUI_CMD_WIN->generic.origin.y; + _makeInvisibleAndSetNewHeight (TUI_CMD_WIN, newHeight); _makeVisibleWithNewHeight (firstWin); - _makeVisibleWithNewHeight (cmdWin); - if (firstWin->generic.contentSize <= 0) + _makeVisibleWithNewHeight (TUI_CMD_WIN); + if (firstWin->generic.content_size <= 0) tui_erase_source_content (firstWin, EMPTY_SOURCE_PROMPT); break; default: if (curLayout == SRC_DISASSEM_COMMAND) { - firstWin = srcWin; + firstWin = TUI_SRC_WIN; firstWin->generic.width += widthDiff; - secondWin = disassemWin; + secondWin = TUI_DISASM_WIN; secondWin->generic.width += widthDiff; } else { - firstWin = dataWin; + firstWin = TUI_DATA_WIN; firstWin->generic.width += widthDiff; secondWin = (struct tui_win_info *) (tui_source_windows ())->list[0]; secondWin->generic.width += widthDiff; @@ -694,10 +694,10 @@ tuiResizeAll (void) newHeight = firstWin->generic.height + splitDiff; _makeInvisibleAndSetNewHeight (firstWin, newHeight); - if (firstWin == dataWin && widthDiff != 0) - firstWin->detail.dataDisplayInfo.regsColumnCount = + if (firstWin == TUI_DATA_WIN && widthDiff != 0) + firstWin->detail.data_display_info.regs_column_count = tui_calculate_regs_column_count ( - firstWin->detail.dataDisplayInfo.regsDisplayType); + firstWin->detail.data_display_info.regs_display_type); locator->width += widthDiff; /* Change the second window's height/width */ @@ -722,15 +722,15 @@ tuiResizeAll (void) _makeInvisibleAndSetNewHeight (secondWin, newHeight); /* Change the command window's height/width */ - cmdWin->generic.origin.y = locator->origin.y + 1; + TUI_CMD_WIN->generic.origin.y = locator->origin.y + 1; _makeInvisibleAndSetNewHeight ( - cmdWin, cmdWin->generic.height + cmdSplitDiff); + TUI_CMD_WIN, TUI_CMD_WIN->generic.height + cmdSplitDiff); _makeVisibleWithNewHeight (firstWin); _makeVisibleWithNewHeight (secondWin); - _makeVisibleWithNewHeight (cmdWin); - if (firstWin->generic.contentSize <= 0) + _makeVisibleWithNewHeight (TUI_CMD_WIN); + if (firstWin->generic.content_size <= 0) tui_erase_source_content (firstWin, EMPTY_SOURCE_PROMPT); - if (secondWin->generic.contentSize <= 0) + if (secondWin->generic.content_size <= 0) tui_erase_source_content (secondWin, EMPTY_SOURCE_PROMPT); break; } @@ -740,17 +740,17 @@ tuiResizeAll (void) */ for (winType = SRC_WIN; (winType < MAX_MAJOR_WINDOWS); winType++) { - if (winType != CMD_WIN && m_winPtrNotNull (winList[winType]) && - !winList[winType]->generic.isVisible) + if (winType != CMD_WIN && (tui_win_list[winType] != NULL) + && !tui_win_list[winType]->generic.is_visible) { - tui_free_window (winList[winType]); - winList[winType] = (struct tui_win_info *) NULL; + tui_free_window (tui_win_list[winType]); + tui_win_list[winType] = (struct tui_win_info *) NULL; } } tui_set_win_resized_to (TRUE); /* turn keypad back on, unless focus is in the command window */ - if (winWithFocus != cmdWin) - keypad (cmdWin->generic.handle, TRUE); + if (winWithFocus != TUI_CMD_WIN) + keypad (TUI_CMD_WIN->generic.handle, TRUE); } return; } /* tuiResizeAll */ @@ -862,28 +862,28 @@ _tuiSetFocus (char *arg, int fromTTY) { char *bufPtr = (char *) xstrdup (arg); int i; - struct tui_win_info * winInfo = (struct tui_win_info *) NULL; + struct tui_win_info * win_info = (struct tui_win_info *) NULL; for (i = 0; (i < strlen (bufPtr)); i++) bufPtr[i] = toupper (arg[i]); if (subset_compare (bufPtr, "NEXT")) - winInfo = tui_next_win (tui_win_with_focus ()); + win_info = tui_next_win (tui_win_with_focus ()); else if (subset_compare (bufPtr, "PREV")) - winInfo = tui_prev_win (tui_win_with_focus ()); + win_info = tui_prev_win (tui_win_with_focus ()); else - winInfo = tui_partial_win_by_name (bufPtr); + win_info = tui_partial_win_by_name (bufPtr); - if (winInfo == (struct tui_win_info *) NULL || !winInfo->generic.isVisible) + if (win_info == (struct tui_win_info *) NULL || !win_info->generic.is_visible) warning ("Invalid window specified. \n\ The window name specified must be valid and visible.\n"); else { - tui_set_win_focus_to (winInfo); - keypad (cmdWin->generic.handle, (winInfo != cmdWin)); + tui_set_win_focus_to (win_info); + keypad (TUI_CMD_WIN->generic.handle, (win_info != TUI_CMD_WIN)); } - if (dataWin && dataWin->generic.isVisible) + if (TUI_DATA_WIN && TUI_DATA_WIN->generic.is_visible) tui_refresh_data_win (); xfree (bufPtr); printf_filtered ("Focus set to %s window.\n", @@ -917,16 +917,16 @@ _tuiAllWindowsInfo (char *arg, int fromTTY) struct tui_win_info * winWithFocus = tui_win_with_focus (); for (type = SRC_WIN; (type < MAX_MAJOR_WINDOWS); type++) - if (winList[type] && winList[type]->generic.isVisible) + if (tui_win_list[type] && tui_win_list[type]->generic.is_visible) { - if (winWithFocus == winList[type]) + if (winWithFocus == tui_win_list[type]) printf_filtered (" %s\t(%d lines) <has focus>\n", - tui_win_name (&winList[type]->generic), - winList[type]->generic.height); + tui_win_name (&tui_win_list[type]->generic), + tui_win_list[type]->generic.height); else printf_filtered (" %s\t(%d lines)\n", - tui_win_name (&winList[type]->generic), - winList[type]->generic.height); + tui_win_name (&tui_win_list[type]->generic), + tui_win_list[type]->generic.height); } return; @@ -985,7 +985,7 @@ _tuiSetWinHeight (char *arg, int fromTTY) char *bufPtr = buf; char *wname = (char *) NULL; int newHeight, i; - struct tui_win_info * winInfo; + struct tui_win_info * win_info; wname = bufPtr; bufPtr = strchr (bufPtr, ' '); @@ -998,9 +998,9 @@ _tuiSetWinHeight (char *arg, int fromTTY) */ for (i = 0; i < strlen (wname); i++) wname[i] = toupper (wname[i]); - winInfo = tui_partial_win_by_name (wname); + win_info = tui_partial_win_by_name (wname); - if (winInfo == (struct tui_win_info *) NULL || !winInfo->generic.isVisible) + if (win_info == (struct tui_win_info *) NULL || !win_info->generic.is_visible) warning ("Invalid window specified. \n\ The window name specified must be valid and visible.\n"); else @@ -1030,12 +1030,12 @@ The window name specified must be valid and visible.\n"); if (fixedSize) newHeight = inputNo; else - newHeight = winInfo->generic.height + inputNo; + newHeight = win_info->generic.height + inputNo; /* ** Now change the window's height, and adjust all ** other windows around it */ - if (_tuiAdjustWinHeights (winInfo, + if (_tuiAdjustWinHeights (win_info, newHeight) == TUI_FAILURE) warning ("Invalid window height specified.\n%s", WIN_HEIGHT_USAGE); @@ -1091,8 +1091,8 @@ _tuiXDBsetWinHeight (char *arg, int fromTTY) { /* Add 1 for the locator */ int newHeight = tui_term_height () - (inputNo + 1); - if (!_newHeightOk (winList[CMD_WIN], newHeight) || - _tuiAdjustWinHeights (winList[CMD_WIN], + if (!_newHeightOk (tui_win_list[CMD_WIN], newHeight) || + _tuiAdjustWinHeights (tui_win_list[CMD_WIN], newHeight) == TUI_FAILURE) warning ("Invalid window height specified.\n%s", XDBWIN_HEIGHT_USAGE); @@ -1133,7 +1133,7 @@ _tuiAdjustWinHeights (struct tui_win_info * primaryWinInfo, int newHeight) if (newHeight != primaryWinInfo->generic.height) { int diff; - struct tui_win_info * winInfo; + struct tui_win_info * win_info; struct tui_gen_win_info * locator = tui_locator_win_info_ptr (); enum tui_layout_type curLayout = tui_current_layout (); @@ -1145,20 +1145,20 @@ _tuiAdjustWinHeights (struct tui_win_info * primaryWinInfo, int newHeight) _makeInvisibleAndSetNewHeight (primaryWinInfo, newHeight); if (primaryWinInfo->generic.type == CMD_WIN) { - winInfo = (struct tui_win_info *) (tui_source_windows ())->list[0]; - srcWinInfo = winInfo; + win_info = (struct tui_win_info *) (tui_source_windows ())->list[0]; + srcWinInfo = win_info; } else { - winInfo = winList[CMD_WIN]; + win_info = tui_win_list[CMD_WIN]; srcWinInfo = primaryWinInfo; } - _makeInvisibleAndSetNewHeight (winInfo, - winInfo->generic.height + diff); - cmdWin->generic.origin.y = locator->origin.y + 1; - _makeVisibleWithNewHeight (winInfo); + _makeInvisibleAndSetNewHeight (win_info, + win_info->generic.height + diff); + TUI_CMD_WIN->generic.origin.y = locator->origin.y + 1; + _makeVisibleWithNewHeight (win_info); _makeVisibleWithNewHeight (primaryWinInfo); - if (srcWinInfo->generic.contentSize <= 0) + if (srcWinInfo->generic.content_size <= 0) tui_erase_source_content (srcWinInfo, EMPTY_SOURCE_PROMPT); } else @@ -1168,15 +1168,15 @@ _tuiAdjustWinHeights (struct tui_win_info * primaryWinInfo, int newHeight) if (curLayout == SRC_DISASSEM_COMMAND) { - firstWin = srcWin; - secondWin = disassemWin; + firstWin = TUI_SRC_WIN; + secondWin = TUI_DISASM_WIN; } else { - firstWin = dataWin; + firstWin = TUI_DATA_WIN; secondWin = (struct tui_win_info *) (tui_source_windows ())->list[0]; } - if (primaryWinInfo == cmdWin) + if (primaryWinInfo == TUI_CMD_WIN) { /* ** Split the change in height accross the 1st & 2nd windows ** adjusting them as well. @@ -1217,20 +1217,20 @@ _tuiAdjustWinHeights (struct tui_win_info * primaryWinInfo, int newHeight) secondWin->generic.origin.y = firstWin->generic.height - 1; _makeInvisibleAndSetNewHeight ( secondWin, secondWin->generic.height + secondSplitDiff); - cmdWin->generic.origin.y = locator->origin.y + 1; - _makeInvisibleAndSetNewHeight (cmdWin, newHeight); + TUI_CMD_WIN->generic.origin.y = locator->origin.y + 1; + _makeInvisibleAndSetNewHeight (TUI_CMD_WIN, newHeight); } else { - if ((cmdWin->generic.height + diff) < 1) + if ((TUI_CMD_WIN->generic.height + diff) < 1) { /* ** If there is no way to increase the command window ** take real estate from the 1st or 2nd window. */ - if ((cmdWin->generic.height + diff) < 1) + if ((TUI_CMD_WIN->generic.height + diff) < 1) { int i; - for (i = cmdWin->generic.height + diff; + for (i = TUI_CMD_WIN->generic.height + diff; (i < 1); i++) if (primaryWinInfo == firstWin) secondWin->generic.height--; @@ -1250,19 +1250,19 @@ _tuiAdjustWinHeights (struct tui_win_info * primaryWinInfo, int newHeight) else _makeInvisibleAndSetNewHeight ( secondWin, secondWin->generic.height); - cmdWin->generic.origin.y = locator->origin.y + 1; - if ((cmdWin->generic.height + diff) < 1) - _makeInvisibleAndSetNewHeight (cmdWin, 1); + TUI_CMD_WIN->generic.origin.y = locator->origin.y + 1; + if ((TUI_CMD_WIN->generic.height + diff) < 1) + _makeInvisibleAndSetNewHeight (TUI_CMD_WIN, 1); else _makeInvisibleAndSetNewHeight ( - cmdWin, cmdWin->generic.height + diff); + TUI_CMD_WIN, TUI_CMD_WIN->generic.height + diff); } - _makeVisibleWithNewHeight (cmdWin); + _makeVisibleWithNewHeight (TUI_CMD_WIN); _makeVisibleWithNewHeight (secondWin); _makeVisibleWithNewHeight (firstWin); - if (firstWin->generic.contentSize <= 0) + if (firstWin->generic.content_size <= 0) tui_erase_source_content (firstWin, EMPTY_SOURCE_PROMPT); - if (secondWin->generic.contentSize <= 0) + if (secondWin->generic.content_size <= 0) tui_erase_source_content (secondWin, EMPTY_SOURCE_PROMPT); } } @@ -1278,49 +1278,49 @@ _tuiAdjustWinHeights (struct tui_win_info * primaryWinInfo, int newHeight) ** with the targer) invisible, and set the new height and location. */ static void -_makeInvisibleAndSetNewHeight (struct tui_win_info * winInfo, int height) +_makeInvisibleAndSetNewHeight (struct tui_win_info * win_info, int height) { int i; struct tui_gen_win_info * genWinInfo; - tui_make_invisible (&winInfo->generic); - winInfo->generic.height = height; + tui_make_invisible (&win_info->generic); + win_info->generic.height = height; if (height > 1) - winInfo->generic.viewportHeight = height - 1; + win_info->generic.viewport_height = height - 1; else - winInfo->generic.viewportHeight = height; - if (winInfo != cmdWin) - winInfo->generic.viewportHeight--; + win_info->generic.viewport_height = height; + if (win_info != TUI_CMD_WIN) + win_info->generic.viewport_height--; - /* Now deal with the auxillary windows associated with winInfo */ - switch (winInfo->generic.type) + /* Now deal with the auxillary windows associated with win_info */ + switch (win_info->generic.type) { case SRC_WIN: case DISASSEM_WIN: - genWinInfo = winInfo->detail.sourceInfo.executionInfo; + genWinInfo = win_info->detail.source_info.execution_info; tui_make_invisible (genWinInfo); genWinInfo->height = height; - genWinInfo->origin.y = winInfo->generic.origin.y; + genWinInfo->origin.y = win_info->generic.origin.y; if (height > 1) - genWinInfo->viewportHeight = height - 1; + genWinInfo->viewport_height = height - 1; else - genWinInfo->viewportHeight = height; - if (winInfo != cmdWin) - genWinInfo->viewportHeight--; + genWinInfo->viewport_height = height; + if (win_info != TUI_CMD_WIN) + genWinInfo->viewport_height--; - if (m_hasLocator (winInfo)) + if (tui_win_has_locator (win_info)) { genWinInfo = tui_locator_win_info_ptr (); tui_make_invisible (genWinInfo); - genWinInfo->origin.y = winInfo->generic.origin.y + height; + genWinInfo->origin.y = win_info->generic.origin.y + height; } break; case DATA_WIN: /* delete all data item windows */ - for (i = 0; i < winInfo->generic.contentSize; i++) + for (i = 0; i < win_info->generic.content_size; i++) { genWinInfo = (struct tui_gen_win_info *) & ((struct tui_win_element *) - winInfo->generic.content[i])->whichElement.dataWindow; + win_info->generic.content[i])->which_element.data_window; tui_delete_win (genWinInfo->handle); genWinInfo->handle = (WINDOW *) NULL; } @@ -1338,32 +1338,32 @@ _makeInvisibleAndSetNewHeight (struct tui_win_info * winInfo, int height) ** had to be destroyed to be made invisible. */ static void -_makeVisibleWithNewHeight (struct tui_win_info * winInfo) +_makeVisibleWithNewHeight (struct tui_win_info * win_info) { struct symtab *s; - tui_make_visible (&winInfo->generic); - tui_check_and_display_highlight_if_needed (winInfo); - switch (winInfo->generic.type) + tui_make_visible (&win_info->generic); + tui_check_and_display_highlight_if_needed (win_info); + switch (win_info->generic.type) { case SRC_WIN: case DISASSEM_WIN: - tui_free_win_content (winInfo->detail.sourceInfo.executionInfo); - tui_make_visible (winInfo->detail.sourceInfo.executionInfo); - if (winInfo->generic.content != NULL) + tui_free_win_content (win_info->detail.source_info.execution_info); + tui_make_visible (win_info->detail.source_info.execution_info); + if (win_info->generic.content != NULL) { union tui_line_or_address lineOrAddr; struct symtab_and_line cursal = get_current_source_symtab_and_line (); - if (winInfo->generic.type == SRC_WIN) - lineOrAddr.lineNo = - winInfo->detail.sourceInfo.startLineOrAddr.lineNo; + if (win_info->generic.type == SRC_WIN) + lineOrAddr.line_no = + win_info->detail.source_info.start_line_or_addr.line_no; else lineOrAddr.addr = - winInfo->detail.sourceInfo.startLineOrAddr.addr; - tui_free_win_content (&winInfo->generic); - tui_update_source_window (winInfo, cursal.symtab, lineOrAddr, TRUE); + win_info->detail.source_info.start_line_or_addr.addr; + tui_free_win_content (&win_info->generic); + tui_update_source_window (win_info, cursal.symtab, lineOrAddr, TRUE); } else if (deprecated_selected_frame != (struct frame_info *) NULL) { @@ -1372,15 +1372,15 @@ _makeVisibleWithNewHeight (struct tui_win_info * winInfo) s = find_pc_symtab (get_frame_pc (deprecated_selected_frame)); - if (winInfo->generic.type == SRC_WIN) - line.lineNo = cursal.line; + if (win_info->generic.type == SRC_WIN) + line.line_no = cursal.line; else { find_line_pc (s, cursal.line, &line.addr); } - tui_update_source_window (winInfo, s, line, TRUE); + tui_update_source_window (win_info, s, line, TRUE); } - if (m_hasLocator (winInfo)) + if (tui_win_has_locator (win_info)) { tui_make_visible (tui_locator_win_info_ptr ()); tui_show_locator_content (); @@ -1390,11 +1390,11 @@ _makeVisibleWithNewHeight (struct tui_win_info * winInfo) tui_display_all_data (); break; case CMD_WIN: - winInfo->detail.commandInfo.curLine = 0; - winInfo->detail.commandInfo.curch = 0; - wmove (winInfo->generic.handle, - winInfo->detail.commandInfo.curLine, - winInfo->detail.commandInfo.curch); + win_info->detail.command_info.cur_line = 0; + win_info->detail.command_info.curch = 0; + wmove (win_info->generic.handle, + win_info->detail.command_info.cur_line, + win_info->detail.command_info.curch); break; default: break; @@ -1412,10 +1412,10 @@ _newHeightOk (struct tui_win_info * primaryWinInfo, int newHeight) if (ok) { int diff; - enum tui_layout_type curLayout = tui_current_layout (); + enum tui_layout_type cur_layout = tui_current_layout (); diff = (newHeight - primaryWinInfo->generic.height) * (-1); - if (curLayout == SRC_COMMAND || curLayout == DISASSEM_COMMAND) + if (cur_layout == SRC_COMMAND || cur_layout == DISASSEM_COMMAND) { ok = ((primaryWinInfo->generic.type == CMD_WIN && newHeight <= (tui_term_height () - 4) && @@ -1425,14 +1425,14 @@ _newHeightOk (struct tui_win_info * primaryWinInfo, int newHeight) newHeight >= MIN_WIN_HEIGHT)); if (ok) { /* check the total height */ - struct tui_win_info * winInfo; + struct tui_win_info * win_info; - if (primaryWinInfo == cmdWin) - winInfo = (struct tui_win_info *) (tui_source_windows ())->list[0]; + if (primaryWinInfo == TUI_CMD_WIN) + win_info = (struct tui_win_info *) (tui_source_windows ())->list[0]; else - winInfo = cmdWin; + win_info = TUI_CMD_WIN; ok = ((newHeight + - (winInfo->generic.height + diff)) <= tui_term_height ()); + (win_info->generic.height + diff)) <= tui_term_height ()); } } else @@ -1441,14 +1441,14 @@ _newHeightOk (struct tui_win_info * primaryWinInfo, int newHeight) struct tui_win_info *firstWin; struct tui_win_info *secondWin; - if (curLayout == SRC_DISASSEM_COMMAND) + if (cur_layout == SRC_DISASSEM_COMMAND) { - firstWin = srcWin; - secondWin = disassemWin; + firstWin = TUI_SRC_WIN; + secondWin = TUI_DISASM_WIN; } else { - firstWin = dataWin; + firstWin = TUI_DATA_WIN; secondWin = (struct tui_win_info *) (tui_source_windows ())->list[0]; } /* @@ -1459,8 +1459,8 @@ _newHeightOk (struct tui_win_info * primaryWinInfo, int newHeight) */ totalHeight = curTotalHeight = (firstWin->generic.height + secondWin->generic.height - 1) - + cmdWin->generic.height + 1 /*locator */ ; - if (primaryWinInfo == cmdWin) + + TUI_CMD_WIN->generic.height + 1 /*locator */ ; + if (primaryWinInfo == TUI_CMD_WIN) { /* locator included since first & second win share a line */ ok = ((firstWin->generic.height + @@ -1482,7 +1482,7 @@ _newHeightOk (struct tui_win_info * primaryWinInfo, int newHeight) ** window. And make sure that the command window is ** at least 1 line */ - ok = ((cmdWin->generic.height + diff) > 0); + ok = ((TUI_CMD_WIN->generic.height + diff) > 0); if (!ok) { /* ** Looks like we have to increase/decrease one of @@ -1498,11 +1498,11 @@ _newHeightOk (struct tui_win_info * primaryWinInfo, int newHeight) if (primaryWinInfo == firstWin) totalHeight = newHeight + secondWin->generic.height + - cmdWin->generic.height + diff; + TUI_CMD_WIN->generic.height + diff; else totalHeight = newHeight + firstWin->generic.height + - cmdWin->generic.height + diff; + TUI_CMD_WIN->generic.height + diff; } } /* @@ -1576,10 +1576,10 @@ _parseScrollingArgs (char *arg, struct tui_win_info * * winToScroll, int *numToS *winToScroll = tui_partial_win_by_name (wname); if (*winToScroll == (struct tui_win_info *) NULL || - !(*winToScroll)->generic.isVisible) + !(*winToScroll)->generic.is_visible) warning ("Invalid window specified. \n\ The window name specified must be valid and visible.\n"); - else if (*winToScroll == cmdWin) + else if (*winToScroll == TUI_CMD_WIN) *winToScroll = (struct tui_win_info *) (tui_source_windows ())->list[0]; } xfree (buf); |