|
|
| version 1.5, 2007/01/02 13:11:01 | version 1.7, 2007/01/12 19:09:58 |
|---|---|
| Line 1691 cb_radio(GtkRadioAction *action, GtkRadi | Line 1691 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 1724 equip_fddrive(GtkUIManager *ui_manager, | Line 1791 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 1792 create_menu(void) | Line 1858 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); | |
| } |