Ejemplo n.º 1
0
// ObjectPluginHighlight Interface
void
dmz::ObjectPluginHighlight::_init (Config &local) {

   _highlightAttr = activate_object_attribute (
      ObjectAttributeHighlightName,
      ObjectFlagMask);

   _convert.set_handle (
      config_to_string ("data-convert-handle.name", local, "handle"),
      get_plugin_runtime_context ());

   _mouseMoveMsg = config_create_message (
      "mouse-move-message.name",
      local,
      "Mouse_Move_Message",
      get_plugin_runtime_context ());

   _deactivateMsg = config_create_message (
      "deactivate-message.name",
      local,
      "Object_Highlight_Deactivate_Message",
      get_plugin_runtime_context ());

   subscribe_to_message (_mouseMoveMsg);
   subscribe_to_message (_deactivateMsg);
}
Ejemplo n.º 2
0
void
dmz::QtPluginIconPalletTool::_init (Config &local) {

   RuntimeContext *context (get_plugin_runtime_context ());

   _showMsg = config_create_message (
      "show.name",
      local,
      "DMZ_Show_Icon_Pallet_Tool",
      context);

   subscribe_to_message (_showMsg);

   _useSession = config_to_boolean ("use-session.value", local, _useSession);

   if (_useSession && context) {

      Config session (get_session_config (get_plugin_name (), context));

      QByteArray geometry (config_to_qbytearray ("geometry", session, saveGeometry ()));
      restoreGeometry (geometry);

      if (config_to_boolean ("window.visible", session, False)) { show (); }
   }

   _ui.iconView->setModel (&_model);

   _add_type (Definitions (context).get_root_object_type ());
}
Ejemplo n.º 3
0
void
dmz::PluginUndo::_init (Config &local) {

   RuntimeContext *context (get_plugin_runtime_context ());

   _undoMessage = config_create_message (
      "undo.name",
      local,
      "Plugin_Undo_Message",
      context);

   _redoMessage = config_create_message (
      "redo.name",
      local,
      "Plugin_Redo_Message",
      context);

   subscribe_to_message (_undoMessage);
   subscribe_to_message (_redoMessage);
}
void
dmz::ForgePluginScreenCaptureMulti::_init (Config &local) {

   RuntimeContext *context = get_plugin_runtime_context ();

   Definitions defs (context, &_log);

   _defaultAttrHandle = defs.create_named_handle (ObjectAttributeDefaultName);

   _attachMsg = config_create_message (
      "attach-message.name",
      local,
      "DMZ_Entity_Attach_Message",
      context);

   subscribe_to_message (_attachMsg);

   _startCaptureMsg = config_create_message (
      "start-screen-capture-message.name",
      local,
      "Start_Screen_Capture_Message",
      context);

   subscribe_to_message (_startCaptureMsg);

   _doCaptureMsg = config_create_message (
      "screen-capture-message.name",
      local,
      "Capture_Render_Screen_Message",
      context);

   _finishedCaptureMsg = config_create_message (
      "finished-screen-capture-message.name",
      local,
      "Finished_Screen_Capture_Message",
      context);

   _maxFiles = config_to_int32 ("max-files.value", local, _maxFiles);
   _maxLength = String::number (_maxFiles).get_length ();
}
Ejemplo n.º 5
0
void
dmz::EntityPluginDetach::_init (Config &local) {

   _attachMsg = config_create_message (
      "attach-message.name",
      local,
      EntityMessageAttachName,
      get_plugin_runtime_context ());

   subscribe_to_message (_attachMsg);

   activate_default_object_attribute (ObjectDestroyMask);
}
Ejemplo n.º 6
0
// ObjectPluginSelect Interface
void
dmz::ObjectPluginSelect::_init (Config &local) {

   _selectMsg = config_create_message (
      "select-message.name",
      local,
      "Object_Select_Message",
      get_plugin_runtime_context ());

   subscribe_to_message (_selectMsg);

   _convert.set_handle (
      config_to_string ("data-convert-handle.name", local, "handle"),
      get_plugin_runtime_context ());

   _key = config_to_key_value ("add-to-selection-key.name", local, KeyShift, &_log);

   init_input_channels (local, InputEventKeyMask, &_log);
}
//! \cond
dmz::NetModuleIdentityMapBasic::NetModuleIdentityMapBasic (
      const PluginInfo &Info,
      Config &local) :
      Plugin (Info),
      NetModuleIdentityMap (Info),
      MessageObserver (Info),
      _log (Info),
      _site (0),
      _host (0),
      _netHandles (1001, 1, 0xFFFF),
      _handleConverter (Info.get_context ()) {

   _init (local);

   Definitions defs (Info, &_log);

   if (defs.create_message (ObjectDestroyMessageName, _removeObjMsg)) {

      subscribe_to_message (_removeObjMsg);
   }
}
Ejemplo n.º 8
0
   State (PluginInfo &theInfo, Log *theLog) :
         Plugin (theInfo),
         RuntimeModule (theInfo),
         MessageObserver (theInfo),
         observerContext (0),
         convert (theInfo),
         info (theInfo),
         discovered (False),
         started (False),
         levelsHead (0),
         levelsTail (0),
         maxLevel (1),
         log (theLog) {

      externTable.store (get_plugin_handle (), this);

      RuntimeContext *rt = info.get_context ();

      if (rt) {

         observerContext = rt->get_plugin_observer_context ();

         Definitions defs (rt);

         Message msg;

         defs.create_message (PluginObserverActivateMessageName, msg);

         subscribe_to_message (msg);
      }

      if (observerContext) {

         observerContext->ref ();
         observerContext->moduleTable.store (info.get_handle (), this);
      }
   }