1 #ifndef cmddriverbasics_h 2 #define cmddriverbasics_h 15 #include "uicmddrivermod.h" 33 #define mAddCharToBufStr( bufstr, chr ) \ 34 { char str[2]; str[0] = mCast(char,chr); str[1] = '\0'; bufstr += str; } 36 #define mSepStrSize(fms) ( fms.isEmpty() ? 1 : fms.size() ) 38 #define mGetAmpFilteredStr( dest, src ) \ 39 BufferString dest( src ); \ 40 StringProcessor(dest).filterAmpersands(); 43 #define mGetEscConvertedFMS( fms, str, removecmdfileescapes ) \ 45 BufferString fms##bufstr( str ); \ 46 StringProcessor( fms##bufstr ).addFileMultiStrEscapes(); \ 47 if ( removecmdfileescapes ) \ 48 StringProcessor( fms##bufstr ).removeCmdFileEscapes(); \ 50 FileMultiString fms( fms##bufstr.buf() ); 53 #define mStripOuterBrackets( name, context ) \ 54 StringProcessor(name).stripOuterBrackets( \ 55 StringProcessor::context##VoidBeginBrackets(), \ 56 StringProcessor::context##VoidEndBrackets() ) 59 #define mDressString( name, context, cleanup ) \ 62 StringProcessor(name).cleanUp(); \ 63 while ( mStripOuterBrackets(name, sDress) ) ; \ 64 StringProcessor(name).addCmdFileEscapes( \ 65 StringProcessor::context##EscSymbols() ); \ 68 #define mDressNameString( name, context ) \ 69 mDressString( name, context, true ); 71 #define mDressUserInputString( name, context ) \ 72 mDressString( name, context, false ); 75 #define mIsSymbol(chr) ( !iswalnum(chr) && !iswspace(chr) ) 78 #define mGetColorString( color, isvalid, colorstr ) \ 80 FileMultiString colorstr; \ 81 colorstr += isvalid ? (int) color.r() : 255; \ 82 colorstr += isvalid ? (int) color.g() : 255; \ 83 colorstr += isvalid ? (int) color.b() : 255; \ 84 colorstr += isvalid ? (int) color.t() : 255; \ 87 #define mUnscope( identstr, unscopedstr ) \ 88 const char* unscopedstr = *identstr=='@' ? identstr+1 : identstr; 95 : constptr_(bs.buf()), bufstr_(&bs)
99 : constptr_(ss.buf()), bufstr_(&ss.rep())
103 : constptr_(str), bufstr_(0)
106 const char* parseDQuoted(
BufferString& unquotedstr)
const;
107 int consecutiveDQuoted(
const char** remnant=0)
const;
108 int nrDQuotes()
const;
110 const char* parseBracketed(
BufferString& unbracketedstr,
111 char begin=
'[',
char end=
']')
const;
113 int removeNumAppendix();
114 bool removeTokenAppendix(
char token);
117 const char* findAssignment(
const char* tokens=
"=")
const;
120 bool convertToInt(
int* =0)
const;
121 bool convertToDouble(
double* =0)
const;
126 void makeDirSepIndep(
int startpos=-1);
128 void addCmdFileEscapes(
const char* extraescapesymbols=0);
129 bool isEscapedSymbol(
const char*)
const;
130 void removeCmdFileEscapes();
131 void addFileMultiStrEscapes();
133 const char* getCharElement(
int idx)
const;
134 int nrCharElements()
const;
135 void appendCharElements(
const char* tail);
137 void filterAmpersands();
138 void capitalize(
bool yn=
true);
140 void removeExtraSpace();
141 void removeTrailingDots();
144 char stripOuterBrackets(
const char* beginsymbols,
145 const char* endsymbols);
147 const char*
buf()
const {
return constptr_; }
183 bool moveToTop(
const uiMainWin*);
184 bool moveFrameToTop(
const uiMainWin*);
186 const uiMainWin* topWin(
bool ignorecmddriverwins=
false)
const;
191 bool moveToTopWithoutSync(
const uiMainWin*);
227 bool isValid()
const {
return uiobj_ || uiact_; }
230 const uiAction*
action()
const {
return uiact_; }
232 bool visible()
const;
233 bool sensitive()
const;
235 const char* name()
const;
236 const char* toolTip()
const;
239 const uiMenu* menu()
const;
bool wait_
Definition: cmddriverbasics.h:206
uiString infotext_
Definition: cmddriverbasics.h:212
#define mExpClass(module)
Definition: commondefs.h:160
User interface main window.
Definition: uimainwin.h:36
uiString cancelbuttext_
Definition: cmddriverbasics.h:211
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
bool isCmdDriverWindow(const uiMainWin *)
Definition of a mouse cursor, can be either a predefined shape (from the enum, or a file...
Definition: mousecursor.h:26
uiString dlgtitle_
Definition: cmddriverbasics.h:209
StringProcessor(SeparString &ss)
Definition: cmddriverbasics.h:98
Command Drive
Definition: canvascommands.h:22
Shape
Definition: mousecursor.h:57
const char * constptr_
Definition: cmddriverbasics.h:166
#define mGlobal(module)
Definition: commondefs.h:163
InteractSpec(bool wait=true)
Definition: cmddriverbasics.h:200
static const char * sDressVoidEndBrackets()
Definition: cmddriverbasics.h:162
const char * controllerTitle()
StringProcessor(const char *str)
Definition: cmddriverbasics.h:102
uiString okbuttext_
Definition: cmddriverbasics.h:210
const char * buf() const
Definition: cmddriverbasics.h:147
const char * windowTitle(const uiMainWin *applwin, const uiMainWin *uimw, int aliasnr=0)
List encoded in a string.
Definition: separstr.h:33
The base class for most UI elements.
Definition: uiobj.h:38
static const char * sWinNameEscSymbols()
Definition: cmddriverbasics.h:150
Definition: uistring.h:89
Definition: uiparent.h:26
static const char * sMatchVoidBeginBrackets()
Definition: cmddriverbasics.h:158
SeparString with backquotes as separators, use in most ascii files.
Definition: separstr.h:119
static const char * sWinAssertEscSymbols()
Definition: cmddriverbasics.h:149
MouseCursor::Shape cursorshape_
Definition: cmddriverbasics.h:208
const uiMainWin * launchpad_
Definition: cmddriverbasics.h:207
static const char * sInputStrEscSymbols()
Definition: cmddriverbasics.h:155
Definition: cmddriverbasics.h:197
const uiAction * action() const
Definition: cmddriverbasics.h:230
static const char * sItemNameEscSymbols()
Definition: cmddriverbasics.h:154
const uiObject * uiobj_
Definition: cmddriverbasics.h:245
const uiAction * uiact_
Definition: cmddriverbasics.h:246
static const char * sMatchVoidEndBrackets()
Definition: cmddriverbasics.h:159
static const char * sMenuPathEscSymbols()
Definition: cmddriverbasics.h:152
const uiObject * object() const
Definition: cmddriverbasics.h:229
static const char * sDressVoidBeginBrackets()
Definition: cmddriverbasics.h:161
Convenience class UIEntity offers access to shared functionality of uiAction and uiObject, given their base class CallBacker. Since toolbar buttons are no longer uiToolButtons but uiActions, unspecified UI objects have to be passed as CallBackers.
Definition: cmddriverbasics.h:222
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
BufferString * bufstr_
Definition: cmddriverbasics.h:167
bool isValid() const
Definition: cmddriverbasics.h:227
uiString resumetext_
Definition: cmddriverbasics.h:213
WindowStack()
Definition: cmddriverbasics.h:181
Definition: cmddriverbasics.h:178
static const char * sTreePathEscSymbols()
Definition: cmddriverbasics.h:153
Definition: cmddriverbasics.h:91
StringProcessor(BufferString &bs)
Definition: cmddriverbasics.h:94
static const char * sKeyStrEscSymbols()
Definition: cmddriverbasics.h:151
ObjectSet< const uiMainWin > winstack_
Definition: cmddriverbasics.h:193
static const char * sAllEscSymbols()
Definition: cmddriverbasics.h:156