1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-02 13:12:05 +00:00

Remove many annoying GTK includes in every compile line and remove GTK

stuff from mp_msg by using a wrapper function.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16375 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
ods15 2005-09-03 15:19:52 +00:00
parent 2a57b62b04
commit 4d58623130
4 changed files with 26 additions and 22 deletions

View File

@ -1292,3 +1292,24 @@ int import_playtree_playlist_into_gui(play_tree_t* my_playtree, m_config_t* conf
return result;
}
// wrapper function for mp_msg to display a message box for errors and warnings.
void guiMessageBox(int level, char * str) {
switch(level) {
case MSGL_FATAL:
gtkMessageBox(GTK_MB_FATAL|GTK_MB_SIMPLE, str);
break;
case MSGL_ERR:
gtkMessageBox(GTK_MB_ERROR|GTK_MB_SIMPLE, str);
break;
#if 0
// WARNING! Do NOT enable this! There are too many non-critical messages with
// MSGL_WARN, for example: broken SPU packets, codec's bit error messages,
// etc etc, they should not raise up a new window every time.
case MSGL_WARN:
gtkMessageBox(GTK_MB_WARNING|GTK_MB_SIMPLE, str);
break;
#endif
}
}

View File

@ -150,6 +150,7 @@ extern int guiGetEvent( int type,char * arg );
extern void guiEventHandling( void );
extern void guiLoadFont( void );
extern void guiLoadSubtitle( char * name );
extern void guiMessageBox(int level, char * str);
typedef struct _plItem
{

3
configure vendored
View File

@ -6952,7 +6952,7 @@ AWK = $_awk
RANLIB = $_ranlib
INSTALL = $_install
# OPTFLAGS = -O4 $_profile $_debug $_march $_mcpu $_pipe -fomit-frame-pointer -ffast-math
EXTRA_INC = $_inc_extra $_inc_gtk
EXTRA_INC = $_inc_extra
OPTFLAGS = -I../libvo -I../../libvo $_inc_x11 $CFLAGS \$(EXTRA_INC)
STRIPBINARIES = $_stripbinaries
CHARSET = $_charset
@ -7129,6 +7129,7 @@ TARGET_ALTIVEC = $_altivec
TARGET_VIS = $_vis
# --- GUI stuff ---
GTKINC = $_inc_gtk
GTKLIB = $_ld_static $_ld_gtk
GLIBLIB = $_ld_static $_ld_glib
GTK_LIBS = $_ld_static $_ld_gui

View File

@ -16,8 +16,7 @@
#endif
#if ENABLE_GUI_CODE
#include "Gui/mplayer/widgets.h"
extern void gtkMessageBox( int type,char * str );
#include "Gui/interface.h"
extern int use_gui;
#endif
#include "mp_msg.h"
@ -72,25 +71,7 @@ void mp_msg_c( int x, const char *format, ... ){
#if ENABLE_GUI_CODE
if(use_gui)
{
switch(x & 255)
{
case MSGL_FATAL:
gtkMessageBox(GTK_MB_FATAL|GTK_MB_SIMPLE, tmp);
break;
case MSGL_ERR:
gtkMessageBox(GTK_MB_ERROR|GTK_MB_SIMPLE, tmp);
break;
#if 0
// WARNING! Do NOT enable this! There are too many non-critical messages with
// MSGL_WARN, for example: broken SPU packets, codec's bit error messages,
// etc etc, they should not raise up a new window every time.
case MSGL_WARN:
gtkMessageBox(GTK_MB_WARNING|GTK_MB_SIMPLE, tmp);
break;
#endif
}
}
guiMessageBox(x&255, tmp);
#endif
#ifdef MSG_USE_COLORS