changeset 36053:7affacef2f88

Define "MPlayer" string.
author ib
date Thu, 04 Apr 2013 11:47:39 +0000
parents caf1f563e0ee
children 1562f350e8d2
files gui/app/gui.h gui/dialog/about.c gui/dialog/equalizer.c gui/dialog/fileselect.c gui/dialog/msgbox.c gui/dialog/playlist.c gui/dialog/preferences.c gui/dialog/skinbrowser.c gui/dialog/url.c gui/ui/main.c gui/win32/gui.c gui/win32/gui.h gui/wm/ws.c
diffstat 13 files changed, 32 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/gui/app/gui.h	Thu Apr 04 10:53:20 2013 +0000
+++ b/gui/app/gui.h	Thu Apr 04 11:47:39 2013 +0000
@@ -24,6 +24,9 @@
 #ifndef MPLAYER_GUI_GUI_H
 #define MPLAYER_GUI_GUI_H
 
+/// Name of the program the GUI utilizes
+#define MPlayer "MPlayer"
+
 //@{
 /// Boolean symbolic constant
 #if !defined(True) && !defined(False)
--- a/gui/dialog/about.c	Thu Apr 04 10:53:20 2013 +0000
+++ b/gui/dialog/about.c	Thu Apr 04 11:47:39 2013 +0000
@@ -18,6 +18,7 @@
 
 #include "config.h"
 #include "gui/app/app.h"
+#include "gui/app/gui.h"
 #include "help_mp.h"
 #include "version.h"
 
@@ -64,7 +65,7 @@
   gtk_window_set_title( GTK_WINDOW( About ),MSGTR_About );
   gtk_window_set_position( GTK_WINDOW( About ),GTK_WIN_POS_CENTER );
   gtk_window_set_policy( GTK_WINDOW( About ),TRUE,FALSE,FALSE );
-  gtk_window_set_wmclass( GTK_WINDOW( About ),"About","MPlayer" );
+  gtk_window_set_wmclass( GTK_WINDOW( About ),"About",MPlayer );
 
   gtk_widget_realize( About );
   gtkAddIcon( About );
@@ -98,7 +99,7 @@
 #endif
   gtk_widget_show( AboutText );
   gtk_container_add( GTK_CONTAINER( scrolledwindow1 ),AboutText );
