comparison gui/wm/ws.c @ 36694:eed2fb870f43

Rename symbolic constants of GUI help message texts. Create a kind of GUI namespace and don't add place or kind of usage to the name unless it's advantageous. This reduces the amount of definitions as well. Arrange them alphabetically.
author ib
date Wed, 05 Feb 2014 16:39:38 +0000
parents f5e428d7991b
children d8b2651bfeab
comparison
equal deleted inserted replaced
36693:44334c832149 36694:eed2fb870f43
198 } 198 }
199 199
200 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[ws] display name: %s => %s display.\n", dispname, localdisp ? "local" : "REMOTE"); 200 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[ws] display name: %s => %s display.\n", dispname, localdisp ? "local" : "REMOTE");
201 201
202 if (!localdisp) 202 if (!localdisp)
203 mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_WS_RemoteDisplay); 203 mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_GUI_MSG_RemoteDisplay);
204 } 204 }
205 205
206 #ifdef HAVE_SHM 206 #ifdef HAVE_SHM
207 if (!XShmQueryExtension(wsDisplay)) 207 if (!XShmQueryExtension(wsDisplay))
208 #endif 208 #endif
209 wsUseXShm = False; 209 wsUseXShm = False;
210 210
211 if (!wsUseXShm) 211 if (!wsUseXShm)
212 mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_WS_NoXshm); 212 mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_GUI_MSG_XSharedMemoryUnavailable);
213 213
214 #ifdef CONFIG_XSHAPE 214 #ifdef CONFIG_XSHAPE
215 if (!XShapeQueryExtension(wsDisplay, &eventbase, &errorbase)) 215 if (!XShapeQueryExtension(wsDisplay, &eventbase, &errorbase))
216 #endif 216 #endif
217 wsUseXShape = False; 217 wsUseXShape = False;
218 218
219 if (!wsUseXShape) 219 if (!wsUseXShape)
220 mp_msg(MSGT_GPLAYER, MSGL_WARN, MSGTR_WS_NoXshape); 220 mp_msg(MSGT_GPLAYER, MSGL_WARN, MSGTR_GUI_MSG_XShapeError);
221 221
222 wsScreen = DefaultScreen(wsDisplay); 222 wsScreen = DefaultScreen(wsDisplay);
223 wsRootWin = RootWindow(wsDisplay, wsScreen); 223 wsRootWin = RootWindow(wsDisplay, wsScreen);
224 #ifdef CONFIG_XF86VM 224 #ifdef CONFIG_XF86VM
225 { 225 {
310 { 310 {
311 char type[128]; 311 char type[128];
312 312
313 XGetErrorText(display, event->error_code, type, sizeof(type)); 313 XGetErrorText(display, event->error_code, type, sizeof(type));
314 314
315 mp_msg(MSGT_GPLAYER, MSGL_ERR, "[ws] " MSGTR_WS_XError); 315 mp_msg(MSGT_GPLAYER, MSGL_ERR, "[ws] " MSGTR_GUI_MSG_X11Error);
316 mp_msg(MSGT_GPLAYER, MSGL_ERR, "[ws] Error code: %d - %s\n", event->error_code, type); 316 mp_msg(MSGT_GPLAYER, MSGL_ERR, "[ws] Error code: %d - %s\n", event->error_code, type);
317 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[ws] Request code: %d (minor code: %d)\n", event->request_code, event->minor_code); 317 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[ws] Request code: %d (minor code: %d)\n", event->request_code, event->minor_code);
318 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[ws] MPlayer module: %s\n", current_module ? current_module : "(none)"); 318 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[ws] MPlayer module: %s\n", current_module ? current_module : "(none)");
319 319
320 return 0; 320 return 0;
768 for (i = 0; i < wsWLCount; i++) 768 for (i = 0; i < wsWLCount; i++)
769 if (wsWindowList[i] == NULL) 769 if (wsWindowList[i] == NULL)
770 break; 770 break;
771 771
772 if (i == wsWLCount) { 772 if (i == wsWLCount) {
773 mp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_WS_TooManyOpenWindows); 773 mp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_GUI_MSG_TooManyWindows);
774 mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0); 774 mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0);
775 } 775 }
776 776
777 wsWindowList[i] = win; 777 wsWindowList[i] = win;
778 778
799 win->wsCursor = XCreatePixmapCursor(wsDisplay, win->wsCursorPixmap, win->wsCursorPixmap, &win->wsColor, &win->wsColor, 0, 0); 799 win->wsCursor = XCreatePixmapCursor(wsDisplay, win->wsCursorPixmap, win->wsCursorPixmap, &win->wsColor, &win->wsColor, 0, 0);
800 800
801 depth = vo_find_depth_from_visuals(wsDisplay, wsScreen, NULL); 801 depth = vo_find_depth_from_visuals(wsDisplay, wsScreen, NULL);
802 802
803 if (depth < 15) { 803 if (depth < 15) {
804 mp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_WS_ColorDepthTooLow); 804 mp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_GUI_MSG_ColorDepthTooLow);
805 mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0); 805 mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0);
806 } 806 }
807 807
808 XMatchVisualInfo(wsDisplay, wsScreen, depth, TrueColor, &win->VisualInfo); 808 XMatchVisualInfo(wsDisplay, wsScreen, depth, TrueColor, &win->VisualInfo);
809 809
1293 if (wsUseXShm) { 1293 if (wsUseXShm) {
1294 win->xImage = XShmCreateImage(wsDisplay, win->VisualInfo.visual, 1294 win->xImage = XShmCreateImage(wsDisplay, win->VisualInfo.visual,
1295 win->VisualInfo.depth, ZPixmap, NULL, &win->Shminfo, w, h); 1295 win->VisualInfo.depth, ZPixmap, NULL, &win->Shminfo, w, h);
1296 1296
1297 if (win->xImage == NULL) { 1297 if (win->xImage == NULL) {
1298 mp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_WS_ShmError); 1298 mp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_GUI_MSG_XSharedMemoryError);
1299 mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0); 1299 mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0);
1300 } 1300 }
1301 1301
1302 win->Shminfo.shmid = shmget(IPC_PRIVATE, win->xImage->bytes_per_line * win->xImage->height, IPC_CREAT | 0777); 1302 win->Shminfo.shmid = shmget(IPC_PRIVATE, win->xImage->bytes_per_line * win->xImage->height, IPC_CREAT | 0777);
1303 1303
1304 if (win->Shminfo.shmid < 0) { 1304 if (win->Shminfo.shmid < 0) {
1305 XDestroyImage(win->xImage); 1305 XDestroyImage(win->xImage);
1306 mp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_WS_ShmError); 1306 mp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_GUI_MSG_XSharedMemoryError);
1307 mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0); 1307 mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0);
1308 } 1308 }
1309 1309
1310 win->Shminfo.shmaddr = (char *)shmat(win->Shminfo.shmid, 0, 0); 1310 win->Shminfo.shmaddr = (char *)shmat(win->Shminfo.shmid, 0, 0);
1311 1311
1313 XDestroyImage(win->xImage); 1313 XDestroyImage(win->xImage);
1314 1314
1315 if (win->Shminfo.shmaddr != ((char *)-1)) 1315 if (win->Shminfo.shmaddr != ((char *)-1))
1316 shmdt(win->Shminfo.shmaddr); 1316 shmdt(win->Shminfo.shmaddr);
1317 1317
1318 mp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_WS_ShmError); 1318 mp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_GUI_MSG_XSharedMemoryError);
1319 mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0); 1319 mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0);
1320 } 1320 }
1321 1321
1322 win->xImage->data = win->Shminfo.shmaddr; 1322 win->xImage->data = win->Shminfo.shmaddr;
1323 win->Shminfo.readOnly = False; 1323 win->Shminfo.readOnly = False;
1330 ZPixmap, 0, 0, w, h, 1330 ZPixmap, 0, 0, w, h,
1331 (wsScreenDepth == 3) ? 32 : wsScreenDepth, 1331 (wsScreenDepth == 3) ? 32 : wsScreenDepth,
1332 0); 1332 0);
1333 1333
1334 if ((win->xImage->data = malloc(win->xImage->bytes_per_line * win->xImage->height)) == NULL) { 1334 if ((win->xImage->data = malloc(win->xImage->bytes_per_line * win->xImage->height)) == NULL) {
1335 mp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_WS_NotEnoughMemoryDrawBuffer); 1335 mp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_GUI_MSG_MemoryErrorImage);
1336 mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0); 1336 mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0);
1337 } 1337 }
1338 } 1338 }
1339 1339
1340 win->ImageData = (unsigned char *)win->xImage->data; 1340 win->ImageData = (unsigned char *)win->xImage->data;