#include <llpreviewscript.h>
Public Member Functions | |
LLScriptEdCore (const std::string &name, const LLRect &rect, const std::string &sample, const std::string &help, const LLHandle< LLFloater > &floater_handle, void(*load_callback)(void *userdata), void(*save_callback)(void *userdata, BOOL close_after_save), void(*search_replace_callback)(void *userdata), void *userdata, S32 bottom_pad=0) | |
~LLScriptEdCore () | |
void | initMenu () |
virtual void | draw () |
BOOL | canClose () |
void | selectFirstError () |
virtual BOOL | handleKeyHere (KEY key, MASK mask) |
Static Public Member Functions | |
static void | handleSaveChangesDialog (S32 option, void *userdata) |
static void | handleReloadFromServerDialog (S32 option, void *userdata) |
static void | onHelpWebDialog (S32 option, void *userdata) |
static void | onBtnHelp (void *userdata) |
static void | onBtnDynamicHelp (void *userdata) |
static void | onCheckLock (LLUICtrl *, void *) |
static void | onHelpComboCommit (LLUICtrl *ctrl, void *userdata) |
static void | onClickBack (void *userdata) |
static void | onClickForward (void *userdata) |
static void | onBtnInsertSample (void *) |
static void | onBtnInsertFunction (LLUICtrl *, void *) |
static void | doSave (void *userdata, BOOL close_after_save) |
static void | onBtnSave (void *) |
static void | onBtnUndoChanges (void *) |
static void | onSearchMenu (void *userdata) |
static void | onUndoMenu (void *userdata) |
static void | onRedoMenu (void *userdata) |
static void | onCutMenu (void *userdata) |
static void | onCopyMenu (void *userdata) |
static void | onPasteMenu (void *userdata) |
static void | onSelectAllMenu (void *userdata) |
static void | onDeselectMenu (void *userdata) |
static BOOL | enableUndoMenu (void *userdata) |
static BOOL | enableRedoMenu (void *userdata) |
static BOOL | enableCutMenu (void *userdata) |
static BOOL | enableCopyMenu (void *userdata) |
static BOOL | enablePasteMenu (void *userdata) |
static BOOL | enableSelectAllMenu (void *userdata) |
static BOOL | enableDeselectMenu (void *userdata) |
static BOOL | hasChanged (void *userdata) |
Protected Member Functions | |
void | deleteBridges () |
void | setHelpPage (const LLString &help_string) |
void | updateDynamicHelp (BOOL immediate=FALSE) |
void | addHelpItemToHistory (const LLString &help_string) |
virtual const char * | getTitleName () const |
Static Protected Member Functions | |
static void | onErrorList (LLUICtrl *, void *user_data) |
Private Attributes | |
LLString | mSampleText |
std::string | mHelpFile |
LLTextEditor * | mEditor |
void(* | mLoadCallback )(void *userdata) |
void(* | mSaveCallback )(void *userdata, BOOL close_after_save) |
void(* | mSearchReplaceCallback )(void *userdata) |
void * | mUserdata |
LLComboBox * | mFunctions |
BOOL | mForceClose |
LLPanel * | mCodePanel |
LLScrollListCtrl * | mErrorList |
LLDynamicArray < LLEntryAndEdCore * > | mBridges |
LLHandle< LLFloater > | mLiveHelpHandle |
LLKeywordToken * | mLastHelpToken |
LLFrameTimer | mLiveHelpTimer |
S32 | mLiveHelpHistorySize |
Friends | |
class | LLPreviewScript |
class | LLPreviewLSL |
class | LLLiveLSLEditor |
class | LLFloaterScriptSearch |
Definition at line 56 of file llpreviewscript.h.
LLScriptEdCore::LLScriptEdCore | ( | const std::string & | name, | |
const LLRect & | rect, | |||
const std::string & | sample, | |||
const std::string & | help, | |||
const LLHandle< LLFloater > & | floater_handle, | |||
void(*)(void *userdata) | load_callback, | |||
void(*)(void *userdata, BOOL close_after_save) | save_callback, | |||
void(*)(void *userdata) | search_replace_callback, | |||
void * | userdata, | |||
S32 | bottom_pad = 0 | |||
) |
LLScriptEdCore::~LLScriptEdCore | ( | ) |
Definition at line 376 of file llpreviewscript.cpp.
References LLFloater::close(), deleteBridges(), LLFloaterScriptSearch::getEditorCore(), and LLFloaterScriptSearch::getInstance().
void LLScriptEdCore::initMenu | ( | ) |
Definition at line 389 of file llpreviewscript.cpp.
References enableCopyMenu(), enableCutMenu(), enablePasteMenu(), enableRedoMenu(), enableSelectAllMenu(), enableUndoMenu(), hasChanged(), NULL, onBtnDynamicHelp(), onBtnHelp(), onBtnSave(), onBtnUndoChanges(), onCopyMenu(), onCutMenu(), onPasteMenu(), onRedoMenu(), onSearchMenu(), onSelectAllMenu(), onUndoMenu(), LLMenuItemCallGL::setEnabledCallback(), and LLMenuItemCallGL::setMenuCallback().
void LLScriptEdCore::draw | ( | void | ) | [virtual] |
Reimplemented from LLPanel.
Definition at line 445 of file llpreviewscript.cpp.
References LLPanel::childSetEnabled(), LLPanel::childSetText(), LLPanel::draw(), FALSE, LLTextEditor::getCurrentLineAndColumn(), LLUICtrl::hasFocus(), LLTextEditor::isPristine(), llformat(), mEditor, LLStringBase< char >::null, S32, and updateDynamicHelp().
BOOL LLScriptEdCore::canClose | ( | ) |
Definition at line 595 of file llpreviewscript.cpp.
References LLViewerWindow::alertXml(), FALSE, gViewerWindow, handleSaveChangesDialog(), LLTextEditor::isPristine(), mEditor, mForceClose, and TRUE.
Referenced by LLLiveLSLEditor::canClose(), and LLPreviewLSL::canClose().
void LLScriptEdCore::handleSaveChangesDialog | ( | S32 | option, | |
void * | userdata | |||
) | [static] |
Definition at line 610 of file llpreviewscript.cpp.
References LLAppViewer::abortQuit(), doSave(), LLAppViewer::instance(), and TRUE.
Referenced by canClose().
void LLScriptEdCore::handleReloadFromServerDialog | ( | S32 | option, | |
void * | userdata | |||
) | [static] |
Definition at line 963 of file llpreviewscript.cpp.
References llassert.
Referenced by onBtnUndoChanges().
void LLScriptEdCore::onHelpWebDialog | ( | S32 | option, | |
void * | userdata | |||
) | [static] |
Definition at line 636 of file llpreviewscript.cpp.
References load_url_local_file(), and mHelpFile.
Referenced by onBtnHelp().
void LLScriptEdCore::onBtnHelp | ( | void * | userdata | ) | [static] |
Definition at line 651 of file llpreviewscript.cpp.
References LLViewerWindow::alertXml(), gViewerWindow, and onHelpWebDialog().
Referenced by initMenu().
void LLScriptEdCore::onBtnDynamicHelp | ( | void * | userdata | ) | [static] |
Definition at line 659 of file llpreviewscript.cpp.
References LLComboBox::add(), LLUICtrlFactory::buildFloater(), LLPanel::childSetAction(), LLPanel::childSetCommitCallback(), LLPanel::childSetValue(), LLHandle< T >::get(), LLControlGroup::getBOOL(), LLView::getChild(), LLFloater::getHandle(), LLSingleton< LLUICtrlFactory >::getInstance(), LLView::getParent(), gSavedSettings, LLTextEditor::keywordsBegin(), LLTextEditor::keywordsEnd(), mEditor, mLastHelpToken, mLiveHelpHandle, mLiveHelpHistorySize, NULL, onCheckLock(), onClickBack(), onClickForward(), onHelpComboCommit(), LLWebBrowserCtrl::setAlwaysRefresh(), LLFloater::setFocus(), LLComboBox::sortByName(), TRUE, updateDynamicHelp(), and wstring_to_utf8str().
Referenced by initMenu().
void LLScriptEdCore::onCheckLock | ( | LLUICtrl * | ctrl, | |
void * | userdata | |||
) | [static] |
Definition at line 734 of file llpreviewscript.cpp.
References LLSD::asBoolean(), LLUICtrl::getValue(), gSavedSettings, mLastHelpToken, NULL, and LLControlGroup::setBOOL().
Referenced by onBtnDynamicHelp().
void LLScriptEdCore::onHelpComboCommit | ( | LLUICtrl * | ctrl, | |
void * | userdata | |||
) | [static] |
Definition at line 756 of file llpreviewscript.cpp.
References addHelpItemToHistory(), LLSD::asString(), gDirUtilp, LLHandle< T >::get(), LLView::getChild(), LLControlGroup::getString(), LLUICtrl::getValue(), LLDir::getWorkingDir(), gSavedSettings, mLiveHelpHandle, and LLWebBrowserCtrl::navigateTo().
Referenced by onBtnDynamicHelp().
void LLScriptEdCore::onClickBack | ( | void * | userdata | ) | [static] |
Definition at line 704 of file llpreviewscript.cpp.
References LLHandle< T >::get(), LLView::getChild(), mLiveHelpHandle, and LLWebBrowserCtrl::navigateBack().
Referenced by onBtnDynamicHelp().
void LLScriptEdCore::onClickForward | ( | void * | userdata | ) | [static] |
Definition at line 719 of file llpreviewscript.cpp.
References LLHandle< T >::get(), LLView::getChild(), mLiveHelpHandle, and LLWebBrowserCtrl::navigateForward().
Referenced by onBtnDynamicHelp().
void LLScriptEdCore::onBtnInsertSample | ( | void * | userdata | ) | [static] |
Definition at line 745 of file llpreviewscript.cpp.
void LLScriptEdCore::onBtnInsertFunction | ( | LLUICtrl * | ui, | |
void * | userdata | |||
) | [static] |
void LLScriptEdCore::doSave | ( | void * | userdata, | |
BOOL | close_after_save | |||
) | [static] |
Definition at line 790 of file llpreviewscript.cpp.
References LLSingleton< LLViewerStats >::getInstance(), LLViewerStats::incStat(), and LLViewerStats::ST_LSL_SAVE_COUNT.
Referenced by handleSaveChangesDialog(), and onBtnSave().
void LLScriptEdCore::onBtnSave | ( | void * | data | ) | [static] |
Definition at line 803 of file llpreviewscript.cpp.
References doSave(), and FALSE.
Referenced by initMenu().
void LLScriptEdCore::onBtnUndoChanges | ( | void * | userdata | ) | [static] |
Definition at line 810 of file llpreviewscript.cpp.
References LLViewerWindow::alertXml(), gViewerWindow, and handleReloadFromServerDialog().
Referenced by initMenu().
void LLScriptEdCore::onSearchMenu | ( | void * | userdata | ) | [static] |
Definition at line 820 of file llpreviewscript.cpp.
References LLFloaterScriptSearch::show().
Referenced by initMenu().
void LLScriptEdCore::onUndoMenu | ( | void * | userdata | ) | [static] |
Definition at line 827 of file llpreviewscript.cpp.
Referenced by initMenu().
void LLScriptEdCore::onRedoMenu | ( | void * | userdata | ) | [static] |
Definition at line 835 of file llpreviewscript.cpp.
Referenced by initMenu().
void LLScriptEdCore::onCutMenu | ( | void * | userdata | ) | [static] |
Definition at line 843 of file llpreviewscript.cpp.
Referenced by initMenu().
void LLScriptEdCore::onCopyMenu | ( | void * | userdata | ) | [static] |
Definition at line 851 of file llpreviewscript.cpp.
Referenced by initMenu().
void LLScriptEdCore::onPasteMenu | ( | void * | userdata | ) | [static] |
Definition at line 859 of file llpreviewscript.cpp.
Referenced by initMenu().
void LLScriptEdCore::onSelectAllMenu | ( | void * | userdata | ) | [static] |
Definition at line 867 of file llpreviewscript.cpp.
Referenced by initMenu().
void LLScriptEdCore::onDeselectMenu | ( | void * | userdata | ) | [static] |
Definition at line 875 of file llpreviewscript.cpp.
BOOL LLScriptEdCore::enableUndoMenu | ( | void * | userdata | ) | [static] |
Definition at line 883 of file llpreviewscript.cpp.
References FALSE.
Referenced by initMenu().
BOOL LLScriptEdCore::enableRedoMenu | ( | void * | userdata | ) | [static] |
Definition at line 891 of file llpreviewscript.cpp.
References FALSE.
Referenced by initMenu().
BOOL LLScriptEdCore::enableCutMenu | ( | void * | userdata | ) | [static] |
Definition at line 899 of file llpreviewscript.cpp.
References FALSE.
Referenced by initMenu().
BOOL LLScriptEdCore::enableCopyMenu | ( | void * | userdata | ) | [static] |
Definition at line 907 of file llpreviewscript.cpp.
References FALSE.
Referenced by initMenu().
BOOL LLScriptEdCore::enablePasteMenu | ( | void * | userdata | ) | [static] |
Definition at line 915 of file llpreviewscript.cpp.
References FALSE.
Referenced by initMenu().
BOOL LLScriptEdCore::enableSelectAllMenu | ( | void * | userdata | ) | [static] |
Definition at line 923 of file llpreviewscript.cpp.
References FALSE.
Referenced by initMenu().
BOOL LLScriptEdCore::enableDeselectMenu | ( | void * | userdata | ) | [static] |
BOOL LLScriptEdCore::hasChanged | ( | void * | userdata | ) | [static] |
Definition at line 437 of file llpreviewscript.cpp.
References FALSE.
Referenced by initMenu().
void LLScriptEdCore::selectFirstError | ( | ) |
Definition at line 985 of file llpreviewscript.cpp.
References mErrorList, onErrorList(), and LLScrollListCtrl::selectFirstItem().
Referenced by LLLiveLSLEditor::callbackLSLCompileFailed(), LLPreviewLSL::callbackLSLCompileFailed(), LLLiveLSLEditor::uploadAssetLegacy(), and LLPreviewLSL::uploadAssetLegacy().
Reimplemented from LLPanel.
Definition at line 1015 of file llpreviewscript.cpp.
References FALSE, MASK_CONTROL, MASK_MODIFIERS, mSaveCallback, mSearchReplaceCallback, mUserdata, and TRUE.
void LLScriptEdCore::deleteBridges | ( | ) | [protected] |
Definition at line 1001 of file llpreviewscript.cpp.
References LLDynamicArray< Type, BlockSize >::count(), LLDynamicArray< Type, BlockSize >::get(), i, mBridges, NULL, LLDynamicArray< Type, BlockSize >::reset(), and S32.
Referenced by ~LLScriptEdCore().
void LLScriptEdCore::setHelpPage | ( | const LLString & | help_string | ) | [protected] |
Definition at line 531 of file llpreviewscript.cpp.
References addHelpItemToHistory(), gDirUtilp, LLHandle< T >::get(), LLView::getChild(), LLControlGroup::getString(), LLDir::getWorkingDir(), gSavedSettings, mLiveHelpHandle, LLWebBrowserCtrl::navigateTo(), and LLUIString::setArg().
Referenced by updateDynamicHelp().
void LLScriptEdCore::updateDynamicHelp | ( | BOOL | immediate = FALSE |
) | [protected] |
Definition at line 469 of file llpreviewscript.cpp.
References LLHandle< T >::get(), LLControlGroup::getBOOL(), LLView::getChild(), LLFrameTimer::getElapsedTimeF32(), LLTextSegment::getEnd(), LLTextEditor::getPreviousSegment(), LLTextEditor::getSelectedSegments(), LLTextSegment::getStart(), LLFrameTimer::getStarted(), LLTextEditor::getText(), LLTextSegment::getToken(), LLKeywordToken::getType(), gSavedSettings, LIVE_HELP_REFRESH_TIME, mEditor, mLastHelpToken, mLiveHelpHandle, mLiveHelpTimer, NULL, LLView::setEnabled(), setHelpPage(), LLFrameTimer::start(), LLFrameTimer::stop(), and LLKeywordToken::WORD.
Referenced by draw(), and onBtnDynamicHelp().
void LLScriptEdCore::addHelpItemToHistory | ( | const LLString & | help_string | ) | [protected] |
Definition at line 552 of file llpreviewscript.cpp.
References LLComboBox::add(), ADD_TOP, LLComboBox::addElement(), LLHandle< T >::get(), LLView::getChild(), LLComboBox::getCurrentIndex(), MAX_HISTORY_COUNT, mLiveHelpHandle, mLiveHelpHistorySize, LLComboBox::remove(), S32, LLComboBox::selectFirstItem(), and LLComboBox::setSimple().
Referenced by onHelpComboCommit(), and setHelpPage().
void LLScriptEdCore::onErrorList | ( | LLUICtrl * | , | |
void * | user_data | |||
) | [static, protected] |
Definition at line 939 of file llpreviewscript.cpp.
References LLSD::asString(), LLScrollListItem::getColumn(), LLScrollListCell::getValue(), LLStringBase< char >::replaceChar(), S32, and TRUE.
Referenced by selectFirstError().
virtual const char* LLScriptEdCore::getTitleName | ( | ) | const [inline, protected, virtual] |
Definition at line 130 of file llpreviewscript.h.
friend class LLPreviewScript [friend] |
Definition at line 58 of file llpreviewscript.h.
friend class LLPreviewLSL [friend] |
Definition at line 59 of file llpreviewscript.h.
friend class LLLiveLSLEditor [friend] |
Definition at line 60 of file llpreviewscript.h.
friend class LLFloaterScriptSearch [friend] |
Definition at line 61 of file llpreviewscript.h.
LLString LLScriptEdCore::mSampleText [private] |
Definition at line 133 of file llpreviewscript.h.
std::string LLScriptEdCore::mHelpFile [private] |
LLTextEditor* LLScriptEdCore::mEditor [private] |
Definition at line 135 of file llpreviewscript.h.
Referenced by canClose(), draw(), LLFloaterScriptSearch::handleBtnReplace(), LLFloaterScriptSearch::handleBtnReplaceAll(), LLFloaterScriptSearch::handleBtnSearch(), LLLiveLSLEditor::LLLiveLSLEditor(), LLLiveLSLEditor::loadAsset(), LLPreviewLSL::loadAsset(), LLLiveLSLEditor::loadScriptText(), onBtnDynamicHelp(), LLPreviewLSL::onLoadComplete(), LLLiveLSLEditor::saveIfNeeded(), LLPreviewLSL::saveIfNeeded(), and updateDynamicHelp().
void(* LLScriptEdCore::mLoadCallback)(void *userdata) [private] |
void(* LLScriptEdCore::mSaveCallback)(void *userdata, BOOL close_after_save) [private] |
Referenced by handleKeyHere().
void(* LLScriptEdCore::mSearchReplaceCallback)(void *userdata) [private] |
Referenced by handleKeyHere().
void* LLScriptEdCore::mUserdata [private] |
LLComboBox* LLScriptEdCore::mFunctions [private] |
BOOL LLScriptEdCore::mForceClose [private] |
LLPanel* LLScriptEdCore::mCodePanel [private] |
Definition at line 143 of file llpreviewscript.h.
LLScrollListCtrl* LLScriptEdCore::mErrorList [private] |
Definition at line 144 of file llpreviewscript.h.
Referenced by LLLiveLSLEditor::callbackLSLCompileFailed(), LLPreviewLSL::callbackLSLCompileFailed(), LLLiveLSLEditor::callbackLSLCompileSucceeded(), LLPreviewLSL::callbackLSLCompileSucceeded(), LLLiveLSLEditor::onSaveBytecodeComplete(), LLLiveLSLEditor::saveIfNeeded(), LLPreviewLSL::saveIfNeeded(), selectFirstError(), LLLiveLSLEditor::uploadAssetLegacy(), and LLPreviewLSL::uploadAssetLegacy().
LLDynamicArray<LLEntryAndEdCore*> LLScriptEdCore::mBridges [private] |
LLHandle<LLFloater> LLScriptEdCore::mLiveHelpHandle [private] |
Definition at line 146 of file llpreviewscript.h.
Referenced by addHelpItemToHistory(), onBtnDynamicHelp(), onClickBack(), onClickForward(), onHelpComboCommit(), setHelpPage(), and updateDynamicHelp().
LLKeywordToken* LLScriptEdCore::mLastHelpToken [private] |
Definition at line 147 of file llpreviewscript.h.
Referenced by onBtnDynamicHelp(), onCheckLock(), and updateDynamicHelp().
LLFrameTimer LLScriptEdCore::mLiveHelpTimer [private] |
S32 LLScriptEdCore::mLiveHelpHistorySize [private] |
Definition at line 149 of file llpreviewscript.h.
Referenced by addHelpItemToHistory(), and onBtnDynamicHelp().