LXRAD 0.7

lxutils.h
1/* ########################################################################
2
3 LXRAD - GUI for X programing
4
5 ########################################################################
6
7 Copyright (c) : 2001-2019 Luis Claudio Gamboa Lopes
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
12 any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22
23 For e-mail suggestions : lcgamboa@yahoo.com
24 ######################################################################## */
25
26
27#ifndef LXUTILS_H
28#define LXUTILS_H
29
30#include"clxrad.h"
31
32#include<wx/bitmap.h>
33#include"cwindow.h"
34
35 class xBitmap:public wxBitmap
36{
37 public:
38 xBitmap(wxImage * img, CWindow * win):wxBitmap(*img){};
39 xBitmap(unsigned int x, unsigned int y):wxBitmap(x,y){};
40};
41
42 class xImage:public wxImage
43{
44 public:
45 xImage(CWindow * win):wxImage(){};
46 bool LoadFile(const lxString fname, int orientation = 0, double scalex = 1.0, double scaley = 1.0 , int usealpha = 0, double * ret_sx=NULL, double * ret_sy=NULL);
47 using wxImage::operator=;
48};
49
50
51#define lxT wxT
52#define lxImage xImage
53#define lxBitmap xBitmap
54#define lxFont wxFont
55#define lxSound wxSound
56#define lxColor wxColor
57#define lxPoint wxPoint
58#define lxCursor wxCursor
59#define lxFileName wxFileName
60#define lxTextFile wxTextFile
61#define lxMutex wxMutex
62#define lxCondition wxCondition
63
64#define lxSetCursor wxSetCursor
65#define lxMilliSleep wxMilliSleep
66#define lxFileExists wxFileExists
67#define lxExecute wxExecute
68#define lxGetCwd wxGetCwd
69#define lxLaunchDefaultBrowser wxLaunchDefaultBrowser
70#define lxSetWorkingDirectory wxSetWorkingDirectory
71#define lxRenameFile wxRenameFile
72#define lxLaunchDefaultApplication wxLaunchDefaultApplication
73
74
75#define lxSysErrorMsg wxSysErrorMsg
76#define lxSysErrorCode wxSysErrorCode
77
78#define lxMOUSE_BTN_LEFT wxMOUSE_BTN_LEFT
79
80#define lxEXEC_SYNC wxEXEC_SYNC
81#define lxEXEC_ASYNC wxEXEC_ASYNC
82
83#define lxRED wxRED
84#define lxBLUE wxBLUE
85
86#define lxCURSOR_CROSS wxCURSOR_CROSS
87#define lxCURSOR_ARROW wxCURSOR_ARROW
88#define lxCURSOR_SIZENWSE wxCURSOR_SIZENWSE
89#define lxCURSOR_SIZING wxCURSOR_SIZING
90#define lxCURSOR_SIZEWE wxCURSOR_SIZEWE
91#define lxCURSOR_SIZENS wxCURSOR_SIZENS
92
93#define lxSize wxSize
94
95#define lxFONTFAMILY_TELETYPE wxFONTFAMILY_TELETYPE
96#define lxFONTSTYLE_NORMAL wxFONTSTYLE_NORMAL
97#define lxFONTWEIGHT_BOLD wxFONTWEIGHT_BOLD
98#define lxFONTWEIGHT_NORMAL wxFONTWEIGHT_NORMAL
99#define lxFONTFAMILY_DEFAULT wxFONTFAMILY_DEFAULT
100
101
102#define lxSOUND_ASYNC wxSOUND_ASYNC
103#define lxSOUND_LOOP wxSOUND_LOOP
104
105#define lxFD_OPEN wxFD_OPEN
106#define lxFD_SAVE wxFD_SAVE
107#define lxFD_CHANGE_DIR wxFD_CHANGE_DIR
108
109#define lxC2S_HTML_SYNTAX wxC2S_HTML_SYNTAX
110
111#define lxEXEC_MAKE_GROUP_LEADER wxEXEC_MAKE_GROUP_LEADER
112
113#define lxConvUTF8 wxConvUTF8
114
115#define lxRect wxRect
116#define lxALIGN_LEFT wxALIGN_LEFT
117#define lxALIGN_RIGHT wxALIGN_RIGHT
118#define lxALIGN_CENTER_VERTICAL wxALIGN_CENTER_VERTICAL
119#define lxALIGN_CENTER wxALIGN_CENTER
120
121#define LXK_SHIFT WXK_SHIFT
122#define LXK_CONTROL WXK_CONTROL
123#define LXK_RIGHT WXK_RIGHT
124#define LXK_LEFT WXK_LEFT
125#define LXK_DOWN WXK_DOWN
126#define LXK_UP WXK_UP
127
128lxBitmap * lxGetBitmapRotated(lxImage *image, CWindow * win, int orientation);
129
130lxString lxGetUserDataDir(lxString appname="");
131lxString lxGetTempDir(lxString appname="");
132lxString lxGetExecutablePath(lxString appname="");
133
134 bool lxZipDir(const lxString &in_dirname, const lxString &out_filename);
135 bool lxUnzipDir(const lxString &in_filename, const lxString &out_dirname);
136
137 bool lxRemoveFile(const char* fname);
138 bool lxRemoveDir(const char* dirname);
139 bool lxCreateDir(const char * dirname);
140
141 unsigned int lxGetDisplayWidth(int disp);
142 unsigned int lxGetDisplayHeight(int disp);
143
144lxString lxGetLocalFile(lxString file);
145
146#endif /* LXUTILS_H */
CWindow
Image Control.
Definition: cwindow.h:50
xBitmap
Definition: lxutils.h:36
xImage
Definition: lxutils.h:43
clxrad.h
cwindow.h