AmendHub

Download:

jcs

/

wallops

/

amendments

/

48

chatter: Tab bar is no longer a GrafPort, rename it


jcs made amendment 48 about 1 year ago
--- chatter.c Tue Jan 17 23:14:56 2023 +++ chatter.c Tue Jan 17 23:18:38 2023 @@ -322,8 +322,8 @@ chatter_close(struct focusable *focusable) } } - if (chatter->tab_port.baseAddr) - xfree(&chatter->tab_port.baseAddr); + if (chatter->tab_bar.baseAddr) + xfree(&chatter->tab_bar.baseAddr); DisposeWindow(focusable->win); @@ -453,15 +453,15 @@ chatter_draw_tab_bar(struct chatter *chatter) cur_bits = chatter->win->portBits; - if (chatter->tab_port.baseAddr == 0) { + if (chatter->tab_bar.baseAddr == 0) { width = chatter->win->portRect.right - chatter->win->portRect.left; - chatter->tab_port.rowBytes = (((width - 1) / 16) + 1) * 2; - chatter->tab_port.baseAddr = xmalloczero( - chatter->tab_port.rowBytes * TAB_BAR_HEIGHT, "tab_port"); - SetRect(&chatter->tab_port.bounds, 0, 0, width, TAB_BAR_HEIGHT); + chatter->tab_bar.rowBytes = (((width - 1) / 16) + 1) * 2; + chatter->tab_bar.baseAddr = xmalloczero( + chatter->tab_bar.rowBytes * TAB_BAR_HEIGHT, "tab_bar"); + SetRect(&chatter->tab_bar.bounds, 0, 0, width, TAB_BAR_HEIGHT); } - SetPortBits(&chatter->tab_port); + SetPortBits(&chatter->tab_bar); TextFont(geneva); TextSize(9); @@ -545,7 +545,7 @@ chatter_draw_tab_bar(struct chatter *chatter) SetPortBits(&cur_bits); - r = chatter->tab_port.bounds; + r = chatter->tab_bar.bounds; r.bottom = (*(chatter->input_te))->viewRect.top; r.top += r.bottom - TAB_BAR_HEIGHT; @@ -554,8 +554,8 @@ chatter_draw_tab_bar(struct chatter *chatter) tab->label_rect.bottom += r.top; } - CopyBits(&chatter->tab_port, &chatter->win->portBits, - &chatter->tab_port.bounds, &r, srcCopy, nil); + CopyBits(&chatter->tab_bar, &chatter->win->portBits, + &chatter->tab_bar.bounds, &r, srcCopy, nil); chatter_draw_grow_icon(chatter); } @@ -706,8 +706,8 @@ chatter_resize(struct focusable *focusable, EventRecor EraseRect(&chatter->win->portRect); /* chatter_draw_tab_bar will recreate this to the new size */ - if (chatter->tab_port.baseAddr) - xfree(&chatter->tab_port.baseAddr); + if (chatter->tab_bar.baseAddr) + xfree(&chatter->tab_bar.baseAddr); chatter_layout(chatter, false, NULL); } --- chatter.h Mon Jan 16 14:41:22 2023 +++ chatter.h Tue Jan 17 23:17:51 2023 @@ -90,7 +90,7 @@ struct chatter { WindowPtr win; TEHandle input_te; bool quitting; - BitMap tab_port; + BitMap tab_bar; short ntabs; struct chatter_tabs_head tabs_list; struct chatter_tab *current_tab;