Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions linden/indra/llimage/llpngwrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ void LLPngWrapper::normalizeImage()
}
if (mColorType == PNG_COLOR_TYPE_GRAY && mBitDepth < 8)
{
png_set_gray_1_2_4_to_8(mReadPngPtr);
/*png_set_gray_1_2_4_to_8(mReadPngPtr);*/
png_set_expand_gray_1_2_4_to_8(mReadPngPtr);
}
if (mColorType == PNG_COLOR_TYPE_GRAY
|| mColorType == PNG_COLOR_TYPE_GRAY_ALPHA)
Expand Down Expand Up @@ -364,7 +365,8 @@ void LLPngWrapper::releaseResources()
{
if (mReadPngPtr || mReadInfoPtr)
{
png_destroy_read_struct(&mReadPngPtr, &mReadInfoPtr, png_infopp_NULL);
png_destroy_read_struct(&mReadPngPtr, &mReadInfoPtr, NULL);
/*png_destroy_read_struct(&mReadPngPtr, &mReadInfoPtr, png_infopp_NULL);*/
mReadPngPtr = NULL;
mReadInfoPtr = NULL;
}
Expand Down
3 changes: 2 additions & 1 deletion linden/indra/llimage/llpngwrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
#ifndef LL_LLPNGWRAPPER_H
#define LL_LLPNGWRAPPER_H

#include "libpng12/png.h"
#include "libpng14/png.h"
/*#include "libpng12/png.h"*/
#include "llimage.h"

class LLPngWrapper
Expand Down
112 changes: 73 additions & 39 deletions linden/indra/llui/lllineeditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,44 +216,16 @@ LLLineEditor::LLLineEditor(const std::string& name, const LLRect& rect,

// make the popup menu available
//LLMenuGL* menu = LLUICtrlFactory::getInstance()->buildMenu("menu_texteditor.xml", parent_view);
LLMenuGL* menu = new LLMenuGL("wot");
/*if (!menu)
{
menu = new LLMenuGL(LLStringUtil::null);
}*/

menu->append(new LLMenuItemCallGL("Cut", context_cut, context_enable_cut, this));
menu->append(new LLMenuItemCallGL("Copy", context_copy, context_enable_copy, this));
menu->append(new LLMenuItemCallGL("Paste", context_paste, context_enable_paste, this));
menu->append(new LLMenuItemCallGL("Delete", context_delete, context_enable_delete, this));
menu->append(new LLMenuItemCallGL("Select All", context_selectall, context_enable_selectall, this));

menu->appendSeparator("Transep");
LLMenuGL* translatemenu = new LLMenuGL("Translate To");
translatemenu->setCanTearOff(FALSE);
translatemenu->append(new LLMenuItemCallGL("en", "English", context_translate, context_enable_translate, this));
translatemenu->append(new LLMenuItemCallGL("da", "Danish", context_translate, context_enable_translate, this));
translatemenu->append(new LLMenuItemCallGL("de", "Deutsch(German)", context_translate, context_enable_translate, this));
translatemenu->append(new LLMenuItemCallGL("es", "Spanish", context_translate, context_enable_translate, this));
translatemenu->append(new LLMenuItemCallGL("fr", "French", context_translate, context_enable_translate, this));
translatemenu->append(new LLMenuItemCallGL("it", "Italian", context_translate, context_enable_translate, this));
translatemenu->append(new LLMenuItemCallGL("hu", "Hungarian", context_translate, context_enable_translate, this));
translatemenu->append(new LLMenuItemCallGL("nl", "Dutch", context_translate, context_enable_translate, this));
translatemenu->append(new LLMenuItemCallGL("pl", "Polish", context_translate, context_enable_translate, this));
translatemenu->append(new LLMenuItemCallGL("pt", "Portugese", context_translate, context_enable_translate, this));
translatemenu->append(new LLMenuItemCallGL("ru", "Russian", context_translate, context_enable_translate, this));
translatemenu->append(new LLMenuItemCallGL("tr", "Turkish", context_translate, context_enable_translate, this));
translatemenu->append(new LLMenuItemCallGL("uk", "Ukrainian", context_translate, context_enable_translate, this));
translatemenu->append(new LLMenuItemCallGL("zh", "Chinese", context_translate, context_enable_translate, this));
translatemenu->append(new LLMenuItemCallGL("ja", "Japanese", context_translate, context_enable_translate, this));
translatemenu->append(new LLMenuItemCallGL("ko", "Korean", context_translate, context_enable_translate, this));

menu->appendMenu(translatemenu);
menu->appendSeparator("Spelsep");
//menu->setBackgroundColor(gColors.getColor("MenuPopupBgColor"));
menu->setCanTearOff(FALSE);
menu->setVisible(FALSE);
mPopupMenuHandle = menu->getHandle();
LLMenuGL* menu = LLUICtrlFactory::getInstance()->buildMenu("menu_rightclick_text.xml",this);
if (!menu)
{
menu = new LLMenuGL(LLStringUtil::null);
}

defineMenuCallbacks(menu);
mPopupMenuHandle = menu->getHandle();
menu->setBorderColor(gColors.getColor("MenuItemDisabledColor"));
menu->setBackgroundColor(gColors.getColor("MenuPopupBgColor"));
}


Expand Down Expand Up @@ -556,7 +528,7 @@ void LLLineEditor::context_translate(void * data)
{
LLLineEditor* line = (LLLineEditor*)data;
LLMenuGL* menu = line ? (LLMenuGL*)(line->mPopupMenuHandle.get()) : NULL;
LLMenuGL* translate_menu = menu ? menu->getChildMenuByName("Translate To", TRUE) : NULL;
LLMenuGL* translate_menu = menu ? menu->getChildMenuByName("Translation Options", TRUE) : NULL;
if (!translate_menu)
{
return;
Expand Down Expand Up @@ -1313,6 +1285,68 @@ BOOL LLLineEditor::canCut() const
return !mReadOnly && !mDrawAsterixes && hasSelection();
}


// method to define the associated callbacks
void LLLineEditor::defineMenuCallbacks(LLMenuGL* menu) {

menu->setCtrlResponse(LLCallbackInformation::LL_MENU_ITEM_CALL_GL_ON_ENABLE,
"Cut Text",
this,
(void*)context_enable_cut);
menu->setCtrlResponse(LLCallbackInformation::LL_MENU_ITEM_CALL_GL_ON_CLICK,
"Cut Text",
this,
(void*)context_cut);

menu->setCtrlResponse(LLCallbackInformation::LL_MENU_ITEM_CALL_GL_ON_ENABLE,
"Copy Text",
this,
(void*)context_enable_copy);
menu->setCtrlResponse(LLCallbackInformation::LL_MENU_ITEM_CALL_GL_ON_CLICK,
"Copy Text",
this,
(void*)context_copy);

menu->setCtrlResponse(LLCallbackInformation::LL_MENU_ITEM_CALL_GL_ON_ENABLE,
"Paste Text",
this,
(void*)context_enable_paste);
menu->setCtrlResponse(LLCallbackInformation::LL_MENU_ITEM_CALL_GL_ON_CLICK,
"Paste Text",
this,
(void*)context_paste);

menu->setCtrlResponse(LLCallbackInformation::LL_MENU_ITEM_CALL_GL_ON_ENABLE,
"Delete Text",
this,
(void*)context_enable_delete);
menu->setCtrlResponse(LLCallbackInformation::LL_MENU_ITEM_CALL_GL_ON_CLICK,
"Delete Text",
this,
(void*)context_delete);

menu->setCtrlResponse(LLCallbackInformation::LL_MENU_ITEM_CALL_GL_ON_ENABLE,
"Select All Text",
this,
(void*)context_enable_selectall);
menu->setCtrlResponse(1+LLCallbackInformation::LL_MENU_ITEM_CALL_GL_ON_CLICK,
"Select All Text",
this,
(void*)context_selectall);

menu->setCtrlResponse(LLCallbackInformation::LL_MENU_ITEM_CALL_GL_ON_ENABLE,
"Translate Text",
this,
(void*)context_enable_translate);
menu->setCtrlResponse(LLCallbackInformation::LL_MENU_ITEM_CALL_GL_TRANSLATE,
"Translate Text",
this,
(void*)context_translate);

}



// cut selection to clipboard
void LLLineEditor::cut()
{
Expand Down
4 changes: 3 additions & 1 deletion linden/indra/llui/lllineeditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
class LLFontGL;
class LLLineEditorRollback;
class LLButton;
class LLMenuGL;

typedef BOOL (*LLLinePrevalidateFunc)(const LLWString &wstr);

Expand Down Expand Up @@ -111,7 +112,8 @@ class LLLineEditor
virtual BOOL canTranslate() const;
virtual void insert(std::string what,S32 wher);

// LLEditMenuHandler overrides
// LLEditMenuHandler overrides and menu set up methods
void defineMenuCallbacks(LLMenuGL* menu);
virtual void cut();
virtual BOOL canCut() const;

Expand Down
Loading