* Destroy this map window. */
| 1882 | * Destroy this map window. |
| 1883 | */ |
| 1884 | void |
| 1885 | destroy_map_window(struct xwindow *wp) |
| 1886 | { |
| 1887 | struct map_info_t *map_info = wp->map_information; |
| 1888 | |
| 1889 | if (wp->popup) |
| 1890 | nh_XtPopdown(wp->popup); |
| 1891 | |
| 1892 | if (map_info) { |
| 1893 | struct text_map_info_t *text_map = &map_info->text_map; |
| 1894 | |
| 1895 | /* Free allocated GCs. */ |
| 1896 | int i; |
| 1897 | |
| 1898 | for (i = 0; i < CLR_MAX; i++) { |
| 1899 | XtReleaseGC(wp->w, text_map->color_gcs[i]); |
| 1900 | XtReleaseGC(wp->w, text_map->inv_color_gcs[i]); |
| 1901 | } |
| 1902 | |
| 1903 | /* Free the font structure if we allocated one */ |
| 1904 | #ifdef ENHANCED_SYMBOLS |
| 1905 | XFreeFont(XtDisplay(wp->w), text_map->font); |
| 1906 | #endif |
| 1907 | |
| 1908 | /* Free malloc'ed space. */ |
| 1909 | free((genericptr_t) map_info); |
| 1910 | wp->map_information = 0; |
| 1911 | } |
| 1912 | |
| 1913 | /* Destroy map widget. */ |
| 1914 | if (wp->popup && !wp->keep_window) |
| 1915 | XtDestroyWidget(wp->popup), wp->popup = (Widget) 0; |
| 1916 | |
| 1917 | if (wp->keep_window) |
| 1918 | XtRemoveCallback(wp->w, XtNexposeCallback, map_exposed, |
| 1919 | (XtPointer) 0); |
| 1920 | else |
| 1921 | wp->type = NHW_NONE; /* allow re-use */ |
| 1922 | |
| 1923 | /* when map goes away, presumably we're exiting, so get rid of the |
| 1924 | cached extended commands menu (if we aren't actually exiting, it |
| 1925 | will get recreated if needed again) */ |
| 1926 | release_extended_cmds(); |
| 1927 | } |
| 1928 | |
| 1929 | boolean exit_x_event; /* exit condition for the event loop */ |
| 1930 |
no test coverage detected