1 | /* ***** BEGIN LICENSE BLOCK ***** |
---|
2 | * Version: CDDL 1.0/LGPL 2.1 |
---|
3 | * |
---|
4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND |
---|
5 | * DISTRIBUTION LICENSE (CDDL) Version 1.0 (the "License"); you may not use |
---|
6 | * this file except in compliance with the License. You may obtain a copy of |
---|
7 | * the License at http://www.sun.com/cddl/ |
---|
8 | * |
---|
9 | * Software distributed under the License is distributed on an "AS IS" basis, |
---|
10 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
---|
11 | * for the specific language governing rights and limitations under the |
---|
12 | * License. |
---|
13 | * |
---|
14 | * The Initial Developer of the Original Code is |
---|
15 | * Eugene Romanenko, netlabs.org. |
---|
16 | * Portions created by the Initial Developer are Copyright (C) 2006 |
---|
17 | * the Initial Developer. All Rights Reserved. |
---|
18 | * |
---|
19 | * Contributor(s): |
---|
20 | * |
---|
21 | * Alternatively, the contents of this file may be used under the terms of |
---|
22 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), |
---|
23 | * in which case the provisions of the LGPL are applicable instead of those |
---|
24 | * above. If you wish to allow use of your version of this file only under the |
---|
25 | * terms of the LGPL, and not to allow others to use your version of this file |
---|
26 | * under the terms of the CDDL, indicate your decision by deleting the |
---|
27 | * provisions above and replace them with the notice and other provisions |
---|
28 | * required by the LGPL. If you do not delete the provisions above, a recipient |
---|
29 | * may use your version of this file under the terms of any one of the CDDL |
---|
30 | * or the LGPL. |
---|
31 | * |
---|
32 | * ***** END LICENSE BLOCK ***** */ |
---|
33 | |
---|
34 | |
---|
35 | #ifndef __LUUTILS_H |
---|
36 | #define __LUUTILS_H |
---|
37 | |
---|
38 | |
---|
39 | // Auto-free buffer |
---|
40 | class afbuf |
---|
41 | { |
---|
42 | protected: |
---|
43 | unsigned int size; |
---|
44 | public: |
---|
45 | char *buffer; |
---|
46 | afbuf( unsigned int s ); |
---|
47 | ~afbuf() { delete buffer; } |
---|
48 | unsigned int getSize() { return size; } |
---|
49 | private: |
---|
50 | // dummy copy constructor and operator= to prevent copying |
---|
51 | afbuf( const afbuf& ); |
---|
52 | afbuf& operator = ( const afbuf& ); |
---|
53 | }; |
---|
54 | |
---|
55 | |
---|
56 | #ifdef INCL_WIN |
---|
57 | BOOL CreateGraphicsBuffer( HAB hab, PRECTL prectl, HPS hps, HPS *phpsBuffer, HDC *phdcBuffer ); |
---|
58 | void BlitGraphicsBuffer( HPS hps, HPS hpsBuffer, PRECTL prclPaint ); |
---|
59 | void DestroyGraphicsBuffer( HPS hpsBuffer, HDC hdcBuffer ); |
---|
60 | BOOL PMStoreWindowPos( PCSZ pIniName, PCSZ pAppName, PCSZ pKeyName, HWND hwnd ); |
---|
61 | void PMStoreWindowPosI( HINI ini, PCSZ pAppName, PCSZ pKeyName, HWND hwnd ); |
---|
62 | BOOL PMRestoreWindowPos( PCSZ pIniName, PCSZ pAppName, PCSZ pKeyName, |
---|
63 | HWND hwnd, BOOL activate, BOOL chkCoord, |
---|
64 | BOOL min, BOOL max, BOOL hide ); |
---|
65 | SHORT getStringPixSize( HPS hps, PCSZ str ); |
---|
66 | void textToClipbrd( HAB hab, const char *text ); |
---|
67 | void centerWindow( HWND parent, HWND hwnd ); |
---|
68 | SHORT setZoomValues( HWND lbox ); |
---|
69 | double convZoom( SHORT v ); |
---|
70 | #endif |
---|
71 | |
---|
72 | |
---|
73 | char *newstrdup( const char *s ); |
---|
74 | char *getTmpDir( char *buf ); |
---|
75 | |
---|
76 | // Internationalization/Localization |
---|
77 | void loadLang(); |
---|
78 | #ifdef INCL_WIN |
---|
79 | void localizeMenu( HWND hmenu ); |
---|
80 | void localizeDialog( HWND hdlg ); |
---|
81 | #endif |
---|
82 | void getLocalizedString( const char *key, LONG maxLen, char *buf ); |
---|
83 | char *newstrdupL( const char *key ); |
---|
84 | #ifdef _STRING_INCLUDED |
---|
85 | std::string getLocalizedString( const char *t ); |
---|
86 | std::string str( double n ); |
---|
87 | std::string time2string( unsigned long time ); |
---|
88 | #endif |
---|
89 | |
---|
90 | extern "C" int startBrowser( const char *url ); |
---|
91 | |
---|
92 | |
---|
93 | #endif // __LUUTILS_H |
---|
94 | |
---|