Advertisement
Guest User

Untitled

a guest
Nov 4th, 2011
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 45.95 KB | None | 0 0
  1. # This patch is based on the Ubuntu patch for TiEmu 3.02, see
  2. # http://packages.ubuntu.com/de/oneiric/tiemu
  3.  
  4.  
  5. diff -purN tiemu-3.03.orig/src/gui/calc/calc.c tiemu-3.03/src/gui/calc/calc.c
  6. --- tiemu-3.03.orig/src/gui/calc/calc.c 2007-12-16 16:29:16.000000000 +0100
  7. +++ tiemu-3.03/src/gui/calc/calc.c  2011-11-04 23:11:40.000000000 +0100
  8. @@ -313,7 +313,7 @@ on_drawingarea1_expose_event           (
  9.  {
  10.      gdk_draw_pixmap(
  11.          widget->window,
  12. -       widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
  13. +       widget->style->fg_gc[gtk_widget_get_state (widget)],
  14.         pixmap,
  15.         event->area.x, event->area.y,
  16.         event->area.x, event->area.y,
  17. @@ -586,7 +586,7 @@ int  hid_init(void)
  18.  
  19.      // Install LCD refresh: 100 FPS (10 ms)
  20.      tid = g_timeout_add((params.lcd_rate == -1) ? 50 : params.lcd_rate,
  21. -       (GtkFunction)hid_refresh, NULL);
  22. +       (GSourceFunc)hid_refresh, NULL);
  23.  
  24.     explicit_destroy = 0;
  25.     gtk_widget_show(main_wnd);  // show wnd here
  26. @@ -640,7 +640,7 @@ void hid_lcd_rate_set(void)
  27.     g_source_remove(tid);
  28.  
  29.     tid = g_timeout_add((params.lcd_rate == -1) ? 50 : params.lcd_rate,
  30. -       (GtkFunction)hid_refresh, NULL);
  31. +       (GSourceFunc)hid_refresh, NULL);
  32.  }
  33.  
  34.  int hid_switch_with_skin(void)
  35. diff -purN tiemu-3.03.orig/src/gui/calc/popup.c tiemu-3.03/src/gui/calc/popup.c
  36. --- tiemu-3.03.orig/src/gui/calc/popup.c    2009-05-08 22:43:47.000000000 +0200
  37. +++ tiemu-3.03/src/gui/calc/popup.c 2011-11-04 22:45:28.000000000 +0100
  38. @@ -26,7 +26,9 @@
  39.  #  include <config.h>
  40.  #endif
  41.  
  42. +#undef GTK_DISABLE_DEPRECATED
  43.  #include <gtk/gtk.h>
  44. +#define GTK_DISABLE_DEPRECATED
  45.  #include <glade/glade.h>
  46.  #include <stdlib.h>
  47.  #include <string.h>
  48. diff -purN tiemu-3.03.orig/src/gui/calc/popup.c.orig tiemu-3.03/src/gui/calc/popup.c.orig
  49. --- tiemu-3.03.orig/src/gui/calc/popup.c.orig   1970-01-01 01:00:00.000000000 +0100
  50. +++ tiemu-3.03/src/gui/calc/popup.c.orig    2009-05-08 22:43:47.000000000 +0200
  51. @@ -0,0 +1,870 @@
  52. +/* Hey EMACS -*- linux-c -*- */
  53. +/* $Id: popup.c 2840 2009-05-08 20:43:47Z kevinkofler $ */
  54. +
  55. +/*  TiEmu - Tiemu Is an EMUlator
  56. + *
  57. + *  Copyright (c) 2000-2001, Thomas Corvazier, Romain Lievin
  58. + *  Copyright (c) 2001-2003, Romain Lievin
  59. + *  Copyright (c) 2003, Julien Blache
  60. + *  Copyright (c) 2004, Romain Liévin
  61. + *  Copyright (c) 2005-2007, Romain Liévin, Kevin Kofler
  62. + *
  63. + *  This program is free software; you can redistribute it and/or modify
  64. + *  it under the terms of the GNU General Public License as published by
  65. + *  the Free Software Foundation; either version 2 of the License, or
  66. + *  (at your option) any later version.
  67. + *  This program is distributed in the hope that it will be useful,
  68. + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  69. + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  70. + *  GNU General Public License for more details. *
  71. + *  You should have received a copy of the GNU General Public License
  72. + *  along with this program; if not, write to the Free Software
  73. + *  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
  74. + */
  75. +
  76. +#ifdef HAVE_CONFIG_H
  77. +#  include <config.h>
  78. +#endif
  79. +
  80. +#include <gtk/gtk.h>
  81. +#include <glade/glade.h>
  82. +#include <stdlib.h>
  83. +#include <string.h>
  84. +#ifdef __MINGW32__
  85. +#include <windows.h>
  86. +#endif
  87. +
  88. +#include "intl.h"
  89. +#include "support.h"
  90. +#include "struct.h"
  91. +#include "version.h"
  92. +#include "popup.h"
  93. +#include "paths.h"
  94. +#include "engine.h"
  95. +#include "fs_misc.h"
  96. +#include "device.h"
  97. +#include "rcfile.h"
  98. +#include "dboxes.h"
  99. +#include "romversion.h"
  100. +#include "calc.h"
  101. +#include "release.h"
  102. +#include "about.h"
  103. +#include "infos.h"
  104. +#include "manpage.h"
  105. +#include "scroptions.h"
  106. +#include "tie_error.h"
  107. +#include "dbg_all.h"
  108. +#include "quicksend.h"
  109. +#include "filesel.h"
  110. +#include "keypress.h"
  111. +#ifndef NO_SOUND
  112. +#include "audio.h"
  113. +#endif
  114. +
  115. +#include "ti68k_int.h"
  116. +#include "ti68k_def.h"
  117. +
  118. +GLADE_CB void
  119. +on_popup_menu_header                   (GtkMenuItem     *menuitem,
  120. +                                        gpointer         user_data)
  121. +{
  122. +   fprintf(stdout, _("* TiEmu version %s (cables=%s, files=%s, calcs=%s, conv=%s)"),
  123. +        TIEMU_VERSION,
  124. +        ticables_version_get(), tifiles_version_get(), ticalcs_version_get(), ticonv_version_get());
  125. +}
  126. +
  127. +/* menu part 1 (link) */
  128. +
  129. +GLADE_CB void
  130. +on_send_file_to_tiemu1_activate     (GtkMenuItem     *menuitem,
  131. +                                     gpointer         user_data)
  132. +{
  133. +   if(engine_is_stopped()) return;
  134. +
  135. +   engine_stop();
  136. +
  137. +   if(!options.qs_enabled)
  138. +       display_send_files_dbox();
  139. +   else if(options.qs_enabled && options.qs_file && strlen(options.qs_file))
  140. +       fs_send_file(options.qs_file);
  141. +
  142. +   engine_start();
  143. +}
  144. +
  145. +GLADE_CB void
  146. +on_recv_file_from_tiemu1_activate     (GtkMenuItem     *menuitem,
  147. +                                       gpointer         user_data)
  148. +{
  149. +   int active;
  150. +   if(engine_is_stopped()) return;
  151. +   active = GTK_CHECK_MENU_ITEM(menuitem)->active;
  152. +#ifndef NO_SOUND
  153. +   if (active)
  154. +       audio_disable();
  155. +#endif
  156. +   params.recv_file = active;
  157. +}
  158. +
  159. +GLADE_CB void
  160. +on_emulate_sound1_activate     (GtkMenuItem     *menuitem,
  161. +                                gpointer         user_data)
  162. +{
  163. +#ifndef NO_SOUND
  164. +   int active;
  165. +   if(engine_is_stopped()) return;
  166. +   active = GTK_CHECK_MENU_ITEM(menuitem)->active;
  167. +   if (active) {
  168. +       params.recv_file = 0;
  169. +       audio_enable();
  170. +   } else
  171. +       audio_disable();
  172. +#endif
  173. +}
  174. +
  175. +
  176. +GLADE_CB void
  177. +on_debug_file_with_tiemu1_activate     (GtkMenuItem     *menuitem,
  178. +                                        gpointer         user_data)
  179. +{
  180. +   if(engine_is_stopped()) return;
  181. +
  182. +   engine_stop();
  183. +#ifndef NO_GDB
  184. +   display_debug_dbox();
  185. +#endif
  186. +   engine_start();
  187. +}
  188. +
  189. +
  190. +GLADE_CB void
  191. +on_link_cable1_activate                (GtkMenuItem     *menuitem,
  192. +                                        gpointer         user_data)
  193. +{
  194. +   if(engine_is_stopped()) return;
  195. +
  196. +   engine_stop();
  197. +   display_device_dbox();
  198. +   engine_start();
  199. +}
  200. +
  201. +GLADE_CB void
  202. +on_quick_send1_activate                (GtkMenuItem     *menuitem,
  203. +                                        gpointer         user_data)
  204. +{
  205. +   if(engine_is_stopped()) return;
  206. +
  207. +   engine_stop();
  208. +   display_quicksend_dbox();
  209. +   engine_start();
  210. +}
  211. +
  212. +/* menu part 2 (config & state) */
  213. +
  214. +void window_get_rect(GtkWidget *widget, GdkRect *rect);
  215. +
  216. +GLADE_CB void
  217. +on_save_config1_activate               (GtkMenuItem     *menuitem,
  218. +                                        gpointer         user_data)
  219. +{
  220. +   // save main window position
  221. +   window_get_rect(main_wnd, &options3.calc.rect);
  222. +
  223. +   //write config
  224. +   rcfile_write();
  225. +
  226. +#ifdef __WIN32__
  227. +   msg_box1(_("Information"),
  228. +     _("Configuration file saved (in tiemu.ini)."));
  229. +#else
  230. +   msg_box1(_("Information"),
  231. +     _("Configuration file saved (in ~/.tiemu)."));
  232. +#endif
  233. +}
  234. +
  235. +
  236. +GLADE_CB void
  237. +on_load_config1_activate               (GtkMenuItem     *menuitem,
  238. +                                        gpointer         user_data)
  239. +{
  240. +   rcfile_read();
  241. +
  242. +   msg_box1(_("Information"), _("Configuration file loaded."));
  243. +}
  244. +
  245. +
  246. +GLADE_CB void
  247. +on_load_state_image1_activate          (GtkMenuItem     *menuitem,
  248. +                                        gpointer         user_data)
  249. +{
  250. +   engine_stop();
  251. +   display_load_state_dbox();
  252. +   engine_start();
  253. +}
  254. +
  255. +
  256. +GLADE_CB void
  257. +on_save_state_image1_activate          (GtkMenuItem     *menuitem,
  258. +                                        gpointer         user_data)
  259. +{
  260. +   engine_stop();
  261. +   display_save_state_dbox();
  262. +   engine_start();
  263. +}
  264. +
  265. +
  266. +GLADE_CB void
  267. +on_revert_to_saved_state1_activate     (GtkMenuItem     *menuitem,
  268. +                                        gpointer         user_data)
  269. +{
  270. +   engine_stop();
  271. +   ti68k_state_load(params.sav_file);
  272. +   engine_start();
  273. +}
  274. +
  275. +void
  276. +on_quick_save_state_image1_activate    (GtkMenuItem     *menuitem,
  277. +                                        gpointer         user_data)
  278. +{
  279. +   gchar *basename;
  280. +   gchar *dot;
  281. +
  282. +   // build name
  283. +   basename = g_path_get_basename(params.rom_file);
  284. +   dot = strrchr(basename, '.');
  285. +   if(dot != NULL)
  286. +       *dot = '\0';
  287. +
  288. +   // set path
  289. +   g_free(params.sav_file);
  290. +   params.sav_file = g_strconcat(inst_paths.img_dir, basename, ".sav", NULL);
  291. +   g_free(basename);
  292. +
  293. +   // save state
  294. +   ti68k_state_save(params.sav_file);
  295. +}
  296. +
  297. +/* menu part 3 (debug) */
  298. +
  299. +GLADE_CB void
  300. +on_enter_debugger1_activate            (GtkMenuItem     *menuitem,
  301. +                                        gpointer         user_data)
  302. +{
  303. +#ifndef __IPAQ__
  304. +    if(dbg_on) return;
  305. +   if(!dbg_load) return;
  306. +
  307. +   engine_stop();
  308. +    ti68k_debug_break();
  309. +   engine_start();
  310. +#endif
  311. +}
  312. +
  313. +GLADE_CB void
  314. +on_reset_calc1_activate                (GtkMenuItem     *menuitem,
  315. +                                        gpointer         user_data)
  316. +{
  317. +   engine_stop();
  318. +   switch (msg_box3(_("Question"), _("Clear RAM?"), GTK_STOCK_YES, GTK_STOCK_NO, GTK_STOCK_CANCEL)) {
  319. +     case BUTTON1:
  320. +       memset(tihw.ram, 0, tihw.ram_size);
  321. +     case BUTTON2:
  322. +       ti68k_reset();
  323. +       if (dbg_on)
  324. +         gtk_debugger_close();
  325. +       else {
  326. +         default:
  327. +           engine_start();
  328. +       }
  329. +   }
  330. +}
  331. +
  332. +/* menu part 4 (images) */
  333. +
  334. +GLADE_CB void
  335. +on_upgrade_calc1_activate                (GtkMenuItem     *menuitem,
  336. +                                        gpointer         user_data)
  337. +{
  338. +   engine_stop();
  339. +   display_set_tib_dbox();
  340. +   engine_start();
  341. +}
  342. +
  343. +
  344. +GLADE_CB void
  345. +on_set_rom1_activate                   (GtkMenuItem     *menuitem,
  346. +                                        gpointer         user_data)
  347. +{
  348. +   engine_stop();
  349. +   display_romversion_dbox (FALSE);
  350. +   engine_start();
  351. +}
  352. +
  353. +/* menu part 5.1 (emulator options) */
  354. +
  355. +GLADE_CB void
  356. +on_restrict_to_actual_speed1_activate  (GtkMenuItem     *menuitem,
  357. +                                        gpointer         user_data)
  358. +{
  359. +   int engine_was_stopped = engine_is_stopped();
  360. +   engine_stop();
  361. +    if(GTK_CHECK_MENU_ITEM(menuitem)->active != TRUE)
  362. +       params.restricted = 0;
  363. +   else
  364. +       params.restricted = 1;
  365. +   if (!engine_was_stopped) engine_start();
  366. +}
  367. +
  368. +GLADE_CB void
  369. +on_hw_protection1_activate             (GtkMenuItem     *menuitem,
  370. +                                        gpointer         user_data)
  371. +{
  372. +    if(GTK_CHECK_MENU_ITEM(menuitem)->active != TRUE)
  373. +       params.hw_protect = 0;
  374. +   else
  375. +       params.hw_protect = 1;
  376. +}
  377. +
  378. +GLADE_CB void
  379. +on_high_lcd_update1_activate           (GtkMenuItem     *menuitem,
  380. +                                        gpointer         user_data)
  381. +{
  382. +   params.lcd_rate = 25;
  383. +   hid_lcd_rate_set();
  384. +}
  385. +
  386. +GLADE_CB void
  387. +on_med_lcd_update1_activate            (GtkMenuItem     *menuitem,
  388. +                                        gpointer         user_data)
  389. +{
  390. +   params.lcd_rate = 55;
  391. +   hid_lcd_rate_set();
  392. +}
  393. +
  394. +GLADE_CB void
  395. +on_low_lcd_update1_activate            (GtkMenuItem     *menuitem,
  396. +                                        gpointer         user_data)
  397. +{
  398. +   params.lcd_rate = 85;
  399. +   hid_lcd_rate_set();
  400. +}
  401. +
  402. +GLADE_CB void
  403. +on_normal_view1_activate               (GtkMenuItem     *menuitem,
  404. +                                        gpointer         user_data)
  405. +{
  406. +   if(GTK_CHECK_MENU_ITEM(menuitem)->active == TRUE)
  407. +       hid_switch_normal_view();
  408. +}
  409. +
  410. +
  411. +GLADE_CB void
  412. +on_large_view1_activate                (GtkMenuItem     *menuitem,
  413. +                                        gpointer         user_data)
  414. +{
  415. +   if(GTK_CHECK_MENU_ITEM(menuitem)->active == TRUE)
  416. +       hid_switch_large_view();
  417. +}
  418. +
  419. +
  420. +GLADE_CB void
  421. +on_full_view1_activate                 (GtkMenuItem     *menuitem,
  422. +                                        gpointer         user_data)
  423. +{
  424. +   if(GTK_CHECK_MENU_ITEM(menuitem)->active == TRUE)
  425. +       hid_switch_fullscreen();
  426. +}
  427. +
  428. +GLADE_CB void
  429. +on_custom_view1_activate               (GtkMenuItem     *menuitem,
  430. +                                        gpointer         user_data)
  431. +{
  432. +}
  433. +
  434. +/* menu part 5.2 (skin options) */
  435. +
  436. +GLADE_CB void
  437. +on_no_skin1_activate                      (GtkMenuItem     *menuitem,
  438. +                                        gpointer         user_data)
  439. +{
  440. +#ifndef __IPAQ__
  441. +   hid_switch_without_skin();
  442. +#endif
  443. +}
  444. +
  445. +
  446. +GLADE_CB void
  447. +on_default_skin1_activate                      (GtkMenuItem     *menuitem,
  448. +                                        gpointer         user_data)
  449. +{
  450. +#ifndef __IPAQ__
  451. +   hid_switch_with_skin();
  452. +#endif
  453. +}
  454. +
  455. +
  456. +GLADE_CB void
  457. +on_set_skin1_activate                  (GtkMenuItem     *menuitem,
  458. +                                        gpointer         user_data)
  459. +{
  460. +   display_skin_dbox();
  461. +}
  462. +
  463. +/* menu part 5.3 (screenshot options) */
  464. +
  465. +GLADE_CB void
  466. +on_now1_activate                     (GtkMenuItem     *menuitem,
  467. +                                        gpointer         user_data)
  468. +{
  469. +   if(options2.shots > 1)
  470. +       hid_screenshot_burst();
  471. +   else
  472. +       hid_screenshot_single();
  473. +}
  474. +
  475. +
  476. +GLADE_CB void
  477. +on_screen_options1_activate               (GtkMenuItem     *menuitem,
  478. +                                        gpointer         user_data)
  479. +{
  480. +   display_scroptions_dbox();
  481. +}
  482. +
  483. +GLADE_CB void
  484. +on_copy_to_clipboard1_activate        (GtkMenuItem     *menuitem,
  485. +                                       gpointer         user_data)
  486. +{
  487. +   options2.clipboard = GTK_CHECK_MENU_ITEM(menuitem)->active ? 1 : 0;
  488. +}
  489. +
  490. +/* menu part 5.4 (key press options) */
  491. +
  492. +GLADE_CB void
  493. +on_setup_recording1_activate             (GtkMenuItem     *menuitem,
  494. +                                          gpointer         user_data)
  495. +{
  496. +   const gchar *filename = create_fsel(inst_paths.base_dir, "keypress.txt", "*.txt", TRUE);
  497. +   if (!filename)
  498. +       return;
  499. +
  500. +   g_free(options.kp_rec_file);
  501. +   options.kp_rec_file = g_strdup(filename);
  502. +}
  503. +
  504. +GLADE_CB void
  505. +on_start_recording1_activate             (GtkMenuItem     *menuitem,
  506. +                                          gpointer         user_data)
  507. +{
  508. +   if(options.kp_ply_enabled || !options.kp_rec_file) return;
  509. +
  510. +   options.kp_rec_enabled = !options.kp_rec_enabled;
  511. +
  512. +   if(options.kp_rec_enabled)
  513. +       kp_recording_start(options.kp_rec_file);
  514. +   else
  515. +       kp_recording_stop();
  516. +}
  517. +
  518. +GLADE_CB void
  519. +on_setup_playing1_activate             (GtkMenuItem     *menuitem,
  520. +                                        gpointer         user_data)
  521. +{
  522. +   const gchar *filename = create_fsel(inst_paths.base_dir, NULL, "*.txt", FALSE);
  523. +   if (!filename)
  524. +       return;
  525. +
  526. +   g_free(options.kp_ply_file);
  527. +   options.kp_ply_file = g_strdup(filename);
  528. +}
  529. +
  530. +static gboolean kp_callback(gpointer data)
  531. +{
  532. +   int key, action, ret;
  533. +
  534. +   ret = kp_playing_key(&key, &action);
  535. +   if(ret)
  536. +   {
  537. +       kp_playing_stop();
  538. +       return FALSE;
  539. +   }
  540. +
  541. +   ti68k_kbd_set_key(key, action);
  542. +   //printf("%i %i\n", key, action);
  543. +
  544. +   return TRUE;
  545. +}
  546. +
  547. +GLADE_CB void
  548. +on_start_playing1_activate             (GtkMenuItem     *menuitem,
  549. +                                        gpointer         user_data)
  550. +{
  551. +   kp_playing_start(options.kp_ply_file);
  552. +   g_timeout_add(250, kp_callback, NULL);
  553. +}
  554. +
  555. +/* menu part 6 (misc) */
  556. +
  557. +static void go_to_bookmark(const char *link);
  558. +
  559. +GLADE_CB void
  560. +on_help1_activate                      (GtkMenuItem     *menuitem,
  561. +                                        gpointer         user_data)
  562. +{
  563. +   gchar *path = g_strconcat(inst_paths.help_dir, _("Manual_en.html"), NULL);
  564. +
  565. +   go_to_bookmark(path);
  566. +   g_free(path);
  567. +}
  568. +
  569. +
  570. +GLADE_CB void
  571. +on_manpage1_activate                   (GtkMenuItem     *menuitem,
  572. +                                        gpointer         user_data)
  573. +{
  574. +   display_manpage_dbox();
  575. +}
  576. +
  577. +GLADE_CB void
  578. +on_bookmarks1_activate                (GtkMenuItem     *menuitem,
  579. +                                       gpointer        user_data)
  580. +{
  581. +#if GTK_CHECK_VERSION(2,12,0)
  582. +   GtkWidget *dialog;
  583. +   const gchar *message =
  584. +    _("You're using GTK+ >= 2.12 so bookmark support is currently unavailable.");
  585. +  
  586. +   dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL,
  587. +                 GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,
  588. +                 message);
  589. +   gtk_dialog_run(GTK_DIALOG(dialog));
  590. +   gtk_widget_destroy(dialog);
  591. +#else
  592. +   GtkTooltipsData* data = gtk_tooltips_data_get(GTK_WIDGET(menuitem)); /* FIXME: deprecated in GTK+ 2.12 */
  593. +   go_to_bookmark(data->tip_text);
  594. +#endif
  595. +}
  596. +
  597. +
  598. +GLADE_CB void
  599. +on_bugreport1_activate                (GtkMenuItem     *menuitem,
  600. +                                        gpointer         user_data)
  601. +{
  602. +   GtkWidget *dialog;
  603. +   const gchar *message =
  604. +    _("There are several ways to get in touch if you encounter a problem with TiEmu or if you have questions, suggestions, bug reports, etc:\n- if you have general questions or problems, please consider the users' mailing list first (http://tiemu-users@list.sf.net).\n- if you want to discuss about TiEmu, you can use the TiEmu forum (http://sourceforge.net/forum/?group_id=23169).\n- for bug reports, use the 'Bug Tracking System' (http://sourceforge.net/tracker/?group_id=23169).\n\nBefore e-mailing the TiEmu team, make sure you have read the manual and/or the FAQ....");
  605. +  
  606. +   dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL,
  607. +                 GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,
  608. +                 message);
  609. +   gtk_dialog_run(GTK_DIALOG(dialog));
  610. +   gtk_widget_destroy(dialog);
  611. +}
  612. +
  613. +GLADE_CB void
  614. +on_changelog1_activate               (GtkMenuItem     *menuitem,
  615. +                                        gpointer         user_data)
  616. +{
  617. +   display_release_dbox ();
  618. +}
  619. +
  620. +
  621. +GLADE_CB void
  622. +on_about1_activate                     (GtkMenuItem     *menuitem,
  623. +                                        gpointer         user_data)
  624. +{
  625. +   display_about_dbox ();
  626. +}
  627. +
  628. +
  629. +GLADE_CB void
  630. +on_infos1_activate                     (GtkMenuItem     *menuitem,
  631. +                                        gpointer         user_data)
  632. +{
  633. +   display_infos_dbox();
  634. +}
  635. +
  636. +void exit_main_loop(void);
  637. +
  638. +GLADE_CB void
  639. +on_exit_and_save_state1_activate       (GtkMenuItem     *menuitem,
  640. +                                        gpointer         user_data)
  641. +{
  642. +   // stop emulation engine
  643. +   engine_stop();
  644. +
  645. +   // save state
  646. +   on_quick_save_state_image1_activate(NULL, NULL);
  647. +
  648. +   // and config
  649. +   window_get_rect(main_wnd, &options3.calc.rect);
  650. +    rcfile_write();
  651. +
  652. +   // exit
  653. +   exit_main_loop();
  654. +   gtk_main_quit();
  655. +}
  656. +
  657. +
  658. +GLADE_CB void
  659. +on_exit_without_saving_state1_activate (GtkMenuItem     *menuitem,
  660. +                                        gpointer         user_data)
  661. +{
  662. +#if 0
  663. +   {
  664. +       //testing...
  665. +       GdkEvent* event = gdk_event_new(GDK_KEY_PRESS);
  666. +
  667. +       event->key.type = GDK_KEY_PRESS;
  668. +       event->key.window = main_wnd->window;
  669. +       event->key.send_event = FALSE;
  670. +       event->key.time = GDK_CURRENT_TIME;
  671. +       event->key.state = GDK_LOCK_MASK;
  672. +       event->key.keyval = -1;
  673. +       event->key.length = 0;
  674. +       event->key.string = "";
  675. +       event->key.hardware_keycode = 0x14;
  676. +       event->key.group = 0;  
  677. +      
  678. +       gdk_event_put(event);
  679. +       while(gtk_events_pending()) gtk_main_iteration_do(FALSE);
  680. +       //gdk_event_free(event);
  681. +   }
  682. +#endif
  683. +
  684. +   exit_main_loop();
  685. +   gtk_main_quit();
  686. +}
  687. +
  688. +typedef void (*VCB) (void);
  689. +extern int reset_disabled;
  690. +
  691. +/*
  692. +  Display the GTK popup menu and configure some items
  693. +*/
  694. +GtkWidget* display_popup_menu(void)
  695. +{
  696. +   GladeXML *xml;
  697. +   GtkWidget *menu;
  698. +   GtkWidget *data;
  699. +   gchar *s;
  700. +  
  701. +   //menu = create_popup_menu();
  702. +   xml = glade_xml_new
  703. +       (tilp_paths_build_glade("popup-2.glade"), "popup_menu",
  704. +        PACKAGE);
  705. +   if (!xml)
  706. +       g_error(_("%s: GUI loading failed!\n"), __FILE__);
  707. +   glade_xml_signal_autoconnect(xml);
  708. +
  709. +   menu = glade_xml_get_widget(xml, "popup_menu");
  710. +
  711. +   // set version
  712. +   data = glade_xml_get_widget(xml, "popup_menu_header");
  713. +   s = g_strdup_printf("TiEmu, version %s", TIEMU_VERSION);
  714. +   gtk_label_set_text(GTK_LABEL(GTK_BIN(data)->child), s);
  715. +   g_free(s);
  716. +
  717. +   // init check buttons
  718. +   data = glade_xml_get_widget(xml, "recv_file_from_tiemu1");
  719. +   gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(data), params.recv_file);
  720. +   data = glade_xml_get_widget(xml, "emulate_sound1");
  721. +#ifdef NO_SOUND
  722. +   gtk_widget_set_sensitive(data, FALSE);
  723. +#else
  724. +   gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(data), audio_isactive);
  725. +#endif
  726. +
  727. +   data = glade_xml_get_widget(xml, "restrict1");
  728. +   g_signal_handlers_block_by_func(GTK_OBJECT(data), (VCB)on_restrict_to_actual_speed1_activate, NULL);
  729. +   gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(data), params.restricted);
  730. +   g_signal_handlers_unblock_by_func(GTK_OBJECT(data), (VCB)on_restrict_to_actual_speed1_activate, NULL);
  731. +
  732. +   data = glade_xml_get_widget(xml, "hw_protection1");
  733. +   g_signal_handlers_block_by_func(GTK_OBJECT(data), (VCB)on_hw_protection1_activate, NULL);
  734. +   gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(data), params.hw_protect);
  735. +   g_signal_handlers_unblock_by_func(GTK_OBJECT(data), (VCB)on_hw_protection1_activate, NULL);
  736. +
  737. +   // hide the custom view radio button
  738. +   data = glade_xml_get_widget(xml, "custom_view1");
  739. +   gtk_widget_hide(data);
  740. +   data = glade_xml_get_widget(xml, "full_view1");
  741. +   gtk_widget_set_sensitive(data, FALSE);
  742. +
  743. +#ifdef NO_GDB
  744. +   data = glade_xml_get_widget(xml, "debug_file_with_tiemu1");
  745. +   gtk_widget_set_sensitive(data, FALSE);
  746. +#endif
  747. +
  748. +   // init radio buttons
  749. +    switch(options.view)
  750. +    {
  751. +    case VIEW_NORMAL:
  752. +        data = glade_xml_get_widget(xml, "normal_view1");
  753. +        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(data), TRUE);
  754. +        break;
  755. +    case VIEW_LARGE:
  756. +        data = glade_xml_get_widget(xml, "large_view1");
  757. +        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(data), TRUE);
  758. +        break;
  759. +   case VIEW_FULL:
  760. +       data = glade_xml_get_widget(xml, "full_view1");
  761. +        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(data), TRUE);
  762. +       break;
  763. +   case VIEW_CUSTOM:
  764. +       data = glade_xml_get_widget(xml, "custom_view1");
  765. +        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(data), TRUE);
  766. +       break;
  767. +    default:
  768. +        break;
  769. +    }
  770. +
  771. +   if(params.lcd_rate >= 10 && params.lcd_rate < 40)
  772. +   {
  773. +       data = glade_xml_get_widget(xml, "high_lcd_update1");
  774. +        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(data), TRUE);
  775. +   }
  776. +   else if((params.lcd_rate >= 40 && params.lcd_rate < 70) || params.lcd_rate == -1)
  777. +   {
  778. +       data = glade_xml_get_widget(xml, "med_lcd_update1");
  779. +        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(data), TRUE);
  780. +   }
  781. +   else if(params.lcd_rate >= 70 && params.lcd_rate < 100)
  782. +   {
  783. +       data = glade_xml_get_widget(xml, "low_lcd_update1");
  784. +        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(data), TRUE);
  785. +   }
  786. +
  787. +   // if debugger is open, blocks some items
  788. +   if(dbg_on || !dbg_load)
  789. +   {
  790. +#ifndef NO_GDB
  791. +       data = glade_xml_get_widget(xml, "send_file_to_tiemu1");
  792. +       gtk_widget_set_sensitive(data, FALSE);
  793. +
  794. +       data = glade_xml_get_widget(xml, "debug_file_with_tiemu1");
  795. +       gtk_widget_set_sensitive(data, FALSE);
  796. +#endif
  797. +
  798. +       data = glade_xml_get_widget(xml, "recv_file_from_tiemu1");
  799. +       gtk_widget_set_sensitive(data, FALSE);
  800. +
  801. +       data = glade_xml_get_widget(xml, "link_cable1");
  802. +       gtk_widget_set_sensitive(data, FALSE);
  803. +
  804. +       data = glade_xml_get_widget(xml, "upgrade_calc1");
  805. +       gtk_widget_set_sensitive(data, FALSE);
  806. +
  807. +       data = glade_xml_get_widget(xml, "set_rom1");
  808. +       gtk_widget_set_sensitive(data, FALSE);
  809. +
  810. +       if (reset_disabled)
  811. +       {
  812. +           data = glade_xml_get_widget(xml, "reset_calc1");
  813. +           gtk_widget_set_sensitive(data, FALSE);
  814. +       }
  815. +
  816. +       data = glade_xml_get_widget(xml, "calculator_state1");
  817. +       gtk_widget_set_sensitive(data, FALSE);
  818. +   }
  819. +
  820. +   data = glade_xml_get_widget(xml, "start_recording1");
  821. +   g_signal_handlers_block_by_func(GTK_OBJECT(data), (VCB)on_start_recording1_activate, NULL);
  822. +   gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(data), options.kp_rec_enabled);
  823. +   g_signal_handlers_unblock_by_func(GTK_OBJECT(data), (VCB)on_start_recording1_activate, NULL);
  824. +
  825. +   data = glade_xml_get_widget(xml, "start_playing1");
  826. +   g_signal_handlers_block_by_func(GTK_OBJECT(data), (VCB)on_start_playing1_activate, NULL);
  827. +   gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(data), options.kp_ply_enabled);
  828. +   g_signal_handlers_unblock_by_func(GTK_OBJECT(data), (VCB)on_start_playing1_activate, NULL);
  829. +
  830. +   data = glade_xml_get_widget(xml, "copy_to_clipboard1");
  831. +   gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(data), options2.clipboard);
  832. +
  833. +   return menu;
  834. +}
  835. +
  836. +
  837. +/* */
  838. +
  839. +static void go_to_bookmark(const char *link)
  840. +{
  841. +#ifdef __WIN32__
  842. +   HINSTANCE hInst;
  843. +
  844. +   // Windows do the whole work for us, let's go...
  845. +   hInst = ShellExecute(NULL, "open", link, NULL, NULL, SW_SHOWNORMAL);
  846. +   if((int)hInst <= 32)
  847. +   {
  848. +       msg_box1(_("Error"), _("Unable to run ShellExecute extension."));
  849. +   }
  850. +#else
  851. +   // Kevin's list:
  852. +   // These ones should be first, as they will honor the user's choice rather
  853. +   // than guessing an arbitrary one:
  854. +   // * /usr/bin/xdg-open (runs the default browser of the desktop environment
  855. +   // currently in use, this is the best solution)
  856. +   // * /usr/bin/gnome-open (GNOME 2.6+ default browser, user-configurable)
  857. +   // Distro-specific browser wrapper scripts:
  858. +   // * /usr/bin/sensible-browser (Debian's browser script)
  859. +   // * /usr/bin/htmlview (old RHL/Fedora default browser script, current
  860. +   // versions will honor the GNOME browser preference)
  861. +   // Fallback to a hardcoded list of browsers:
  862. +   // * /usr/bin/firefox (Mozilla Firefox)
  863. +   // * /usr/bin/seamonkey (Seamonkey)
  864. +   // * /usr/bin/konqueror (Konqueror)
  865. +   // * /usr/bin/mozilla (old Mozilla Suite)
  866. +   //
  867. +   gboolean result;
  868. +   char *apps[] = {
  869. +           "/usr/bin/xdg-open",
  870. +           "/usr/bin/gnome-open",
  871. +           "/usr/bin/sensible-browser",
  872. +           "/usr/bin/htmlview",
  873. +           "/usr/bin/firefox",
  874. +           "/usr/bin/seamonkey",
  875. +           "/usr/bin/konqueror",
  876. +           "/usr/bin/mozilla",
  877. +   };
  878. +   gint i, n;
  879. +
  880. +   n = sizeof(apps) / sizeof(char *);
  881. +   for(i = 0; i < n; i++)
  882. +   {
  883. +       gchar **argv = g_malloc0(3 * sizeof(gchar *));
  884. +
  885. +       argv[0] = g_strdup(apps[i]);
  886. +       argv[1] = g_strdup(link);
  887. +       argv[2] = NULL;
  888. +
  889. +       result = g_spawn_async(NULL, argv, NULL, 0, NULL, NULL, NULL, NULL);
  890. +       g_strfreev(argv);
  891. +
  892. +       if(result != FALSE)
  893. +           break;
  894. +   }
  895. +
  896. +   if (i == n)
  897. +   {
  898. +       msg_box1(_("Error"), _("Spawn error: do you have Firefox installed?"));
  899. +   }
  900. +#endif
  901. +   else
  902. +   {
  903. +       GtkWidget *dialog;
  904. +       GTimer *timer;
  905. +       const gchar *message = "A web browser has been launched: this may take a while before it appears. If it is already launched, the page will be opened in the existing frame.";
  906. +
  907. +       dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL,
  908. +                      GTK_MESSAGE_INFO,
  909. +                      GTK_BUTTONS_CLOSE, message);
  910. +       g_signal_connect_swapped(GTK_OBJECT(dialog), "response",
  911. +                    G_CALLBACK(gtk_widget_destroy),
  912. +                    GTK_OBJECT(dialog));
  913. +       gtk_widget_show_all(GTK_WIDGET(dialog));
  914. +      
  915. +       while(gtk_events_pending()) gtk_main_iteration();
  916. +       for(timer = g_timer_new(); g_timer_elapsed(timer, NULL) < 3.0;);
  917. +
  918. +       g_timer_destroy(timer);
  919. +       gtk_widget_destroy(GTK_WIDGET(dialog));
  920. +   }
  921. +}
  922. diff -purN tiemu-3.03.orig/src/gui/calc/screen.c tiemu-3.03/src/gui/calc/screen.c
  923. --- tiemu-3.03.orig/src/gui/calc/screen.c   2006-11-06 18:18:51.000000000 +0100
  924. +++ tiemu-3.03/src/gui/calc/screen.c    2011-11-04 23:12:09.000000000 +0100
  925. @@ -187,7 +187,7 @@ void redraw_skin(void)
  926.     skin_infos.image = gdk_pixbuf_scale_simple(skin_infos.raw, wr.wr.w, wr.wr.h, GDK_INTERP_NEAREST);
  927.  
  928.     // and draw image into pixmap (next, into window on expose event)
  929. -    gdk_draw_pixbuf(pixmap, main_wnd->style->fg_gc[GTK_WIDGET_STATE(main_wnd)],
  930. +    gdk_draw_pixbuf(pixmap, main_wnd->style->fg_gc[gtk_widget_get_state(main_wnd)],
  931.           skin_infos.image, 0, 0, 0, 0, -1, -1, GDK_RGB_DITHER_NONE, 0, 0);
  932.     gdk_window_invalidate_rect(main_wnd->window, &wr.gr, FALSE);
  933.  }
  934. @@ -204,7 +204,7 @@ void redraw_lcd(void)
  935.         gdk_pixbuf_scale_simple(skin_infos.raw, sr.w, sr.h, GDK_INTERP_NEAREST);
  936.  
  937.     // and draw
  938. -   gdk_draw_pixbuf(pixmap, main_wnd->style->fg_gc[GTK_WIDGET_STATE(main_wnd)],
  939. +   gdk_draw_pixbuf(pixmap, main_wnd->style->fg_gc[gtk_widget_get_state(main_wnd)],
  940.           skin_infos.image, ls.x, ls.y, lr.x, lr.y, lr.w, lr.h, GDK_RGB_DITHER_NONE, 0, 0);
  941.     gtk_widget_queue_draw_area(area, lr.x, lr.y, lr.w, lr.h);
  942.  }
  943. @@ -324,7 +324,7 @@ int hid_update_lcd(void)
  944.             skin_infos.image = gdk_pixbuf_scale_simple(lcd, lr.w, lr.h, GDK_INTERP_NEAREST);
  945.  
  946.             // and draw image into pixmap (next, into window on expose event)
  947. -           gdk_draw_pixbuf(pixmap, main_wnd->style->fg_gc[GTK_WIDGET_STATE(main_wnd)],
  948. +           gdk_draw_pixbuf(pixmap, main_wnd->style->fg_gc[gtk_widget_get_state(main_wnd)],
  949.              skin_infos.image, src.x, src.y, lr.x, lr.y, src.w, src.h,
  950.               GDK_RGB_DITHER_NONE, 0, 0);
  951.             gtk_widget_queue_draw_area(area, lr.x, lr.y, src.w, src.h);
  952. @@ -332,7 +332,7 @@ int hid_update_lcd(void)
  953.         else
  954.         {
  955.             // and draw image into pixmap (next, into window on expose event)
  956. -           gdk_draw_pixbuf(pixmap, main_wnd->style->fg_gc[GTK_WIDGET_STATE(main_wnd)],
  957. +           gdk_draw_pixbuf(pixmap, main_wnd->style->fg_gc[gtk_widget_get_state(main_wnd)],
  958.               lcd_mem, src.x, src.y, lr.x, lr.y, src.w, src.h,
  959.               GDK_RGB_DITHER_NONE, 0, 0);
  960.             gtk_widget_queue_draw_area(area, lr.x, lr.y, src.w, src.h);
  961. diff -purN tiemu-3.03.orig/src/gui/debugger/dbg_all.c tiemu-3.03/src/gui/debugger/dbg_all.c
  962. --- tiemu-3.03.orig/src/gui/debugger/dbg_all.c  2009-05-08 12:56:40.000000000 +0200
  963. +++ tiemu-3.03/src/gui/debugger/dbg_all.c   2011-11-04 22:46:29.000000000 +0100
  964. @@ -90,21 +90,21 @@ void gtk_debugger_refresh(void)
  965.  { 
  966.     WND_TMR_START();
  967.  
  968. -   if(options3.dbg_dock || GTK_WIDGET_VISIBLE(dbgw.regs))
  969. +   if(options3.dbg_dock || gtk_widget_get_visible(dbgw.regs))
  970.         dbgregs_refresh_window();
  971. -   if(options3.dbg_dock || GTK_WIDGET_VISIBLE(dbgw.mem))
  972. +   if(options3.dbg_dock || gtk_widget_get_visible(dbgw.mem))
  973.         dbgmem_refresh_window();
  974. -   if(options3.dbg_dock || GTK_WIDGET_VISIBLE(dbgw.bkpts))
  975. +   if(options3.dbg_dock || gtk_widget_get_visible(dbgw.bkpts))
  976.         dbgbkpts_refresh_window();
  977. -   if(options3.dbg_dock || GTK_WIDGET_VISIBLE(dbgw.pclog))
  978. +   if(options3.dbg_dock || gtk_widget_get_visible(dbgw.pclog))
  979.         dbgpclog_refresh_window();
  980. -   if(options3.dbg_dock || GTK_WIDGET_VISIBLE(dbgw.code))
  981. +   if(options3.dbg_dock || gtk_widget_get_visible(dbgw.code))
  982.         dbgcode_refresh_window();
  983. -    if(options3.dbg_dock || GTK_WIDGET_VISIBLE(dbgw.stack))
  984. +    if(options3.dbg_dock || gtk_widget_get_visible(dbgw.stack))
  985.         dbgstack_refresh_window();
  986. -   if(options3.dbg_dock || GTK_WIDGET_VISIBLE(dbgw.heap))
  987. +   if(options3.dbg_dock || gtk_widget_get_visible(dbgw.heap))
  988.         dbgheap_refresh_window();
  989. -   if(options3.dbg_dock || GTK_WIDGET_VISIBLE(dbgw.iop))
  990. +   if(options3.dbg_dock || gtk_widget_get_visible(dbgw.iop))
  991.         dbgiop_refresh_window();
  992.  
  993.     WND_TMR_STOP("Debugger Refresh Time");
  994. @@ -163,7 +163,7 @@ int gtk_debugger_enter(int context)
  995.     gtk_debugger_refresh();
  996.  
  997.     // enable the debugger if GDB disabled it
  998. -   if (!options3.dbg_dock && !GTK_WIDGET_SENSITIVE(dbgw.regs))
  999. +   if (!options3.dbg_dock && !gtk_widget_get_sensitive(dbgw.regs))
  1000.         gtk_debugger_enable();
  1001.  
  1002.     // handle automatic debugging requests
  1003. @@ -180,7 +180,7 @@ int gtk_debugger_enter(int context)
  1004.  
  1005.             ti68k_bkpt_get_pgmentry_offset(id, &handle, &offset);
  1006.             ti68k_bkpt_del_pgmentry(handle);
  1007. -           if(options3.dbg_dock || GTK_WIDGET_VISIBLE(dbgw.bkpts))
  1008. +           if(options3.dbg_dock || gtk_widget_get_visible(dbgw.bkpts))
  1009.                 dbgbkpts_refresh_window();
  1010.  
  1011.             delete_command(NULL, 0);
  1012. diff -purN tiemu-3.03.orig/src/gui/debugger/dbg_bkpts.c tiemu-3.03/src/gui/debugger/dbg_bkpts.c
  1013. --- tiemu-3.03.orig/src/gui/debugger/dbg_bkpts.c    2009-05-06 21:48:47.000000000 +0200
  1014. +++ tiemu-3.03/src/gui/debugger/dbg_bkpts.c 2011-11-04 22:46:29.000000000 +0100
  1015. @@ -388,7 +388,7 @@ GtkWidget* dbgbkpts_display_window(void)
  1016.         gtk_window_iconify(GTK_WINDOW(wnd));
  1017.  #endif
  1018.  
  1019. -   if(!GTK_WIDGET_VISIBLE(dbgw.bkpts) && !options3.bkpts.closed)
  1020. +   if(!gtk_widget_get_visible(dbgw.bkpts) && !options3.bkpts.closed)
  1021.         gtk_widget_show(wnd);
  1022.  
  1023.     return wnd;
  1024. diff -purN tiemu-3.03.orig/src/gui/debugger/dbg_code.c tiemu-3.03/src/gui/debugger/dbg_code.c
  1025. --- tiemu-3.03.orig/src/gui/debugger/dbg_code.c 2009-05-06 21:48:47.000000000 +0200
  1026. +++ tiemu-3.03/src/gui/debugger/dbg_code.c  2011-11-04 22:46:29.000000000 +0100
  1027. @@ -1117,7 +1117,7 @@ void gdbcallback_refresh_debugger(void)
  1028.  
  1029.  int dbgcode_quit_enabled(void)
  1030.  {
  1031. -   return GTK_WIDGET_SENSITIVE(mi.m8);
  1032. +   return gtk_widget_get_sensitive(mi.m8);
  1033.  }
  1034.  
  1035.  static int close_debugger_wrapper(gpointer data)
  1036. diff -purN tiemu-3.03.orig/src/gui/debugger/dbg_dock.c tiemu-3.03/src/gui/debugger/dbg_dock.c
  1037. --- tiemu-3.03.orig/src/gui/debugger/dbg_dock.c 2008-05-26 18:48:30.000000000 +0200
  1038. +++ tiemu-3.03/src/gui/debugger/dbg_dock.c  2011-11-04 23:05:02.000000000 +0100
  1039. @@ -151,22 +151,22 @@ void dbgdock_set_sensitivity(int state)
  1040.  
  1041.  
  1042.  void dbgdock_show_all(int all)
  1043.  
  1044.  {
  1045.  
  1046. -   if(!GTK_WIDGET_VISIBLE(dbgw.dock) && all)
  1047.  
  1048. +   if(!gtk_widget_get_visible(dbgw.dock) && all)
  1049.  
  1050.          gtk_widget_show(dbgw.dock);
  1051.  
  1052.  
  1053.  
  1054. -   if(GTK_WIDGET_VISIBLE(dbgw.iop))
  1055.  
  1056. +   if(gtk_widget_get_visible(dbgw.iop))
  1057.  
  1058.          gtk_window_iconify(GTK_WINDOW(dbgw.iop));
  1059.  
  1060. -   if(GTK_WIDGET_VISIBLE(dbgw.pclog))
  1061.  
  1062. +   if(gtk_widget_get_visible(dbgw.pclog))
  1063.  
  1064.          gtk_window_iconify(GTK_WINDOW(dbgw.pclog));
  1065.  
  1066.  }
  1067.  
  1068.  
  1069.  
  1070.  void dbgdock_hide_all(int all)
  1071.  
  1072.  {
  1073.  
  1074. -   if(GTK_WIDGET_VISIBLE(dbgw.dock) && all)
  1075.  
  1076. +   if(gtk_widget_get_visible(dbgw.dock) && all)
  1077.  
  1078.          gtk_widget_hide(dbgw.dock);
  1079.  
  1080.  
  1081.  
  1082. -    if(GTK_WIDGET_VISIBLE(dbgw.pclog))
  1083.  
  1084. +    if(gtk_widget_get_visible(dbgw.pclog))
  1085.  
  1086.          gtk_widget_hide(dbgw.pclog);
  1087.  
  1088. -   if(GTK_WIDGET_VISIBLE(dbgw.iop))
  1089.  
  1090. +   if(gtk_widget_get_visible(dbgw.iop))
  1091.  
  1092.          gtk_widget_hide(dbgw.iop);
  1093.  
  1094.  }
  1095.  
  1096. diff -purN tiemu-3.03.orig/src/gui/debugger/dbg_heap.c tiemu-3.03/src/gui/debugger/dbg_heap.c
  1097. --- tiemu-3.03.orig/src/gui/debugger/dbg_heap.c 2009-05-06 21:48:47.000000000 +0200
  1098. +++ tiemu-3.03/src/gui/debugger/dbg_heap.c  2011-11-04 22:46:29.000000000 +0100
  1099. @@ -171,7 +171,7 @@ GtkWidget* dbgheap_display_window(void)
  1100.         gtk_window_iconify(GTK_WINDOW(dbgw.heap));
  1101.  #endif
  1102.  
  1103. -   if(!GTK_WIDGET_VISIBLE(dbgw.heap) && !options3.heap.closed)
  1104. +   if(!gtk_widget_get_visible(dbgw.heap) && !options3.heap.closed)
  1105.         gtk_widget_show(dbgw.heap);
  1106.  
  1107.     return dbgw.heap;
  1108. diff -purN tiemu-3.03.orig/src/gui/debugger/dbg_iop.c tiemu-3.03/src/gui/debugger/dbg_iop.c
  1109. --- tiemu-3.03.orig/src/gui/debugger/dbg_iop.c  2009-05-02 21:46:04.000000000 +0200
  1110. +++ tiemu-3.03/src/gui/debugger/dbg_iop.c   2011-11-04 22:46:29.000000000 +0100
  1111. @@ -455,7 +455,7 @@ GtkWidget* dbgiop_display_window(void)
  1112.         gtk_window_iconify(GTK_WINDOW(dbgw.iop));
  1113.  #endif
  1114.      
  1115. -   if(!GTK_WIDGET_VISIBLE(dbgw.iop) && !options3.iop.closed)
  1116. +   if(!gtk_widget_get_visible(dbgw.iop) && !options3.iop.closed)
  1117.         gtk_widget_show(dbgw.iop);
  1118.  
  1119.     return dbgw.iop;
  1120. diff -purN tiemu-3.03.orig/src/gui/debugger/dbg_mem.c tiemu-3.03/src/gui/debugger/dbg_mem.c
  1121. --- tiemu-3.03.orig/src/gui/debugger/dbg_mem.c  2009-05-06 21:48:47.000000000 +0200
  1122. +++ tiemu-3.03/src/gui/debugger/dbg_mem.c   2011-11-04 22:46:29.000000000 +0100
  1123. @@ -435,7 +435,7 @@ GtkWidget* dbgmem_display_window(void)
  1124.         gtk_window_iconify(GTK_WINDOW(dbgw.mem));
  1125.  #endif
  1126.  
  1127. -   if(!GTK_WIDGET_VISIBLE(dbgw.mem) && !options3.mem.closed)
  1128. +   if(!gtk_widget_get_visible(dbgw.mem) && !options3.mem.closed)
  1129.         gtk_widget_show(dbgw.mem);
  1130.  
  1131.      return dbgw.mem;
  1132. @@ -605,7 +605,7 @@ dbgmem_button6_clicked
  1133.  
  1134.  GLADE_CB void
  1135.  on_notebook1_switch_page               (GtkNotebook     *notebook,
  1136. -                                        GtkNotebookPage *page,
  1137. +                                        gpointer        *page,
  1138.                                          guint            page_num,
  1139.                                          gpointer         user_data)
  1140.  {
  1141. diff -purN tiemu-3.03.orig/src/gui/debugger/dbg_pclog.c tiemu-3.03/src/gui/debugger/dbg_pclog.c
  1142. --- tiemu-3.03.orig/src/gui/debugger/dbg_pclog.c    2009-05-02 21:46:04.000000000 +0200
  1143. +++ tiemu-3.03/src/gui/debugger/dbg_pclog.c 2011-11-04 22:46:29.000000000 +0100
  1144. @@ -163,7 +163,7 @@ GtkWidget* dbgpclog_display_window(void)
  1145.         gtk_window_iconify(GTK_WINDOW(dbgw.pclog));
  1146.  #endif
  1147.  
  1148. -   if(!GTK_WIDGET_VISIBLE(dbgw.pclog) && !options3.pclog.closed)
  1149. +   if(!gtk_widget_get_visible(dbgw.pclog) && !options3.pclog.closed)
  1150.         gtk_widget_show(dbgw.pclog);
  1151.  
  1152.     return dbgw.pclog;
  1153. diff -purN tiemu-3.03.orig/src/gui/debugger/dbg_regs.c tiemu-3.03/src/gui/debugger/dbg_regs.c
  1154. --- tiemu-3.03.orig/src/gui/debugger/dbg_regs.c 2009-05-06 21:48:47.000000000 +0200
  1155. +++ tiemu-3.03/src/gui/debugger/dbg_regs.c  2011-11-04 22:46:29.000000000 +0100
  1156. @@ -302,7 +302,7 @@ GtkWidget* dbgregs_display_window(void)
  1157.         gtk_window_iconify(GTK_WINDOW(dbgw.regs));
  1158.  #endif
  1159.  
  1160. -   if(!GTK_WIDGET_VISIBLE(dbgw.regs) && !options3.regs.closed)
  1161. +   if(!gtk_widget_get_visible(dbgw.regs) && !options3.regs.closed)
  1162.         gtk_widget_show(dbgw.regs);
  1163.  
  1164.     return dbgw.regs;
  1165. diff -purN tiemu-3.03.orig/src/gui/debugger/dbg_romcall.c tiemu-3.03/src/gui/debugger/dbg_romcall.c
  1166. --- tiemu-3.03.orig/src/gui/debugger/dbg_romcall.c  2007-07-05 13:36:10.000000000 +0200
  1167. +++ tiemu-3.03/src/gui/debugger/dbg_romcall.c   2011-11-04 22:46:29.000000000 +0100
  1168. @@ -29,7 +29,9 @@
  1169.  #  include <config.h>
  1170.  #endif
  1171.  
  1172. -#include <gtk/gtk.h>
  1173. +#undef GTK_DISABLE_DEPRECATED
  1174. + #include <gtk/gtk.h>
  1175. +#define GTK_DISABLE_DEPRECATED
  1176.  #include <glade/glade.h>
  1177.  #include <string.h>
  1178.  
  1179. diff -purN tiemu-3.03.orig/src/gui/debugger/dbg_stack.c tiemu-3.03/src/gui/debugger/dbg_stack.c
  1180. --- tiemu-3.03.orig/src/gui/debugger/dbg_stack.c    2009-05-06 21:48:47.000000000 +0200
  1181. +++ tiemu-3.03/src/gui/debugger/dbg_stack.c 2011-11-04 22:46:29.000000000 +0100
  1182. @@ -197,7 +197,7 @@ GtkWidget* dbgstack_display_window(void)
  1183.         gtk_window_iconify(GTK_WINDOW(dbgw.stack));
  1184.  #endif
  1185.  
  1186. -   if(!GTK_WIDGET_VISIBLE(dbgw.stack) && !options3.stack.closed)
  1187. +   if(!gtk_widget_get_visible(dbgw.stack) && !options3.stack.closed)
  1188.         gtk_widget_show(dbgw.stack);
  1189.  
  1190.     return dbgw.stack;
  1191. diff -purN tiemu-3.03.orig/src/gui/debugger/dbg_wnds.c tiemu-3.03/src/gui/debugger/dbg_wnds.c
  1192. --- tiemu-3.03.orig/src/gui/debugger/dbg_wnds.c 2009-05-07 09:18:02.000000000 +0200
  1193. +++ tiemu-3.03/src/gui/debugger/dbg_wnds.c  2011-11-04 23:07:54.000000000 +0100
  1194. @@ -74,21 +74,21 @@ void dbgwnds_minimize_all(int all)
  1195.     if(options3.dbg_dock)
  1196.  
  1197.         return;
  1198.  
  1199.  
  1200.  
  1201. -    if(GTK_WIDGET_VISIBLE(dbgw.regs))
  1202.  
  1203. +    if(gtk_widget_get_visible(dbgw.regs))
  1204.  
  1205.          gtk_window_iconify(GTK_WINDOW(dbgw.regs));
  1206.  
  1207. -    if(GTK_WIDGET_VISIBLE(dbgw.bkpts))
  1208.  
  1209. +    if(gtk_widget_get_visible(dbgw.bkpts))
  1210.  
  1211.          gtk_window_iconify(GTK_WINDOW(dbgw.bkpts));
  1212.  
  1213. -    if(GTK_WIDGET_VISIBLE(dbgw.mem))
  1214.  
  1215. +    if(gtk_widget_get_visible(dbgw.mem))
  1216.  
  1217.          gtk_window_iconify(GTK_WINDOW(dbgw.mem));
  1218.  
  1219. -    if(GTK_WIDGET_VISIBLE(dbgw.pclog))
  1220.  
  1221. +    if(gtk_widget_get_visible(dbgw.pclog))
  1222.  
  1223.          gtk_window_iconify(GTK_WINDOW(dbgw.pclog));
  1224.  
  1225. -    if(GTK_WIDGET_VISIBLE(dbgw.code) & all)
  1226.  
  1227. +    if(gtk_widget_get_visible(dbgw.code) & all)
  1228.  
  1229.          gtk_window_iconify(GTK_WINDOW(dbgw.code));
  1230.  
  1231. -    if(GTK_WIDGET_VISIBLE(dbgw.stack))
  1232.  
  1233. +    if(gtk_widget_get_visible(dbgw.stack))
  1234.  
  1235.          gtk_window_iconify(GTK_WINDOW(dbgw.stack));
  1236.  
  1237. -   if(GTK_WIDGET_VISIBLE(dbgw.heap))
  1238.  
  1239. +   if(gtk_widget_get_visible(dbgw.heap))
  1240.  
  1241.          gtk_window_iconify(GTK_WINDOW(dbgw.heap));
  1242.  
  1243. -   if(GTK_WIDGET_VISIBLE(dbgw.iop))
  1244.  
  1245. +   if(gtk_widget_get_visible(dbgw.iop))
  1246.  
  1247.          gtk_window_iconify(GTK_WINDOW(dbgw.iop));
  1248.  
  1249.  }
  1250.  
  1251.  
  1252.  
  1253. @@ -98,21 +98,21 @@ void dbgwnds_unminimize_all(int all)
  1254.     if(options3.dbg_dock)
  1255.  
  1256.         return;
  1257.  
  1258.  
  1259.  
  1260. -    if(GTK_WIDGET_VISIBLE(dbgw.regs))
  1261.  
  1262. +    if(gtk_widget_get_visible(dbgw.regs))
  1263.  
  1264.          gtk_window_deiconify(GTK_WINDOW(dbgw.regs));
  1265.  
  1266. -    if(GTK_WIDGET_VISIBLE(dbgw.bkpts))
  1267.  
  1268. +    if(gtk_widget_get_visible(dbgw.bkpts))
  1269.  
  1270.          gtk_window_deiconify(GTK_WINDOW(dbgw.bkpts));
  1271.  
  1272. -    if(GTK_WIDGET_VISIBLE(dbgw.mem))
  1273.  
  1274. +    if(gtk_widget_get_visible(dbgw.mem))
  1275.  
  1276.          gtk_window_deiconify(GTK_WINDOW(dbgw.mem));
  1277.  
  1278. -    if(GTK_WIDGET_VISIBLE(dbgw.pclog))
  1279.  
  1280. +    if(gtk_widget_get_visible(dbgw.pclog))
  1281.  
  1282.          gtk_window_deiconify(GTK_WINDOW(dbgw.pclog));
  1283.  
  1284. -    if(GTK_WIDGET_VISIBLE(dbgw.code) & all)
  1285.  
  1286. +    if(gtk_widget_get_visible(dbgw.code) & all)
  1287.  
  1288.          gtk_window_deiconify(GTK_WINDOW(dbgw.code));
  1289.  
  1290. -    if(GTK_WIDGET_VISIBLE(dbgw.stack))
  1291.  
  1292. +    if(gtk_widget_get_visible(dbgw.stack))
  1293.  
  1294.          gtk_window_deiconify(GTK_WINDOW(dbgw.stack));
  1295.  
  1296. -   if(GTK_WIDGET_VISIBLE(dbgw.heap))
  1297.  
  1298. +   if(gtk_widget_get_visible(dbgw.heap))
  1299.  
  1300.          gtk_window_deiconify(GTK_WINDOW(dbgw.heap));
  1301.  
  1302. -   if(GTK_WIDGET_VISIBLE(dbgw.iop))
  1303.  
  1304. +   if(gtk_widget_get_visible(dbgw.iop))
  1305.  
  1306.          gtk_window_deiconify(GTK_WINDOW(dbgw.iop));
  1307.  
  1308.  }
  1309.  
  1310.  
  1311.  
  1312. @@ -122,21 +122,21 @@ void dbgwnds_show_all(int all)
  1313.      if(options3.dbg_dock)
  1314.  
  1315.         return;
  1316.  
  1317.  
  1318.  
  1319. -    if(!GTK_WIDGET_VISIBLE(dbgw.regs))
  1320.  
  1321. +    if(!gtk_widget_get_visible(dbgw.regs))
  1322.  
  1323.          gtk_widget_show(dbgw.regs);
  1324.  
  1325. -    if(!GTK_WIDGET_VISIBLE(dbgw.bkpts))
  1326.  
  1327. +    if(!gtk_widget_get_visible(dbgw.bkpts))
  1328.  
  1329.          gtk_widget_show(dbgw.bkpts);
  1330.  
  1331. -    if(!GTK_WIDGET_VISIBLE(dbgw.mem))
  1332.  
  1333. +    if(!gtk_widget_get_visible(dbgw.mem))
  1334.  
  1335.          gtk_widget_show(dbgw.mem);
  1336.  
  1337. -    if(!GTK_WIDGET_VISIBLE(dbgw.pclog))
  1338.  
  1339. +    if(!gtk_widget_get_visible(dbgw.pclog))
  1340.  
  1341.          gtk_widget_show(dbgw.pclog);
  1342.  
  1343. -    if(!GTK_WIDGET_VISIBLE(dbgw.code) && all)
  1344.  
  1345. +    if(!gtk_widget_get_visible(dbgw.code) && all)
  1346.  
  1347.          gtk_widget_show(dbgw.code);
  1348.  
  1349. -    if(!GTK_WIDGET_VISIBLE(dbgw.stack))
  1350.  
  1351. +    if(!gtk_widget_get_visible(dbgw.stack))
  1352.  
  1353.          gtk_widget_show(dbgw.stack);
  1354.  
  1355. -   if(!GTK_WIDGET_VISIBLE(dbgw.heap))
  1356.  
  1357. +   if(!gtk_widget_get_visible(dbgw.heap))
  1358.  
  1359.          gtk_widget_show(dbgw.heap);
  1360.  
  1361. -   if(!GTK_WIDGET_VISIBLE(dbgw.iop))
  1362.  
  1363. +   if(!gtk_widget_get_visible(dbgw.iop))
  1364.  
  1365.          gtk_widget_show(dbgw.iop);
  1366.  
  1367.  }
  1368.  
  1369.  
  1370.  
  1371. @@ -146,21 +146,21 @@ void dbgwnds_hide_all(int all)
  1372.      if(options3.dbg_dock)
  1373.  
  1374.         return;
  1375.  
  1376.  
  1377.  
  1378. -    if(GTK_WIDGET_VISIBLE(dbgw.regs))
  1379.  
  1380. +    if(gtk_widget_get_visible(dbgw.regs))
  1381.  
  1382.          gtk_widget_hide(dbgw.regs);
  1383.  
  1384. -    if(GTK_WIDGET_VISIBLE(dbgw.bkpts))
  1385.  
  1386. +    if(gtk_widget_get_visible(dbgw.bkpts))
  1387.  
  1388.          gtk_widget_hide(dbgw.bkpts);
  1389.  
  1390. -    if(GTK_WIDGET_VISIBLE(dbgw.mem))
  1391.  
  1392. +    if(gtk_widget_get_visible(dbgw.mem))
  1393.  
  1394.          gtk_widget_hide(dbgw.mem);
  1395.  
  1396. -    if(GTK_WIDGET_VISIBLE(dbgw.pclog))
  1397.  
  1398. +    if(gtk_widget_get_visible(dbgw.pclog))
  1399.  
  1400.          gtk_widget_hide(dbgw.pclog);
  1401.  
  1402. -    if(GTK_WIDGET_VISIBLE(dbgw.code) && all)
  1403.  
  1404. +    if(gtk_widget_get_visible(dbgw.code) && all)
  1405.  
  1406.          gtk_widget_hide(dbgw.code);
  1407.  
  1408. -    if(GTK_WIDGET_VISIBLE(dbgw.stack))
  1409.  
  1410. +    if(gtk_widget_get_visible(dbgw.stack))
  1411.  
  1412.          gtk_widget_hide(dbgw.stack);
  1413.  
  1414. -   if(GTK_WIDGET_VISIBLE(dbgw.heap))
  1415.  
  1416. +   if(gtk_widget_get_visible(dbgw.heap))
  1417.  
  1418.          gtk_widget_hide(dbgw.heap);
  1419.  
  1420. -   if(GTK_WIDGET_VISIBLE(dbgw.iop))
  1421.  
  1422. +   if(gtk_widget_get_visible(dbgw.iop))
  1423.  
  1424.          gtk_widget_hide(dbgw.iop);
  1425.  
  1426.  }
  1427.  
  1428.  
  1429.  
  1430. @@ -338,7 +338,7 @@ void update_submenu(GtkWidget *widget, g
  1431.     if(!options3.dbg_dock)
  1432.  
  1433.     {
  1434.  
  1435.         g_signal_handlers_block_by_func(GTK_OBJECT(item), on_registers1_activate, NULL);
  1436.  
  1437. -       gtk_check_menu_item_set_active(item, GTK_WIDGET_VISIBLE(dbgw.regs));
  1438.  
  1439. +       gtk_check_menu_item_set_active(item, gtk_widget_get_visible(dbgw.regs));
  1440.  
  1441.         g_signal_handlers_unblock_by_func(GTK_OBJECT(item), on_registers1_activate, NULL);
  1442.  
  1443.     }
  1444.  
  1445.     else
  1446.  
  1447. @@ -350,7 +350,7 @@ void update_submenu(GtkWidget *widget, g
  1448.     if(!options3.dbg_dock)
  1449.  
  1450.     {
  1451.  
  1452.         g_signal_handlers_block_by_func(GTK_OBJECT(item), on_breakpoints1_activate, NULL);
  1453.  
  1454. -       gtk_check_menu_item_set_active(item, GTK_WIDGET_VISIBLE(dbgw.bkpts));
  1455.  
  1456. +       gtk_check_menu_item_set_active(item, gtk_widget_get_visible(dbgw.bkpts));
  1457.  
  1458.         g_signal_handlers_unblock_by_func(GTK_OBJECT(item), on_breakpoints1_activate, NULL);
  1459.  
  1460.     }
  1461.  
  1462.     else
  1463.  
  1464. @@ -362,7 +362,7 @@ void update_submenu(GtkWidget *widget, g
  1465.     if(!options3.dbg_dock)
  1466.  
  1467.     {
  1468.  
  1469.         g_signal_handlers_block_by_func(GTK_OBJECT(item), on_memory1_activate, NULL);
  1470.  
  1471. -       gtk_check_menu_item_set_active(item, GTK_WIDGET_VISIBLE(dbgw.mem));
  1472.  
  1473. +       gtk_check_menu_item_set_active(item, gtk_widget_get_visible(dbgw.mem));
  1474.  
  1475.         g_signal_handlers_unblock_by_func(GTK_OBJECT(item), on_memory1_activate, NULL);
  1476.  
  1477.     }
  1478.  
  1479.     else
  1480.  
  1481. @@ -372,7 +372,7 @@ void update_submenu(GtkWidget *widget, g
  1482.      elt = g_list_nth(list, 3);
  1483.  
  1484.      item = GTK_CHECK_MENU_ITEM(elt->data);
  1485.  
  1486.      g_signal_handlers_block_by_func(GTK_OBJECT(item), on_pc_log1_activate, NULL);
  1487.  
  1488. -    gtk_check_menu_item_set_active(item, GTK_WIDGET_VISIBLE(dbgw.pclog));
  1489.  
  1490. +    gtk_check_menu_item_set_active(item, gtk_widget_get_visible(dbgw.pclog));
  1491.  
  1492.      g_signal_handlers_unblock_by_func(GTK_OBJECT(item), on_pc_log1_activate, NULL);
  1493.  
  1494.  
  1495.  
  1496.      // stack
  1497.  
  1498. @@ -381,7 +381,7 @@ void update_submenu(GtkWidget *widget, g
  1499.     if(!options3.dbg_dock)
  1500.  
  1501.     {
  1502.  
  1503.         g_signal_handlers_block_by_func(GTK_OBJECT(item), on_stack_frame1_activate, NULL);
  1504.  
  1505. -       gtk_check_menu_item_set_active(item, GTK_WIDGET_VISIBLE(dbgw.stack));
  1506.  
  1507. +       gtk_check_menu_item_set_active(item, gtk_widget_get_visible(dbgw.stack));
  1508.  
  1509.         g_signal_handlers_unblock_by_func(GTK_OBJECT(item), on_stack_frame1_activate, NULL);
  1510.  
  1511.     }
  1512.  
  1513.     else
  1514.  
  1515. @@ -393,7 +393,7 @@ void update_submenu(GtkWidget *widget, g
  1516.     if(!options3.dbg_dock)
  1517.  
  1518.     {
  1519.  
  1520.         g_signal_handlers_block_by_func(GTK_OBJECT(item), on_heap_frame1_activate, NULL);
  1521.  
  1522. -       gtk_check_menu_item_set_active(item, GTK_WIDGET_VISIBLE(dbgw.heap));
  1523.  
  1524. +       gtk_check_menu_item_set_active(item, gtk_widget_get_visible(dbgw.heap));
  1525.  
  1526.         g_signal_handlers_unblock_by_func(GTK_OBJECT(item), on_heap_frame1_activate, NULL);
  1527.  
  1528.     }
  1529.  
  1530.     else
  1531.  
  1532. @@ -403,7 +403,7 @@ void update_submenu(GtkWidget *widget, g
  1533.     elt = g_list_nth(list, 6);
  1534.  
  1535.      item = GTK_CHECK_MENU_ITEM(elt->data);
  1536.  
  1537.      g_signal_handlers_block_by_func(GTK_OBJECT(item), on_ioports_frame1_activate, NULL);
  1538.  
  1539. -    gtk_check_menu_item_set_active(item, GTK_WIDGET_VISIBLE(dbgw.iop));
  1540.  
  1541. +    gtk_check_menu_item_set_active(item, gtk_widget_get_visible(dbgw.iop));
  1542.  
  1543.      g_signal_handlers_unblock_by_func(GTK_OBJECT(item), on_ioports_frame1_activate, NULL);
  1544.  
  1545.  
  1546.  
  1547.     // dock/multi mode
  1548.  
  1549. diff -purN tiemu-3.03.orig/src/gui/filesel.c tiemu-3.03/src/gui/filesel.c
  1550. --- tiemu-3.03.orig/src/gui/filesel.c   2007-12-16 16:54:33.000000000 +0100
  1551. +++ tiemu-3.03/src/gui/filesel.c    2011-11-04 22:45:28.000000000 +0100
  1552. @@ -41,7 +41,9 @@
  1553.  
  1554.  #include <stdio.h>
  1555.  #include <stdlib.h>
  1556. +#undef GTK_DISABLE_DEPRECATED
  1557.  #include <gtk/gtk.h>
  1558. +#define GTK_DISABLE_DEPRECATED
  1559.  #include <string.h>
  1560.  
  1561.  #ifdef __WIN32__
  1562.  
  1563.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement