Diff for /np2/x11/gtk2/gtk_menu.c between versions 1.3 and 1.8

version 1.3, 2004/08/14 03:17:53 version 1.8, 2007/01/21 00:24:24
Line 12 Line 12
  * 2. Redistributions in binary form must reproduce the above copyright   * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the   *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.   *    documentation and/or other materials provided with the distribution.
  * 3. The name of the author may not be used to endorse or promote products  
  *    derived from this software without specific prior written permission.  
  *   *
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR   * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES   * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
Line 46 Line 44
 #include "pc9861k.h"  #include "pc9861k.h"
 #include "s98.h"  #include "s98.h"
 #include "scrnbmp.h"  #include "scrnbmp.h"
   #include "sxsi.h"
   
 #include "kdispwin.h"  #include "kdispwin.h"
 #include "toolwin.h"  #include "toolwin.h"
Line 906  cb_atapiopen(GtkAction *action, gpointer Line 905  cb_atapiopen(GtkAction *action, gpointer
                 gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter);                  gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter);
         }          }
         gtk_file_chooser_set_filter(GTK_FILE_CHOOSER(dialog), filter);          gtk_file_chooser_set_filter(GTK_FILE_CHOOSER(dialog), filter);
           filter = gtk_file_filter_new();
           if (filter) {
                   gtk_file_filter_set_name(filter, "CUE CD-ROM image files");
                   gtk_file_filter_add_pattern(filter, "*.[cC][uU][eE]");
                   gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter);
           }
   
         if (gtk_dialog_run(GTK_DIALOG(dialog)) != GTK_RESPONSE_OK)          if (gtk_dialog_run(GTK_DIALOG(dialog)) != GTK_RESPONSE_OK)
                 goto end;                  goto end;