-  snprintf(title, sizeof(title), MP_TITLE, "MPlayer");
+  snprintf(title, sizeof(title), MP_TITLE, MPlayer);
 #ifdef CONFIG_GTK2
   gtk_text_buffer_insert (AboutTextBuffer, &iter, title, -1);
   gtk_text_buffer_insert (AboutTextBuffer, &iter,
--- a/gui/dialog/equalizer.c	Thu Apr 04 10:53:20 2013 +0000
+++ b/gui/dialog/equalizer.c	Thu Apr 04 11:47:39 2013 +0000
@@ -28,6 +28,7 @@
 
 #include "gui/app/app.h"
 #include "gui/app/cfg.h"
+#include "gui/app/gui.h"
 #include "gui/interface.h"
 #include "help_mp.h"
 #include "libaf/equalizer.h"
@@ -262,7 +263,7 @@
   gtk_window_set_title( GTK_WINDOW( Equalizer ),MSGTR_Equalizer );
   gtk_window_set_position( GTK_WINDOW( Equalizer ),GTK_WIN_POS_CENTER );
   gtk_window_set_policy( GTK_WINDOW( Equalizer ),FALSE,FALSE,FALSE );
-  gtk_window_set_wmclass( GTK_WINDOW( Equalizer ),"Equalizer","MPlayer" );
+  gtk_window_set_wmclass( GTK_WINDOW( Equalizer ),"Equalizer",MPlayer );
 
   gtk_widget_realize( Equalizer );
   gtkAddIcon( Equalizer );
@@ -593,7 +594,7 @@
   gtk_window_set_position( GTK_WINDOW( EquConfig ),GTK_WIN_POS_CENTER );
 //  gtk_window_set_modal( GTK_WINDOW( EquConfig ),TRUE );
   gtk_window_set_policy( GTK_WINDOW( EquConfig ),FALSE,FALSE,FALSE );
-  gtk_window_set_wmclass( GTK_WINDOW( EquConfig ),"EquConfig","MPlayer" );
+  gtk_window_set_wmclass( GTK_WINDOW( EquConfig ),"EquConfig",MPlayer );
 
   gtk_widget_realize( EquConfig );
   gtkAddIcon( EquConfig );
--- a/gui/dialog/fileselect.c	Thu Apr 04 10:53:20 2013 +0000
+++ b/gui/dialog/fileselect.c	Thu Apr 04 11:47:39 2013 +0000
@@ -611,7 +611,7 @@
     gtk_window_set_title(GTK_WINDOW(FileSelector), MSGTR_FileSelect);
     gtk_window_set_position(GTK_WINDOW(FileSelector), GTK_WIN_POS_CENTER);
     gtk_window_set_policy(GTK_WINDOW(FileSelector), TRUE, TRUE, TRUE);
-    gtk_window_set_wmclass(GTK_WINDOW(FileSelector), "FileSelect", "MPlayer");
+    gtk_window_set_wmclass(GTK_WINDOW(FileSelector), "FileSelect", MPlayer);
     fsColorMap = gdk_colormap_get_system();
 
     gtk_widget_realize(FileSelector);
--- a/gui/dialog/msgbox.c	Thu Apr 04 10:53:20 2013 +0000
+++ b/gui/dialog/msgbox.c	Thu Apr 04 11:47:39 2013 +0000
@@ -19,6 +19,7 @@
 #include <string.h>
 
 #include "gui/app/app.h"
+#include "gui/app/gui.h"
 #include "help_mp.h"
 
 #include "pixmaps/error.xpm"
@@ -60,7 +61,7 @@
  gtk_window_set_position( GTK_WINDOW( MessageBox ),GTK_WIN_POS_CENTER );
  gtk_window_set_modal( GTK_WINDOW( MessageBox ),TRUE );
  gtk_window_set_policy( GTK_WINDOW( MessageBox ),TRUE,TRUE,FALSE );
- gtk_window_set_wmclass( GTK_WINDOW( MessageBox ),"Message","MPlayer" );
+ gtk_window_set_wmclass( GTK_WINDOW( MessageBox ),"Message",MPlayer );
 
  gtk_widget_realize( MessageBox );
  gtkAddIcon( MessageBox );
--- a/gui/dialog/playlist.c	Thu Apr 04 10:53:20 2013 +0000
+++ b/gui/dialog/playlist.c	Thu Apr 04 11:47:39 2013 +0000
@@ -449,7 +449,7 @@
   gtk_window_set_title( GTK_WINDOW( Playlist ),MSGTR_PlayList );
   gtk_window_set_position( GTK_WINDOW( Playlist ),GTK_WIN_POS_CENTER );
 //  gtk_window_set_policy( GTK_WINDOW( Playlist ),FALSE,FALSE,FALSE );
-  gtk_window_set_wmclass( GTK_WINDOW( Playlist ),"Playlist","MPlayer" );
+  gtk_window_set_wmclass( GTK_WINDOW( Playlist ),"Playlist",MPlayer );
 
   gtk_widget_realize( Playlist );
   gtkAddIcon( Playlist );
--- a/gui/dialog/preferences.c	Thu Apr 04 10:53:20 2013 +0000
+++ b/gui/dialog/preferences.c	Thu Apr 04 11:47:39 2013 +0000
@@ -568,7 +568,7 @@
   gtk_window_set_title( GTK_WINDOW( Preferences ),MSGTR_Preferences );
   gtk_window_set_position( GTK_WINDOW( Preferences ),GTK_WIN_POS_CENTER );
 //  gtk_window_set_policy( GTK_WINDOW( Preferences ),FALSE,FALSE,FALSE );
-  gtk_window_set_wmclass( GTK_WINDOW( Preferences ),"Preferences","MPlayer" );
+  gtk_window_set_wmclass( GTK_WINDOW( Preferences ),"Preferences",MPlayer );
 
   gtk_widget_realize( Preferences );
   gtkAddIcon( Preferences );
@@ -1542,7 +1542,7 @@
   gtk_window_set_title(GTK_WINDOW(AudioConfig), MSGTR_AudioPreferences);
   gtk_window_set_position(GTK_WINDOW(AudioConfig), GTK_WIN_POS_CENTER);
   gtk_window_set_policy(GTK_WINDOW(AudioConfig), FALSE, FALSE, FALSE);
-  gtk_window_set_wmclass(GTK_WINDOW(AudioConfig), "Audio Config", "MPlayer");
+  gtk_window_set_wmclass(GTK_WINDOW(AudioConfig), "Audio Config", MPlayer);
 
   gtk_widget_realize(AudioConfig);
   gtkAddIcon(AudioConfig);
@@ -1737,7 +1737,7 @@
  gtk_window_set_title( GTK_WINDOW( DXR3Config ),"DXR3/H+" );
  gtk_window_set_position( GTK_WINDOW( DXR3Config ),GTK_WIN_POS_CENTER );
  gtk_window_set_policy( GTK_WINDOW( DXR3Config ),FALSE,FALSE,FALSE );
- gtk_window_set_wmclass( GTK_WINDOW( DXR3Config ),"DXR3","MPlayer" );
+ gtk_window_set_wmclass( GTK_WINDOW( DXR3Config ),"DXR3",MPlayer );
 
  gtk_widget_realize( DXR3Config );
  gtkAddIcon( DXR3Config );
--- a/gui/dialog/skinbrowser.c	Thu Apr 04 10:53:20 2013 +0000
+++ b/gui/dialog/skinbrowser.c	Thu Apr 04 11:47:39 2013 +0000
@@ -106,7 +106,7 @@
  gtk_window_set_title( GTK_WINDOW( SkinBrowser ),MSGTR_SkinBrowser );
  gtk_window_set_position( GTK_WINDOW( SkinBrowser ),GTK_WIN_POS_CENTER );
  gtk_window_set_policy( GTK_WINDOW( SkinBrowser ),FALSE,FALSE,TRUE );
- gtk_window_set_wmclass( GTK_WINDOW( SkinBrowser ),"SkinBrowser","MPlayer" );
+ gtk_window_set_wmclass( GTK_WINDOW( SkinBrowser ),"SkinBrowser",MPlayer );
 
  gtk_widget_realize( SkinBrowser );
  gtkAddIcon( SkinBrowser );
--- a/gui/dialog/url.c	Thu Apr 04 10:53:20 2013 +0000
+++ b/gui/dialog/url.c	Thu Apr 04 11:47:39 2013 +0000
@@ -25,6 +25,7 @@
 #include "tools.h"
 #include "gui/interface.h"
 #include "gui/app/app.h"
+#include "gui/app/gui.h"
 #include "gui/ui/actions.h"
 #include "gui/util/list.h"
 #include "gui/util/string.h"
@@ -90,7 +91,7 @@
     gtk_window_set_title(GTK_WINDOW(URLDialog), MSGTR_Network);
     gtk_window_set_position(GTK_WINDOW(URLDialog), GTK_WIN_POS_CENTER);
     gtk_window_set_policy(GTK_WINDOW(URLDialog), TRUE, TRUE, FALSE);
-    gtk_window_set_wmclass(GTK_WINDOW(URLDialog), "Network", "MPlayer");
+    gtk_window_set_wmclass(GTK_WINDOW(URLDialog), "Network", MPlayer);
 
     gtk_widget_realize(URLDialog);
     gtkAddIcon(URLDialog);
--- a/gui/ui/main.c	Thu Apr 04 10:53:20 2013 +0000
+++ b/gui/ui/main.c	Thu Apr 04 11:47:39 2013 +0000
@@ -349,7 +349,7 @@
     mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0);
   }
 
