Message


LXiCM_ACT_ERROR

The “common” message table contains a set of translatable strings that have consistent uses throughout the application. The codes are all old-style numeric, defined here.

  • LXiCM_ACT_WARNING

  • LXiCM_ACT_OK

  • LXiCM_ACT_CANCEL

  • LXiCM_ACT_YES

  • LXiCM_ACT_NO

  • LXiCM_ACT_DONE

  • LXiCM_ACT_YESALL

  • LXiCM_ACT_RENAME

  • LXiCM_ACT_ADD

  • LXiCM_ACT_DELETE

  • LXiCM_ACT_CLEAR

  • LXiCM_ACT_SAVE

  • LXiCM_ACT_NOSAVE

  • LXiCM_ACT_LOAD

  • LXiCM_ACT_CLOSE

  • LXiCM_ACT_CONTINUE

  • LXiCM_SPC_NONE

  • LXiCM_SPC_UNNAMED

  • LXiCM_SPC_MIXED

  • LXiCM_ACT_INFO

  • LXiCM_ACT_QUIT

  • LXiCM_ACT_NAME

  • LXiCM_ACT_TYPE

  • LXiCM_ACT_PROJ

  • LXiCM_ACT_AXIS

  • LXiCM_SPC_UNKNOWN

  • LXiCM_ACT_COPY

  • LXiCM_ACT_CUT

  • LXiCM_ACT_PASTE

  • LXiCM_SPC_NEW

  • LXiCM_ACT_NEW

  • LXiCM_ACT_VOID

  • LXiCM_SPC_VOID

  • LXiCM_ACT_ALL

  • LXiCM_SPC_ALL

  • LXiCM_ACT_EXPORT

  • LXiCM_ACT_PROPS

  • LXiCM_ACT_HELP

  • LXiCM_ACT_FUTURE

  • LXiCM_ACT_SHOWM

  • LXiCM_ACT_HIDE

  • LXiCM_SPC_UNTITLE

  • LXiCM_ACT_REPLACE

  • LXiCM_ACT_RELOAD

  • LXiCM_ACT_DUPLICATE

  • LXiCM_SPC_PRIVATE

  • LXiCM_SPC_PLUGINS

  • LXiCM_SPC_ALLFILES

  • LXiCM_SPC_ALLFORMATS

  • LXiCM_ACT_SAVEAS

  • LXiCM_ACT_BAKE

  • LXiCM_ACT_INSTANCE

  • LXiCM_SPC_DEFAULT

  • LXiCM_ACT_LOADIMAGE

  • LXiCM_ACT_NOALL

  • LXiCM_ACT_NEWIMAGE

  • LXiCM_ACT_LOADSEQ

  • LXiCM_ACT_NEWSEQ

  • LXiCM_ACT_DEFORM

  • LXiCM_ACT_CHOOSECOLOR

  • LXiCM_ACT_ADDMAP

  • LXiCM_ACT_EMPTY_PAREN

  • LXiCM_ACT_MOVE

  • LXiCM_ACT_PERFORMDROP

  • LXiCM_ACT_CREATEPRESET

  • LXiCM_ACT_CANCELDROP

  • LXiCM_ACT_GRADIENT_PAREN

  • LXiCM_ACT_MATRIX4_PAREN

  • LXiCM_ACT_MESH_PAREN

ILxMessageService

class ILxMessageService

MessageService provides access to message tables, which contain localized human-readable versions of internal strings used within the application. All strings presented to the user should come from messagte tables.

Public Functions

LxResult ScriptQuery(LXtObjectID self, void **ppvObj)

As usual, the service starts with a ScriptQuery method.

LxResult Allocate(LXtObjectID self, void **ppvObj)

This allocate a new ILxMessage object. This object can then be populated with a message code and message table entry.

LxResult Duplicate(LXtObjectID self, LXtObjectID msg, void **ppvObj)

An existing ILxMessage object can be duplicated with this method.

LxResult MessageText(LXtObjectID self, LXtObjectID msg, char *buf, unsigned len)

This return a human-readable string from the given message object. This fails if there is no message text, but will also set the buffer to an empty string. Note that messages returned in this way will not have any rich text encodings from modo markup in them. If you want the encodings, see MessageTextRich().

LxResult RawText(LXtObjectID self, const char *table, const char *msg, const char **text)

Finally it’s possible to get the raw message pattern directly from the message table, without substitution and without using an ILxMessage object. If ‘table’ is null, the message text will be decoded using the ‘@table@msg@’ format. Note that messages returned in this way will not have any rich text encodings from modo markup in them. If you want the encodings, see RawTextRich().

LxResult ArgTypeUserName(LXtObjectID self, const char *argType, char *buf, unsigned len)

These methods return the username and description of a given argument type.

LxResult ArgTypeDesc(LXtObjectID self, const char *argType, char *buf, unsigned len)
LxResult ArgTypeOptionUserName(LXtObjectID self, const char *argType, const char *option, char *buf, unsigned len)

These get a specific user string given an internal option name and an argument type name.

LxResult ArgTypeOptionDesc(LXtObjectID self, const char *argType, const char *option, char *buf, unsigned len)
LxResult MessageTextRich(LXtObjectID self, LXtObjectID msg, char *buf, unsigned len)

For backwards compatibility, message strings have any modo markup removed before they are returned. This makes them suitable for use in non-modo UIs, like web pages or Qt widgets. These functions return the string without stripping the decoded markup, allowing them to be displayed as rich text in modo.

LxResult RawTextRich(LXtObjectID self, const char *table, const char *msg, const char **text)
LxResult StripRichText(LXtObjectID self, const char *string, const char **stripped)

If you do have a srting with rich text codes in it, they can be stripped with this function. The string returned should be considered volatile, and used or copied as soon as possible.

LxResult StringLookup(LXtObjectID self, const char *table, const char *ident, const char **text)

Strings tables are like message tables, but aren’t localized. They can be useful if you want to store an internal string in a config so that ti can be easily changed. This looks up a string given a table/ident pair and returns it.

bool NewMessage(CLxLoc_Message &msg)

User Class Only:

bool DuplicateMessage(CLxLoc_Message &msg, CLxLoc_Message &source)

User Class Only:

LxResult GetText(CLxLoc_Message &msg, char *buf, unsigned len)

User Class Only:

LxResult GetText(CLxLoc_Message &msg, std::string &text)
std::string ResultMessage(LxResult rc)

User Class Only: The special message table for result codes can be accessed using LxResutl values as keys.

class Tmp_Sgs

User Class Only: This is a safe string “get” using a dummy class to act as callback for the safe string “read” template.

Public Functions

LxResult sgs_GetString(char *buf, unsigned int len)

Public Members

CLxLoc_MessageService *srv
ILxUnknownID msg

ILxMessageService::Tmp_Sgs

class Tmp_Sgs

User Class Only: This is a safe string “get” using a dummy class to act as callback for the safe string “read” template.

Public Functions

LxResult sgs_GetString(char *buf, unsigned int len)

Public Members

CLxLoc_MessageService *srv
ILxUnknownID msg

ILxAutoSaveListener

class ILxAutoSaveListener

Auto-saving is triggered periodically based on user preferences, modified by when the system believes an autosave is safe to perform. Other clients can get in on this by listening to the auto-save event port. There is only one event, AutoSaveNow(), at which point the client can safely perform an auto-save if applicable. This event is sent after the nexus has done its own auto-saving.

Public Functions

LxResult AutoSaveNow(LXtObjectID self)