Line 916  cb_atapiopen(GtkAction *action, gpointer Line 921  cb_atapiopen(GtkAction *action, gpointer
                 if (path) {                  if (path) {
                         if ((stat(path, &sb) == 0) && S_ISREG(sb.st_mode) && (sb.st_mode & S_IRUSR)) {                          if ((stat(path, &sb) == 0) && S_ISREG(sb.st_mode) && (sb.st_mode & S_IRUSR)) {
                                 file_cpyname(hddfolder, path, sizeof(hddfolder));                                  file_cpyname(hddfolder, path, sizeof(hddfolder));
                                 diskdrv_setcdrom(DISKDRV_CDROM_ATAPI, path, FALSE);                                  sxsi_devopen(0x02, path);
                                 sysmng_update(SYS_UPDATEOSCFG);                                  sysmng_update(SYS_UPDATEOSCFG);
                         }                          }
                         g_free(path);                          g_free(path);
Line 937  cb_atapiremove(GtkAction *action, gpoint Line 942  cb_atapiremove(GtkAction *action, gpoint
         UNUSED(action);          UNUSED(action);
         UNUSED(user_data);          UNUSED(user_data);
   
         diskdrv_setcdrom(DISKDRV_CDROM_ATAPI, "", FALSE);          sxsi_devclose(0x02);
 }  }
 #endif  /* SUPPORT_IDEIO */  #endif  /* SUPPORT_IDEIO */
   
Line 1031  cb_newdisk(GtkAction *action, gpointer u Line 1036  cb_newdisk(GtkAction *action, gpointer u
         }          }
         gtk_file_chooser_set_filter(GTK_FILE_CHOOSER(dialog), filter[0]);          gtk_file_chooser_set_filter(GTK_FILE_CHOOSER(dialog), filter[0]);
   
         if (gtk_dialog_run(GTK_DIALOG(dialog)) != GTK_RESPONSE_OK) {          if (gtk_dialog_run(GTK_DIALOG(dialog)) != GTK_RESPONSE_OK)
                 gtk_widget_destroy(dialog);                  goto end;
                 install_idle_process();  
                 return;  
         }  
   
         utf8 = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));          utf8 = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
         if (utf8 == NULL)          if (utf8 == NULL)
Line 1059  cb_newdisk(GtkAction *action, gpointer u Line 1061  cb_newdisk(GtkAction *action, gpointer u
                 for (i = 0; i < NELEMENTS(filter); i++) {                  for (i = 0; i < NELEMENTS(filter); i++) {
                         if (f == filter[i]) {                          if (f == filter[i]) {
                                 kind = i;                                  kind = i;
                                 tmp = g_strjoin(".", path, extname[i]);                                  tmp = g_strjoin(".", path, extname[i], NULL);
                                 if (tmp) {                                  if (tmp) {
                                         g_free(path);                                          g_free(path);
                                         path = tmp;                                          path = tmp;
Line 1686  cb_radio(GtkRadioAction *action, GtkRadi Line 1688  cb_radio(GtkRadioAction *action, GtkRadi
 /*  /*
  * create menubar   * create menubar
  */   */
   static GtkWidget *menubar;
   static guint menubar_timerid;
   
   #define EVENT_MASK      (GDK_LEAVE_NOTIFY_MASK|GDK_LEAVE_NOTIFY_MASK)
   
   static gboolean
   menubar_timeout(gpointer p)
   {
   
           UNUSED(p);
   
           if (menubar_timerid) {
                   g_source_remove(menubar_timerid);
                   menubar_timerid = 0;
           }
   
           if (scrnmode & SCRNMODE_FULLSCREEN) {
                   xmenu_hide();
           }
   
           return TRUE;
   }
   
   /*
    - Signal: gboolean GtkWidget::enter_notify_event (GtkWidget *widget,
             GdkEventCrossing *event, gpointer user_data)
   */
   static gboolean
   enter_notify_evhandler(GtkWidget *w, GdkEventCrossing *ev, gpointer p)
   {
   
           UNUSED(w);
           UNUSED(ev);
           UNUSED(p);
   
           if (menubar_timerid) {
                   g_source_remove(menubar_timerid);
                   menubar_timerid = 0;
           }
   
           return TRUE;
   }
   
   /*
    - Signal: gboolean GtkWidget::leave_notify_event (GtkWidget *widget,
             GdkEventCrossing *event, gpointer user_data)
   */
   static gboolean
   leave_notify_evhandler(GtkWidget *w, GdkEventCrossing *ev, gpointer p)
   {
   
           UNUSED(w);
           UNUSED(ev);
           UNUSED(p);
   
           if (menubar_timerid) {
                   g_source_remove(menubar_timerid);
                   menubar_timerid = 0;
           }
   
           if (scrnmode & SCRNMODE_FULLSCREEN) {
                   menubar_timerid = g_timeout_add(1000, menubar_timeout, NULL);
           }
   
           return TRUE;
   }
   
 static void  static void
 equip_fddrive(GtkUIManager *ui_manager, guint no)  equip_fddrive(GtkUIManager *ui_manager, guint no)
 {  {
Line 1719  equip_fddrive(GtkUIManager *ui_manager,  Line 1788  equip_fddrive(GtkUIManager *ui_manager, 
 GtkWidget *  GtkWidget *
 create_menu(void)  create_menu(void)
 {  {
         GtkWidget *menubar;  
         GError *err = NULL;          GError *err = NULL;
         gint rv;          gint rv;
         guint i;          guint i;
Line 1787  create_menu(void) Line 1855  create_menu(void)
         }          }
   
         menubar = gtk_ui_manager_get_widget(menu_hdl.ui_manager, "/MainMenu");          menubar = gtk_ui_manager_get_widget(menu_hdl.ui_manager, "/MainMenu");
   
           gtk_widget_add_events(menubar, EVENT_MASK);
           g_signal_connect(GTK_OBJECT(menubar), "enter_notify_event",
                       GTK_SIGNAL_FUNC(enter_notify_evhandler), NULL);
           g_signal_connect(GTK_OBJECT(menubar), "leave_notify_event",
                       GTK_SIGNAL_FUNC(leave_notify_evhandler), NULL);
   
         return menubar;          return menubar;
 }  }
   
   void
   xmenu_hide(void)
   {
   
           gtk_widget_hide(menubar);
   }
   
   void
   xmenu_show(void)
   {
   
           gtk_widget_show(menubar);
   }
   
   void
   xmenu_toggle_menu(void)
   {
   
           if (GTK_WIDGET_VISIBLE(menubar))
                   xmenu_hide();
           else
                   xmenu_show();
   }
   
   void
   xmenu_select_screen(UINT8 mode)
   {
   
           xmenu_select_rotate(mode & SCRNMODE_ROTATEMASK);
           xmenu_select_screenmode(mode & SCRNMODE_FULLSCREEN);
   }

Removed from v.1.3  
changed lines
  Added in v.1.8


RetroPC.NET-CVS <cvs@retropc.net>