Changeset 561
- Timestamp:
- 09/15/07 23:14:11 (1 year ago)
- Files:
-
- trunk/src/cairo-utils.c (modified) (9 diffs)
- trunk/src/main-gtk.c (modified) (33 diffs)
- trunk/src/main-gtk.h (modified) (7 diffs)
- trunk/src/option.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/cairo-utils.c
r560 r561 25 25 void set_foreground_color(cairo_t *cr, byte a) 26 26 { 27 double red, green, blue; 28 29 red = angband_color_table[a][1] * 256; 30 green = angband_color_table[a][2] * 256; 31 blue = angband_color_table[a][3] * 256; 32 33 cairo_set_source_rgb(cr, red / 65536, green / 65536, blue / 65536); 27 cairo_set_source_rgb(cr, 28 (double)angband_color_table[a][1] / 256, 29 (double)angband_color_table[a][2] / 256, 30 (double)angband_color_table[a][3] / 256); 34 31 } 35 32 … … 44 41 void c_rect(cairo_t *cr, cairo_rectangle_t r) 45 42 { 46 cairo_rectangle (cr, r.x, r.y, r.width, r.height); 43 if (cr !=NULL) 44 cairo_rectangle (cr, r.x, r.y, r.width, r.height); 47 45 } 48 46 … … 52 50 void cairo_clear(cairo_t *cr, cairo_rectangle_t r, byte c) 53 51 { 54 cairo_save(cr); 55 c_rect(cr, r); 56 set_foreground_color(cr, c); 57 cairo_fill(cr); 58 cairo_close_path(cr); 59 cairo_restore(cr); 52 if (cr !=NULL) 53 { 54 cairo_save(cr); 55 c_rect(cr, r); 56 set_foreground_color(cr, c); 57 cairo_fill(cr); 58 cairo_close_path(cr); 59 cairo_restore(cr); 60 } 60 61 } 61 62 62 63 void cairo_cursor(cairo_t *cr, cairo_rectangle_t r, byte c) 63 64 { 64 cairo_save(cr); 65 c_rect(cr, r); 66 set_foreground_color(cr, c); 67 68 cairo_set_operator(cr, CAIRO_OPERATOR_ADD); 69 cairo_fill(cr); 70 cairo_close_path(cr); 71 cairo_restore(cr); 65 if (cr !=NULL) 66 { 67 cairo_save(cr); 68 c_rect(cr, r); 69 set_foreground_color(cr, c); 70 71 cairo_set_operator(cr, CAIRO_OPERATOR_ADD); 72 cairo_fill(cr); 73 cairo_close_path(cr); 74 cairo_restore(cr); 75 } 72 76 } 73 77 74 78 void draw_tile(cairo_t *cr, cairo_matrix_t m, cairo_rectangle_t r, int tx, int ty) 75 79 { 76 77 cairo_save(cr); 78 79 /* Use the rect and pattern */ 80 c_rect(cr, r); 81 cairo_set_source (cr, tile_pattern); 82 83 /* Pull the tile we need */ 84 cairo_surface_set_device_offset(graphical_tiles, tx - r.x, ty - r.y); 85 86 /* Use transparency */ 87 cairo_set_operator(cr, CAIRO_OPERATOR_ADD); 88 89 /* Use the matrix with our pattern */ 90 cairo_pattern_set_matrix(tile_pattern, &m); 91 92 /* Draw it */ 93 cairo_fill(cr); 94 95 cairo_restore(cr); 80 if (cr !=NULL) 81 { 82 cairo_save(cr); 83 84 /* Use the rect and pattern */ 85 c_rect(cr, r); 86 cairo_set_source (cr, tile_pattern); 87 88 /* Pull the tile we need */ 89 cairo_surface_set_device_offset(graphical_tiles, tx - r.x, ty - r.y); 90 91 /* Use transparency */ 92 cairo_set_operator(cr, CAIRO_OPERATOR_ADD); 93 94 /* Use the matrix with our pattern */ 95 cairo_pattern_set_matrix(tile_pattern, &m); 96 97 /* Draw it */ 98 cairo_fill(cr); 99 100 cairo_restore(cr); 101 } 96 102 } 97 103 … … 101 107 double sx, sy; 102 108 103 /* Get a matrix set up to scale the graphics. */ 104 cairo_get_matrix(cr, &m); 105 sx = (tile_w)/(font_w); 106 sy = (tile_h)/(font_h); 107 108 cairo_matrix_scale(&m, sx, sy); 109 if (cr !=NULL) 110 { 111 /* Get a matrix set up to scale the graphics. */ 112 cairo_get_matrix(cr, &m); 113 sx = (tile_w)/(font_w); 114 sy = (tile_h)/(font_h); 115 116 cairo_matrix_scale(&m, sx, sy); 117 } 109 118 return(m); 110 119 } 111 120 112 121 void cairo_draw_from_surface(cairo_t *cr, cairo_surface_t *surface, cairo_rectangle_t r) 113 { 114 cairo_save(cr); 115 c_rect(cr, r); 116 cairo_set_source_surface(cr, surface, 0, 0); 117 cairo_fill(cr); 118 cairo_restore(cr); 122 { 123 if (cr !=NULL) 124 { 125 cairo_save(cr); 126 c_rect(cr, r); 127 cairo_set_source_surface(cr, surface, 0, 0); 128 cairo_fill(cr); 129 cairo_restore(cr); 130 } 119 131 } 120 132 … … 136 148 int cx, cy; 137 149 150 if (cr !=NULL) 151 { 138 152 /* Get a matrix set up to scale the graphics. */ 139 153 m = cairo_font_scaling(cr, tile.w, tile.h, font.w, font.h); … … 164 178 draw_tile(cr, m, char_rect, tx, ty); 165 179 } 180 } 166 181 } 167 182 … … 194 209 font->w = r.width; 195 210 font->h = r.height; 196 211 212 pango_font_description_free(temp_font); 197 213 cairo_destroy(cr); 198 214 cairo_surface_destroy(surface); 199 215 g_object_unref(temp); 200 216 } 217 201 218 void draw_text(cairo_t *cr, font_info *font, int x, int y, int n, byte a, cptr s) 202 219 { … … 205 222 PangoFontDescription *temp_font; 206 223 224 if (cr !=NULL) 225 { 207 226 init_cairo_rect(&r, x * font->w, y * font->h, font->w * n, font->h); 208 227 … … 220 239 pango_cairo_show_layout(cr, layout); 221 240 g_object_unref(G_OBJECT(layout)); 241 } 222 242 } 223 243 trunk/src/main-gtk.c
r560 r561 36 36 */ 37 37 /*#define DISABLE_GTK_TESTING*/ 38 39 static game_command cmd = { CMD_NULL, 0 }; 38 39 static int max_win_width(term_data *td) 40 { 41 return (255 * td->font.w); 42 } 43 44 static int max_win_height(term_data *td) 45 { 46 return(255 * td->font.h); 47 } 48 49 static int drawing_win_width(term_data *td) 50 { 51 return (td->cols * td->font.w); 52 } 53 54 static int drawing_win_height(term_data *td) 55 { 56 return(td->rows * td->font.h); 57 } 58 59 static int row_in_pixels(term_data *td, int x) 60 { 61 return(x * td->font.w); 62 } 63 64 static int col_in_pixels(term_data *td, int y) 65 { 66 return(y * td->font.h); 67 } 68 69 /* 70 * Find the square a particular pixel is part of. 71 */ 72 static void pixel_to_square(int * const x, int * const y, const int ox, const int oy) 73 { 74 term_data *td = (term_data*)(Term->data); 75 76 (*x) = (ox / td->font.w); 77 (*y) = (oy / td->font.h); 78 } 40 79 41 80 static GdkRectangle cairo_rect_to_gdk(cairo_rectangle_t *r) … … 71 110 } 72 111 112 static void term_data_resize(term_data *td) 113 { 114 term *old = Term; 115 /* Activate the term */ 116 Term_activate(&td->t); 117 118 Term_resize(td->cols, td->rows); 119 120 /* Redraw the contents */ 121 Term_redraw(); 122 123 /* Flush the output */ 124 Term_fresh(); 125 Term_key_push(KTRL('R')); 126 Term_activate(old); 127 } 73 128 /* 74 129 * Get the position of the window and save it. Gtk being what it is, this is a major hack. … … 141 196 if (((w != 200) && (h != 190)) || ((w <= 100) && (h <= 100))) 142 197 { 198 /*int cols = td->cols; 199 int rows = td->rows;*/ 200 143 201 if (w != 0) 144 202 { … … 151 209 td->rows= td->size.h / td->font.h; 152 210 } 211 /*if ((cols != td->cols) || (rows != td->rows)) 212 term_data_resize(td);*/ 153 213 } 154 214 … … 199 259 geo.height_inc = td->font.h; 200 260 201 /*geo.max_width = td->font.w * 255;202 geo.max_height = td->font.h * 255;*/261 /*geo.max_width = max_win_width(); 262 geo.max_height = max_win_height();*/ 203 263 204 264 /*geo.min_width = td->font.w; … … 273 333 cairo_rectangle_t r; 274 334 275 init_cairo_rect(&r, 0, 0, 255 * td->font.w, 255 * td->font.h);335 init_cairo_rect(&r, 0, 0, max_win_width(td), max_win_height(td)); 276 336 cairo_clear(td->cr, r, TERM_DARK); 277 337 invalidate_rect(td, r); … … 290 350 291 351 /* Set dimensions */ 292 init_cairo_rect(&r, (x * td->font.w), (y * td->font.h), (td->font.w * n), (td->font.h));352 init_cairo_rect(&r, row_in_pixels(td, x), col_in_pixels(td, y), (td->font.w * n), (td->font.h)); 293 353 cairo_clear(td->cr, r, TERM_DARK); 294 354 invalidate_rect(td, r); … … 307 367 308 368 /* Set dimensions */ 309 init_cairo_rect(&r, x * td->font.w, y * td->font.h, td->font.w * n, td->font.h);369 init_cairo_rect(&r, row_in_pixels(td, x), col_in_pixels(td, y), td->font.w * n, td->font.h); 310 370 311 371 /* Clear the line */ … … 327 387 328 388 /* Set dimensions */ 329 init_cairo_rect(&r, x * td->font.w, y * td->font.h, td->font.w * n, td->font.h);389 init_cairo_rect(&r, row_in_pixels(td, x), col_in_pixels(td, y), td->font.w * n, td->font.h); 330 390 331 391 /* Clear the line */ … … 353 413 cairo_rectangle_t r; 354 414 355 init_cairo_rect(&r, 0, 0, 255 * td->font.w, 255 * td->font.h);415 init_cairo_rect(&r, 0, 0, max_win_width(td), max_win_height(td)); 356 416 invalidate_rect(td, r); 357 417 gdk_window_process_updates(td->window->window, 1); … … 416 476 417 477 /* Set dimensions */ 418 init_cairo_rect(&r, (x * td->font.w) +1, (y * td->font.h) + 1, (td->font.w) - 2, (td->font.h) - 2);478 init_cairo_rect(&r, row_in_pixels(td, x)+1, col_in_pixels(td, y) + 1, (td->font.w) - 2, (td->font.h) - 2); 419 479 cairo_cursor(td->cr, r, TERM_SLATE); 420 480 invalidate_rect(td, r); … … 486 546 save_prefs(); 487 547 do_cmd_save_game(); 548 release_memory(); 488 549 gtk_exit(0); 489 550 } … … 515 576 { 516 577 term_data *td = user_data; 517 term_data *main_term = &data[0];518 578 GtkWidget *menu_item; 519 579 char item_name[20]; … … 522 582 { 523 583 strnfmt(item_name, 16+1, "term_menu_item_%i", td->number); 524 menu_item = glade_xml_get_widget( main_term->xml, item_name);584 menu_item = glade_xml_get_widget(gtk_xml, item_name); 525 585 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_item), FALSE); 526 586 } … … 561 621 562 622 get_font_size(&td->font); 563 td->size.w = td->font.w * td->cols;564 td->size.h = td->font.h * td->rows;623 td->size.w =drawing_win_width(td); 624 td->size.h = drawing_win_height(td); 565 625 566 626 if (td->window != NULL) … … 570 630 set_window_size(td); 571 631 572 Term_flush(); 573 term_data_redraw(td); 632 create_term_cairo(td); 574 633 } 575 634 } … … 791 850 switch (event->keyval) 792 851 { 793 /*case 's':794 {795 if (mc)796 {797 GtkWidget *menu;798 term_data* main_term = &data[0];799 800 menu = glade_xml_get_widget(main_term->xml, "save_menu_item");801 gtk_widget_activate(menu);802 }803 }*/804 852 case GDK_Escape: 805 853 { … … 1103 1151 if (td->rows == 0) td->rows = 24; 1104 1152 1105 if (td->size.w <=0) td->size.w = td->font.w * td->cols;1106 if (td->size.h <=0) td->size.h = td->font.h * td->rows;1153 if (td->size.w <=0) td->size.w = drawing_win_width(td); 1154 if (td->size.h <=0) td->size.h = drawing_win_height(td); 1107 1155 if (td->tile.w <= 0) td->tile.w = td->font.w; 1108 1156 if (td->tile.h <= 0) td->tile.h = td->font.h; … … 1141 1189 } 1142 1190 1143 /*1144 * Find the square a particular pixel is part of.1145 */1146 static void pixel_to_square(int * const x, int * const y, const int ox, const int oy)1147 {1148 term_data *td = (term_data*)(Term->data);1149 1150 (*x) = (ox / td->font.w);1151 (*y) = (oy / td->font.h);1152 }1153 1154 1191 gboolean on_mouse_click(GtkWidget *widget, GdkEventButton *event, gpointer user_data) 1155 1192 { … … 1226 1263 } 1227 1264 1265 static void create_term_cairo(term_data *td) 1266 { 1267 measurements size; 1268 1269 if (td->surface != NULL) 1270 { 1271 cairo_surface_destroy(td->surface); 1272 cairo_destroy(td->cr); 1273 } 1274 1275 size.w = max_win_width(td); 1276 size.h = max_win_height(td); 1277 1278 td->surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, size.w, size.h); 1279 td->cr = cairo_create(td->surface); 1280 1281 term_data_redraw(td); 1282 } 1283 1228 1284 gboolean toggle_term_window(GtkWidget *widget, GdkEvent *event, gpointer user_data) 1229 1285 { … … 1242 1298 1243 1299 if (td->visible) 1300 { 1301 create_term_cairo(td); 1244 1302 gtk_widget_show(td->window); 1303 } 1245 1304 else 1246 1305 gtk_widget_hide(td->window); … … 1345 1404 static void setup_graphics_menu() 1346 1405 { 1347 term_data *main_term= &data[0];1348 1406 int i = 0; 1349 1407 … … 1355 1413 1356 1414 strnfmt(s, 12, "graphics_%d", i); 1357 menu = glade_xml_get_widget( main_term->xml, s);1415 menu = glade_xml_get_widget(gtk_xml, s); 1358 1416 if (checked) 1359 1417 if (!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menu))) … … 1370 1428 s = (char*)gtk_widget_get_name(widget); 1371 1429 sscanf(s, "graphics_%d", &g); 1430 1431 /* Free up old graphics */ 1432 if (graphical_tiles != NULL) 1433 cairo_surface_destroy(graphical_tiles); 1434 if (tile_pattern != NULL) 1435 cairo_pattern_destroy(tile_pattern); 1436 1372 1437 init_graf(g); 1373 1438 return(FALSE); … … 1408 1473 1409 1474 strnfmt(temp, 14, "xtra_font_%d", i); 1410 temp_widget = glade_xml_get_widget( main_term->xml, temp);1475 temp_widget = glade_xml_get_widget(gtk_xml, temp); 1411 1476 gtk_font_button_set_font_name(GTK_FONT_BUTTON (temp_widget), xd->font.name); 1412 1477 1413 xd->win = glade_xml_get_widget( main_term->xml, xd->win_name);1478 xd->win = glade_xml_get_widget(gtk_xml, xd->win_name); 1414 1479 g_signal_connect(xd->win, "delete_event", GTK_SIGNAL_FUNC(xtra_hide_event_handler), xd); 1415 1480 g_signal_connect(xd->win, "configure_event", G_CALLBACK(configure_xtra_event_handler), xd); 1416 1481 gtk_window_set_title(GTK_WINDOW(xd->win), xd->name); 1417 1482 1418 xd->menu = glade_xml_get_widget( main_term->xml, xd->item_name);1483 xd->menu = glade_xml_get_widget(gtk_xml, xd->item_name); 1419 1484 g_signal_connect(xd->menu, "activate", G_CALLBACK(toggle_xtra_window), (gpointer) xd->name); 1420 1485 … … 1423 1488 #endif 1424 1489 1425 xd->text_view = glade_xml_get_widget( main_term->xml, xd->text_view_name);1426 xd->drawing_area = glade_xml_get_widget( main_term->xml, xd->drawing_area_name);1490 xd->text_view = glade_xml_get_widget(gtk_xml, xd->text_view_name); 1491 xd->drawing_area = glade_xml_get_widget(gtk_xml, xd->drawing_area_name); 1427 1492 if (xd->text_view != NULL) 1428 1493 { … … 1447 1512 int i = 0; 1448 1513 bool err; 1449 term_data *main_term= &data[0];1450 1514 1451 1515 /* Build the paths */ 1452 1516 path_build(buf, sizeof(buf), ANGBAND_DIR_XTRA, "angband.glade"); 1517 gtk_xml = glade_xml_new(buf, NULL, NULL); 1518 1519 if (gtk_xml == NULL) 1520 { 1521 gtk_log_fmt(TERM_RED, "%s is Missing. Unrecoverable error. Aborting!", buf); 1522 quit(NULL); 1523 gtk_exit(0); 1524 } 1525 1453 1526 path_build(logo, sizeof(logo), ANGBAND_DIR_XTRA, "graf/mr_att.png"); 1454 1527 err = gtk_window_set_default_icon_from_file(logo, NULL); … … 1460 1533 if (!MAIN_WINDOW(td)) 1461 1534 { 1535 GladeXML *xml; 1536 1462 1537 /* Set up the Glade file */ 1463 td->xml = glade_xml_new(buf, "term-window", NULL); 1464 1465 td->window = glade_xml_get_widget(td->xml, "term-window"); 1466 td->drawing_area = glade_xml_get_widget(td->xml, "drawingarea2"); 1538 xml = glade_xml_new(buf, "term-window", NULL); 1539 1540 td->window = glade_xml_get_widget(xml, "term-window"); 1541 td->drawing_area = glade_xml_get_widget(xml, "drawingarea2"); 1542 1543 g_object_unref (xml); 1467 1544 } 1468 1545 else 1469 1546 { 1470 td->xml = glade_xml_new(buf, NULL, NULL); 1471 td->window = glade_xml_get_widget(td->xml, "main-window"); 1547 td->window = glade_xml_get_widget(gtk_xml, "main-window"); 1548 td->drawing_area = glade_xml_get_widget(gtk_xml, "drawingarea1"); 1549 options = glade_xml_get_widget(gtk_xml, "options_window"); 1472 1550 1473 if (td->xml == NULL)1474 {1475 gtk_log_fmt(TERM_RED, "%s is Missing. Unrecoverable error. Aborting!", buf);1476 quit(NULL);1477 gtk_exit(0);1478 }1479 td->drawing_area = glade_xml_get_widget(td->xml, "drawingarea1");1480 1481 options = glade_xml_get_widget(td->xml, "options_window");1482 1551 g_signal_connect(options, "delete_event", GTK_SIGNAL_FUNC(hide_options), NULL); 1483 1552 } … … 1500 1569 1501 1570 /* connect signal handlers that aren't passed data */ 1502 glade_xml_signal_autoconnect( main_term->xml);1571 glade_xml_signal_autoconnect(gtk_xml); 1503 1572 1504 1573 setup_graphics_menu(); … … 1507 1576 for (i = 0; i < num_term; i++) 1508 1577 { 1509 measurements size;1510 1578 term_data *td = &data[i]; 1579 GdkColor black = { 0, 0x0000, 0x0000, 0x0000 }; 1511 1580 1512 1581 gtk_widget_realize(td->window); 1513 1582 gtk_widget_realize(td->drawing_area); 1514 1515 size.w = 255 * td->font.w; 1516 size.h = 255 * td->font.h; 1517 1518 td->surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, size.w, size.h); 1519 td->cr = cairo_create(td->surface); 1583 1584 gtk_widget_modify_bg(td->window, GTK_STATE_NORMAL, &black); 1585 gtk_widget_modify_bg(td->drawing_area, GTK_STATE_NORMAL, &black); 1520 1586 1521 1587 strnfmt(temp, 14, "term_font_%d", i); 1522 temp_widget = glade_xml_get_widget( main_term->xml, temp);1588 temp_widget = glade_xml_get_widget(gtk_xml, temp); 1523 1589 gtk_widget_realize(temp_widget); 1524 1590 … … 1526 1592 } 1527 1593 } 1528 1529 1594 static void show_windows() 1530 1595 { 1531 1596 int i; 1532 1597 GtkWidget *menu_item; 1533 term_data *main_term = &data[0];1534 1598 1535 1599 /* Initialize the windows */ … … 1542 1606 Term_activate(&data[i].t); 1543 1607 1544 Term_clear_gtk();1545 1546 1608 set_window_size(td); 1547 1609 1548 1610 strnfmt(item_name, 16+1, "term_menu_item_%i", i); 1549 1550 menu_item = glade_xml_get_widget(main_term->xml, item_name); 1551 1611 menu_item = glade_xml_get_widget(gtk_xml, item_name); 1612 1613 if (td->visible) 1614 create_term_cairo(td); 1615 1552 1616 if (i == 0) 1617 { 1553 1618 gtk_widget_show(td->window); 1619 } 1554 1620 else if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menu_item)) != td->visible) 1555 1621 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_item), td->visible); 1622 1623 Term_clear_gtk(); 1556 1624 } 1557 1625 … … 1566 1634 } 1567 1635 } 1636 1637 1638 static void xtra_data_destroy(xtra_win_data *xd) 1639 { 1640 if GTK_IS_WIDGET(xd->win) 1641 gtk_widget_destroy(xd->win); 1642 if GTK_IS_WIDGET(xd->text_view) 1643 gtk_widget_destroy(xd->text_view); 1644 if GTK_IS_WIDGET(xd->menu) 1645 gtk_widget_destroy(xd->menu); 1646 if GTK_IS_WIDGET(xd->drawing_area) 1647 gtk_widget_destroy(xd->drawing_area); 1648 1649 cairo_surface_destroy(xd->surface); 1650 cairo_destroy(xd->cr); 1651 } 1652 1653 static void term_data_destroy(term_data *td) 1654 { 1655 if GTK_IS_WIDGET(td->window) 1656 gtk_widget_destroy(td->window); 1657 if GTK_IS_WIDGET(td->drawing_area) 1658 gtk_widget_destroy(td->drawing_area); 1659 1660 cairo_surface_destroy(td->surface); 1661 cairo_destroy(td->cr); 1662 } 1663 1664 static void release_memory() 1665 { 1666 int i; 1667 1668 cairo_pattern_destroy(tile_pattern); 1669 cairo_surface_destroy(graphical_tiles); 1670 1671 /* Load Extra Windows */ 1672 for (i = 0; i < MAX_XTRA_WIN_DATA; i++) 1673 { 1674 xtra_win_data *xd = &xdata[i]; 1675 1676 xtra_data_destroy(xd); 1677 } 1678 1679 /* Initialize the windows */ 1680 for (i = 0; i < num_term; i++) 1681 { 1682 term_data *td = &data[i]; 1683 1684 term_data_destroy(td); 1685 } 1686 1687 g_object_unref (gtk_xml); 1688 } 1689 1568 1690 static errr term_data_init(term_data *td, int i) 1569 1691 { trunk/src/main-gtk.h
r560 r561 76 76 GtkWidget *window; 77 77 GtkWidget *drawing_area; 78 GladeXML *xml;79 78 }; 80 79 … … 84 83 cptr name, win_name, text_view_name, item_name, drawing_area_name; 85 84 bool visible; 86 /*char font_name[256];*/87 85 font_info font; 88 86 … … 163 161 /* Path to the Gtk settings file */ 164 162 static char settings[1024]; 163 static game_command cmd = { CMD_NULL, 0 }; 164 165 GladeXML *gtk_xml; 166 167 /* Abstracted out for future changes */ 168 static int max_win_width(term_data *td); 169 static int max_win_height(term_data *td); 170 static int drawing_win_width(term_data *td); 171 static int drawing_win_height(term_data *td); 172 static int drawing_win_width(term_data *td); 173 static int drawing_win_height(term_data *td); 174 175 /* 176 * Find the square a particular pixel is part of. 177 */ 178 static void pixel_to_square(int * const x, int * const y, const int ox, const int oy); 165 179 166 180 /* Cairo's rect type to Gdks */ … … 172 186 /* Mark part of a window as invalid, so it gets redrawn */ 173 187 static void invalidate_rect(term_data *td, cairo_rectangle_t r); 174 175 188 176 189 /* … … 235 248 static void term_data_redraw(term_data *td); 236 249 250 static void create_term_cairo(term_data *td); 237 251 /* Check for events - Traditional */ 238 252 static errr CheckEvent(bool wait); … … 296 310 /* Load the prefs */ 297 311 static void load_prefs(); 298 299 /* Find the square a particular pixel is part of. */300 static void pixel_to_square(int * const x, int * const y, const int ox, const int oy);301 312 302 313 /* Register a mouse click */ … … 414 425 errr init_gtk(int argc, char **argv); 415 426 427 /* Nuke things */ 428 static void xtra_data_destroy(xtra_win_data *xd); 429 static void term_data_destroy(term_data *td); 430 static void release_memory(); 416 431 #endif /* INCLUDED_MAIN_GTK_H */ trunk/src/option.c
r557 r561 97 97 OPT_birth_ai_cheat, 98 98 OPT_birth_ai_smart, 99 OPT_NONE, 99 100 }, 100 101