-  wsWindowCreate(&guiApp.mainWindow, guiApp.main.x, guiApp.main.y, guiApp.main.width, guiApp.main.height, (guiApp.mainDecoration ? wsShowFrame : 0 ) | wsMinSize | wsMaxSize | wsHideWindow, wsShowMouseCursor | wsHandleMouseButton | wsHandleMouseMove, "MPlayer");
+  wsWindowCreate(&guiApp.mainWindow, guiApp.main.x, guiApp.main.y, guiApp.main.width, guiApp.main.height, (guiApp.mainDecoration ? wsShowFrame : 0 ) | wsMinSize | wsMaxSize | wsHideWindow, wsShowMouseCursor | wsHandleMouseButton | wsHandleMouseMove, MPlayer);
   mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[main] mainWindow ID: 0x%x\n", (int) guiApp.mainWindow.WindowID);
   wsWindowShape(&guiApp.mainWindow, guiApp.main.Mask.Image);
   wsWindowIcon(wsDisplay, guiApp.mainWindow.WindowID, &guiIcon);
--- a/gui/win32/gui.c	Thu Apr 04 10:53:20 2013 +0000
+++ b/gui/win32/gui.c	Thu Apr 04 11:47:39 2013 +0000
@@ -155,7 +155,7 @@
         fp = freopen("con", "w", stdout);
         *stderr = *fp;
         setvbuf(stderr, NULL, _IONBF, 0);
