/* * CDE - Common Desktop Environment * * Copyright (c) 1993-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these libraries and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* $TOG: PrintMsgs.c /main/14 1999/10/14 13:54:53 mgreess $ */ /* * DtPrint/PrintMsgs.c */ /* * (c) Copyright 1996 Digital Equipment Corporation. * (c) Copyright 1996 Hewlett-Packard Company. * (c) Copyright 1996 International Business Machines Corp. * (c) Copyright 1996 Sun Microsystems, Inc. * (c) Copyright 1996 Novell, Inc. * (c) Copyright 1996 FUJITSU LIMITED. * (c) Copyright 1996 Hitachi. */ #ifdef I18N_MSG #include #include #include #include
#if !defined(NL_CAT_LOCALE) #define NL_CAT_LOCALE 0 #endif #define _DTPRINT_CAT_NAME "DtPrint" #endif /* I18N_MSG */ /* * ------------------------------------------------------------------------ * PrintSetupB module messages */ const char _DtPrMsgPrintSetupBox_0000[] = "Invalid workAreaLocation resource setting."; const char _DtPrMsgPrintSetupBox_0001[] = "More Printers..."; const char _DtPrMsgPrintSetupBox_0002[] = "Print to File"; const char _DtPrMsgPrintSetupBox_0003[] = "Select File..."; const char _DtPrMsgPrintSetupBox_0004[] = "Cancel"; const char _DtPrMsgPrintSetupBox_0005[] = "Copies:"; const char _DtPrMsgPrintSetupBox_0006[] = "Help"; const char _DtPrMsgPrintSetupBox_0007[] = "Print"; const char _DtPrMsgPrintSetupBox_0008[] = "Printer Name:"; const char _DtPrMsgPrintSetupBox_0009[] = "Setup..."; const char _DtPrMsgPrintSetupBox_0010[] = "Printer Description:"; const char _DtPrMsgPrintSetupBox_0011[] = "Copy count out of range."; const char _DtPrMsgPrintSetupBox_0012[] = "Invalid print setup mode."; const char _DtPrMsgPrintSetupBox_0013[] = "Print setup mode cannot be changed."; const char _DtPrMsgPrintSetupBox_0014[] = "Printer Info..."; const char _DtPrMsgPrintSetupBox_0015[] = "Invalid Printer"; const char _DtPrMsgPrintSetupBox_0016[] = "Printer %s not found on X print server %s"; const char _DtPrMsgPrintSetupBox_0017[] = "Unable to connect to X print server %s"; const char _DtPrMsgPrintSetupBox_0018[] = "X server %s does not support printing"; const char _DtPrMsgPrintSetupBox_0019[] = "A default printer could not be determined"; const char _DtPrMsgPrintSetupBox_0020[] = "An X print server for %s could not be found"; const char _DtPrMsgPrintSetupBox_0021[] = "Printer name missing from specifier: %s"; const char _DtPrMsgPrintSetupBox_0022[] = "Invalid print destination."; const char _DtPrMsgPrintSetupBox_0023[] = "Unable to convert from compound text."; const char _DtPrMsgPrintSetupBox_0024[] = "Arguments not needed for resource conversion."; const char _DtPrMsgPrintSetupBox_0025[] = "Select Printer Error"; const char _DtPrMsgPrintSetupBox_0026[] = "Unable to find any printers."; const char _DtPrMsgPrintSetupBox_0027[] = "description unavailable"; const char _DtPrMsgPrintSetupBox_0028[] = "Select File"; const char _DtPrMsgPrintSetupBox_0029[] = "Printer Information"; const char _DtPrMsgPrintSetupBox_0030[] = "Format:"; const char _DtPrMsgPrintSetupBox_0031[] = "Printer Model:"; const char _DtPrMsgPrintSetupBox_0032[] = "Printers:"; const char _DtPrMsgPrintSetupBox_0033[] = "More Printers"; const char _DtPrMsgPrintSetupBox_0034[] = "Print to Printer"; const char _DtPrMsgPrintSetupBox_0035[] = "File Name:"; const char _DtPrMsgPrintSetupBox_0036[] = "Print Setup - Help"; /* * ------------------------------------------------------------------------ * _DtPrint Frame widget messages */ const char _DtPrMsgPrintOption_0000[] = "Margins"; const char _DtPrMsgPrintOption_0001[] = "Top:"; const char _DtPrMsgPrintOption_0002[] = "Right:"; const char _DtPrMsgPrintOption_0003[] = "Bottom:"; const char _DtPrMsgPrintOption_0004[] = "Left:"; const char _DtPrMsgPrintOption_0005[] = "Headers and Footers"; const char _DtPrMsgPrintOption_0006[] = "Top Left:"; const char _DtPrMsgPrintOption_0007[] = "Top Right:"; const char _DtPrMsgPrintOption_0008[] = "Bottom Left:"; const char _DtPrMsgPrintOption_0009[] = "Bottom Right:"; /* * ------------------------------------------------------------------------ * Dt Print Dialog Manager module messages */ const char _DtPrMsgPrintDlgMgr_0000[] = "Send Mail When Done"; const char _DtPrMsgPrintDlgMgr_0001[] = "Banner Page Title:"; const char _DtPrMsgPrintDlgMgr_0002[] = "Print Command Options:"; #if defined(I18N_MSG) #if defined(hpV4) /* * Wrapper around catgets -- this makes sure the message string is saved * in a safe location; so repeated calls to catgets() do not overwrite * the catgets() internal buffer. This has been a problem on HP systems. */ static char *catgets_cached(nl_catd catd, int set, int num, char *dflt) { #define INITIAL_NMSGS_PER_SET 300 #define INITIAL_NSETS 50 /* array to hold messages from catalog */ static char ***cached_msgs = NULL; static int nmsgs_per_set = INITIAL_NMSGS_PER_SET; static int nsets = INITIAL_NSETS; char **setptr; int i, multiplier; Cardinal size; char* message; /* convert to a zero based index */ int setIdx = set - 1; int numIdx = num - 1; _DtPrintProcessLock(); if (NULL == cached_msgs) { size = sizeof(char**) * nsets; cached_msgs = (char***) XtMalloc(size); memset((char*) cached_msgs, 0, size); } else if (setIdx >= nsets) { for (multiplier=2; setIdx > multiplier*nsets; multiplier++) {} size = sizeof(char**) * nsets; cached_msgs = (char***) XtRealloc((char*) cached_msgs, multiplier * size); memset((char*) (cached_msgs + size), 0, multiplier * size); nsets *= multiplier; } if (NULL == cached_msgs[setIdx]) { size = sizeof(char*) * nmsgs_per_set; cached_msgs[setIdx] = (char**) XtMalloc(size); memset((char*) cached_msgs[setIdx], 0, size); } else if (numIdx >= nmsgs_per_set) { for (multiplier=2; numIdx > multiplier*nsets; multiplier++) {} size = sizeof(char*) * nmsgs_per_set; for (i=0; i