Пример #1
0
Error initialize()
{
   using boost::bind;
   using namespace module_context;

   ExecBlock initBlock;
   initBlock.addFunctions()
      (bind(registerAsyncRpcMethod, "check_for_updates", checkForUpdates))
   ;
   return initBlock.execute();
}
Пример #2
0
core::Error initData()
{
    RS_REGISTER_CALL_METHOD(rs_recordData, 2);

    ExecBlock initBlock;
    initBlock.addFunctions()
    (boost::bind(module_context::sourceModuleRFile, "NotebookData.R"))
    (boost::bind(module_context::registerUriHandler, kNotebookDataResourceLocation, handleNotebookDataResReq));

    return initBlock.execute();
}
Пример #3
0
Error initialize()
{
   using boost::bind;
   using namespace session::module_context;
   ExecBlock initBlock ;
   initBlock.addFunctions()
      (data::viewer::initialize)
      (bind(sourceModuleRFile, "SessionDataImport.R"))
      (bind(sourceModuleRFile, "SessionDataImportV2.R"));

   return initBlock.execute();
}
Пример #4
0
Error initialize()
{
   // install rpc methods
   using boost::bind;
   using namespace module_context;
   ExecBlock initBlock ;
   initBlock.addFunctions()
      (bind(registerUriHandler, "/view_pdf", handleViewPdf))
      (bind(registerUriHandler, kPdfJsPath, handlePdfJs))
   ;
   return initBlock.execute();
}
Пример #5
0
Error initialize()
{
   using boost::bind;
   using namespace module_context;
   ExecBlock initBlock ;
   initBlock.addFunctions()
      (bind(registerRpcMethod, "accept_agreement", handleAcceptAgreement))
      (bind(registerUriHandler, "/agreement", handleAgreementRequest))
   ;

   return initBlock.execute();
}
Пример #6
0
Error initialize()
{
   RS_REGISTER_CALL_METHOD(rs_fromJSON, 1);
   RS_REGISTER_CALL_METHOD(rs_isNullExternalPointer, 1);
   
   using boost::bind;
   using namespace module_context;

   ExecBlock initBlock;
   initBlock.addFunctions()
         (bind(sourceModuleRFile, "SessionRUtil.R"));
   return initBlock.execute();
}
Error initialize()
{
    // install rpc methods
    using boost::bind;
    using namespace module_context;
    ExecBlock initBlock ;
    initBlock.addFunctions()
    (bind(registerRpcMethod, "process_prepare", procInit))
    (bind(registerRpcMethod, "process_start", procStart))
    (bind(registerRpcMethod, "process_interrupt", procInterrupt));

    return initBlock.execute();
}
Пример #8
0
Error initialize()
{
   // install rpc methods
   using boost::bind;
   using namespace module_context;
   ExecBlock initBlock ;
   initBlock.addFunctions()
      (tex::compile_pdf::initialize)
      (bind(registerRpcMethod, "is_tex_installed", isTexInstalled))
      (bind(registerRpcMethod, "get_tex_capabilities", getTexCapabilities))
   ;
  return initBlock.execute();
}
Пример #9
0
Error initialize()
{  
   ExecBlock initBlock ;
   
   source_database::events().onDocPendingRemove.connect(onDocPendingRemove);

   initBlock.addFunctions()
      (boost::bind(module_context::sourceModuleRFile, "SessionProfiler.R"))
      (boost::bind(module_context::registerUriHandler, "/" kProfilesUrlPath "/", handleProfilerResReq));

   RS_REGISTER_CALL_METHOD(rs_profilesPath, 0);

   return initBlock.execute();
}
Пример #10
0
Error initialize()
{
   using namespace module_context;
   module_context::events().onClientInit.connect(boost::bind(onClientInit));

   ExecBlock initBlock ;
   initBlock.addFunctions()
      (bind(registerRpcMethod, "start_posix_shell", startPosixShell))
      (bind(registerRpcMethod, "interrupt_posix_shell", interruptPosixShell))
      (bind(registerRpcMethod, "send_input_to_posix_shell", sendInputToPosixShell))
      (bind(registerRpcMethod, "terminate_posix_shell", terminatePosixShell));
   return initBlock.execute();

}
Пример #11
0
Error initialize()
{
   // subscribe to events
   using boost::bind;
   using namespace module_context;

   ExecBlock initBlock ;
   initBlock.addFunctions()
      (bind(registerRpcMethod, "get_function_state", getFunctionState))
      (bind(registerRpcMethod, "set_function_breakpoints", setBreakpoints))
      (bind(sourceModuleRFile, "SessionBreakpoints.R"));

   return initBlock.execute();
}
Пример #12
0
core::Error initialize()
{
   using namespace module_context;
   using boost::bind;
   
   events().afterSessionInitHook.connect(afterSessionInitHook);
   events().onClientInit.connect(onClientInit);
   
   ExecBlock initBlock;
   initBlock.addFunctions()
         (bind(registerRpcMethod, "save_snippets", saveSnippets))
         (bind(registerRpcMethod, "get_snippets", getSnippets));
   
   return initBlock.execute();
}
Пример #13
0
Error initialize()
{
   // subscribe to events
   using boost::bind;
   using namespace module_context;

   events().onPackageLoaded.connect(onPackageLoaded);

   ExecBlock initBlock ;
   initBlock.addFunctions()
      (bind(registerRpcMethod, "get_function_sync_state", getFunctionSyncState))
      (bind(sourceModuleRFile, "SessionBreakpoints.R"));

   return initBlock.execute();
}
Пример #14
0
Error initialize()
{
   // subscribe to events
   using boost::bind;
   using namespace session::module_context;
   events().onDetectChanges.connect(bind(onDetectChanges, _1));

   // source R functions
   ExecBlock initBlock ;
   initBlock.addFunctions()
      (bind(registerRpcMethod, "list_environment", listEnvironment))
      (bind(sourceModuleRFile, "SessionEnvironment.R"));

   return initBlock.execute();
}
Пример #15
0
core::Error initialize()
{
   using namespace session::module_context;

   // register suspend handler
   addSuspendHandler(SuspendHandler(onSuspend, onResume));

   // install handlers
   using boost::bind;
   ExecBlock initBlock ;
   initBlock.addFunctions()
      (bind(registerRpcMethod, "begin_find", beginFind))
      (bind(registerRpcMethod, "stop_find", stopFind))
      (bind(registerRpcMethod, "clear_find_results", clearFindResults));
   return initBlock.execute();
}
Пример #16
0
Error initialize()
{
   using boost::bind;
   using namespace module_context;

   // add suspend/resume handler
   addSuspendHandler(SuspendHandler(onSuspend, onResume));

   // install rpc methods
   ExecBlock initBlock ;
   initBlock.addFunctions()
      (bind(registerRpcMethod, "process_prepare", procInit))
      (bind(registerRpcMethod, "process_start", procStart))
      (bind(registerRpcMethod, "process_interrupt", procInterrupt))
      (bind(registerRpcMethod, "process_reap", procReap));

   return initBlock.execute();
}
Пример #17
0
Error initialize()
{
   // register rs_showPresentation
   R_CallMethodDef methodDefShowPresentation;
   methodDefShowPresentation.name = "rs_showPresentation" ;
   methodDefShowPresentation.fun = (DL_FUNC) rs_showPresentation;
   methodDefShowPresentation.numArgs = 1;
   r::routines::addCallMethod(methodDefShowPresentation);

   // register rs_showPresentationHelpDoc
   R_CallMethodDef methodDefShowHelpDoc;
   methodDefShowHelpDoc.name = "rs_showPresentationHelpDoc" ;
   methodDefShowHelpDoc.fun = (DL_FUNC) rs_showPresentationHelpDoc;
   methodDefShowHelpDoc.numArgs = 1;
   r::routines::addCallMethod(methodDefShowHelpDoc);

   // initialize presentation log
   Error error = log().initialize();
   if (error)
      return error;

   using boost::bind;
   using namespace session::module_context;
   ExecBlock initBlock ;
   initBlock.addFunctions()
      (bind(registerUriHandler, "/presentation", handlePresentationPaneRequest))
      (bind(registerRpcMethod, "create_standalone_presentation", createStandalonePresentation))
      (bind(registerRpcMethod, "create_presentation_rpubs_source", createPresentationRpubsSource))
      (bind(registerRpcMethod, "set_presentation_slide_index", setPresentationSlideIndex))
      (bind(registerRpcMethod, "close_presentation_pane", closePresentationPane))
      (bind(registerRpcMethod, "presentation_execute_code", presentationExecuteCode))
      (bind(presentation::state::initialize))
      (bind(sourceModuleRFile, "SessionPresentation.R"));

   return initBlock.execute();
}
Пример #18
0
Error initialize()
{
   using boost::bind;
   using namespace module_context;

   boost::shared_ptr<int> pShinyViewerType =
         boost::make_shared<int>(SHINY_VIEWER_NONE);

   R_CallMethodDef methodDefViewer;
   methodDefViewer.name = "rs_shinyviewer";
   methodDefViewer.fun = (DL_FUNC) rs_shinyviewer;
   methodDefViewer.numArgs = 2;
   r::routines::addCallMethod(methodDefViewer);

   userSettings().onChanged.connect(bind(onUserSettingsChanged,
                                         pShinyViewerType));

   ExecBlock initBlock;
   initBlock.addFunctions()
      (bind(sourceModuleRFile, "SessionShinyViewer.R"))
      (bind(initShinyViewerPref, pShinyViewerType));

   return initBlock.execute();
}
Пример #19
0
core::Error initialize()
{
   git::initialize();
   svn::initialize();

   // http endpoints
   using boost::bind;
   using namespace module_context;
   ExecBlock initBlock ;
   initBlock.addFunctions()
      (bind(registerRpcMethod, "vcs_clone", vcsClone));
   Error error = initBlock.execute();
   if (error)
      return error;

   // If VCS is disabled, or we're not in a project, do nothing
   const projects::ProjectContext& projContext = projects::projectContext();
   FilePath workingDir = projContext.directory();

   if (!session::options().allowVcs() || !userSettings().vcsEnabled() || workingDir.empty())
      return Success();


   // If Git or SVN was explicitly specified, choose it if valid
   projects::RProjectVcsOptions vcsOptions;
   if (projContext.hasProject())
   {
      Error vcsError = projContext.readVcsOptions(&vcsOptions);
      if (vcsError)
         LOG_ERROR(vcsError);
   }

   if (vcsOptions.vcsOverride == kVcsIdNone)
   {
      return Success();
   }
   else if (vcsOptions.vcsOverride == git::kVcsId)
   {
      if (git::isGitInstalled() && git::isGitDirectory(workingDir))
         return git::initializeGit(workingDir);
      return Success();
   }
   else if (vcsOptions.vcsOverride == svn::kVcsId)
   {
      if (svn::isSvnInstalled() && svn::isSvnDirectory(workingDir))
         return svn::initializeSvn(workingDir);
      return Success();
   }

   if (git::isGitInstalled() && git::isGitDirectory(workingDir))
   {
      return git::initializeGit(workingDir);
   }
   else if (svn::isSvnInstalled() && svn::isSvnDirectory(workingDir))
   {
      return svn::initializeSvn(workingDir);
   }
   else
   {
      return Success();  // none specified or detected
   }
}