mupen64plus-oldsvn/main/gui_gtk/main_gtk.h

70 lines
2.9 KiB
C

/***************************************************************************
main_gtk.h - Handles the main window and 'glues' it with other windows
----------------------------------------------------------------------------
Began : Fri Nov 8 2002
Copyright : (C) 2002 by blight
Email : blight@Ashitaka
****************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef __MAIN_GTK_H__
#define __MAIN_GTK_H__
#include <gtk/gtk.h>
typedef struct
{
GtkWidget *window;
GtkWidget *toplevelVBox; //Vbox containing menubar, toolbar, filter, rombrowser, and statusbar.
GtkWidget *menuBar;
GtkWidget *toolBar;
GtkWidget *filterBar;
GtkWidget *filter;
GtkWidget *romScrolledWindow;
//Make two TreeViews, a visable manually filtered one for the Display, and a
//Non-visable FullList from which we can filter.
GtkWidget *romDisplay, *romFullList;
GtkTreeViewColumn *column[17]; //columns in rombrowser.
unsigned short columnVisible[16];
int romSortColumn; // sort column
GtkSortType romSortType; // sort type (ascending/descending)
GtkWidget *statusBar;
GtkWidget *statusBarHBox;
GtkAccelGroup *accelGroup;
GtkAccelGroup *accelUnsafe; //GtkAccelGroup for keys without Metas. Prevents GtkEntry widgets.
gboolean accelUnsafeActive; //From getting keypresses, so must be deactivated.
GtkWidget *romHeaderMenu; //Context menu for rombrowser header to control visible columns.
} SMainWindow;
extern SMainWindow g_MainWindow;
extern GdkPixbuf *australia, *europe, *france, *germany, *italy, *japan, *spain, *usa, *japanusa, *n64cart, *star;
/* The two functons which all GUIs must implement.
* updaterombrowser() accesses g_romcahce.length and adds upto roms to the rombrowser. The clear
* flag tells the GUI to clear the rombrowser.
* gui_message() uses messagetype to display either an informational message, for example to the
* status bar, a yes / no confirmation dialogue, or an error dialogue.
*/
int gui_message(unsigned char messagetype, const char *format, ...);
void updaterombrowser(unsigned int roms, unsigned short clear);
gboolean check_icon_theme();
// helper macro
#define GUI_PROCESS_QUEUED_EVENTS() \
{ \
gdk_threads_leave(); \
while(g_main_context_iteration(NULL, FALSE)); \
gdk_threads_enter(); \
}
#endif // __MAIN_GTK_H__