-        print_version("MPlayer");
+        print_version(MPlayer);
         console_state = TRUE;
     }
 
@@ -186,7 +186,7 @@
 static void display_about_box(HWND hWnd)
 {
     char about_msg[512];
-    snprintf(about_msg, sizeof(about_msg), MP_TITLE "\n" COPYRIGHT, "MPlayer");
+    snprintf(about_msg, sizeof(about_msg), MP_TITLE "\n" COPYRIGHT, MPlayer);
     MessageBox(hWnd, about_msg, acp(MSGTR_About), MB_OK);
 }
 
@@ -1516,7 +1516,7 @@
     wc.hCursor = LoadCursor(NULL, IDC_ARROW);
     wc.hIcon = gui->icon;
     wc.hbrBackground = CreateSolidBrush(RGB(0, 0, 0));
-    wc.lpszClassName = gui->classname = "MPlayer";
+    wc.lpszClassName = gui->classname = MPlayer;
     wc.lpszMenuName = NULL;
     RegisterClass(&wc);
 
@@ -1552,7 +1552,7 @@
         gui_main_pos_y = y;
     }
 
-    gui->mainwindow = CreateWindowEx(0, gui->classname, "MPlayer", style,
+    gui->mainwindow = CreateWindowEx(0, gui->classname, MPlayer, style,
                                      x, y, rect.right-rect.left, rect.bottom-rect.top,
                                      NULL, NULL, instance, NULL);
 
@@ -1563,7 +1563,7 @@
     nid.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP;
     nid.uCallbackMessage = WM_SYSTRAY;
     nid.hIcon = gui->icon;
-    strcpy(nid.szTip, "MPlayer");
+    strcpy(nid.szTip, MPlayer);
 
     /* register the systray icon */
     Shell_NotifyIcon(NIM_ADD, &nid);
@@ -1587,7 +1587,7 @@
 {
     gui_t *gui = calloc(1, sizeof(gui_t));
     char temp[MAX_PATH];
-    HWND runningmplayer = FindWindow("MPlayer", "MPlayer");
+    HWND runningmplayer = FindWindow(MPlayer, MPlayer);
 
     if(runningmplayer)
     {
--- a/gui/win32/gui.h	Thu Apr 04 10:53:20 2013 +0000
+++ b/gui/win32/gui.h	Thu Apr 04 11:47:39 2013 +0000
@@ -30,6 +30,9 @@
 #include "skinload.h"
 #include "playlist.h"
 
+/* Name of the program the GUI utilizes */
+#define MPlayer "MPlayer"
+
 extern float video_aspect;
 extern play_tree_t* playtree;
 extern int video_window;
--- a/gui/wm/ws.c	Thu Apr 04 10:53:20 2013 +0000
+++ b/gui/wm/ws.c	Thu Apr 04 11:47:39 2013 +0000
@@ -28,6 +28,7 @@
 #include "ws.h"
 #include "wsxdnd.h"
 #include "gui/interface.h"
+#include "gui/app/gui.h"
 
 #include "config.h"
 #include "help_mp.h"
@@ -861,9 +862,9 @@
                                   win->VisualInfo.visual,
                                   win->WindowMask, &win->WindowAttrib);
 
-    wsClassHint.res_name = "MPlayer";
+    wsClassHint.res_name = MPlayer;
 
-    wsClassHint.res_class = "MPlayer";
+    wsClassHint.res_class = MPlayer;
     XSetClassHint(wsDisplay, win->WindowID, &wsClassHint);
 
     wsWindowSizeHint(win);