feat: preliminary linux support
This commit is contained in:
parent
725f384d91
commit
96d05571d0
22
main.cpp
22
main.cpp
|
|
@ -1,14 +1,14 @@
|
||||||
// libcef
|
|
||||||
#include "include/cef_frame_handler.h"
|
|
||||||
#include <include/base/cef_bind.h>
|
#include <include/base/cef_bind.h>
|
||||||
#include <include/wrapper/cef_closure_task.h>
|
|
||||||
#include <include/cef_base.h>
|
|
||||||
#include <include/cef_app.h>
|
#include <include/cef_app.h>
|
||||||
|
#include <include/cef_base.h>
|
||||||
#include <include/cef_browser.h>
|
#include <include/cef_browser.h>
|
||||||
#include <include/cef_client.h>
|
#include <include/cef_client.h>
|
||||||
|
#include <include/cef_frame_handler.h>
|
||||||
#include <include/cef_render_process_handler.h>
|
#include <include/cef_render_process_handler.h>
|
||||||
|
#include <include/wrapper/cef_closure_task.h>
|
||||||
|
|
||||||
class AyaCEFApp : public CefApp {
|
class AyaCEFApp : public CefApp
|
||||||
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AyaCEFApp () {};
|
AyaCEFApp () {};
|
||||||
|
|
@ -48,7 +48,8 @@ public:
|
||||||
|
|
||||||
// but this is good enough as a poc & can be used for replication
|
// but this is good enough as a poc & can be used for replication
|
||||||
// across different clients connected to a server
|
// across different clients connected to a server
|
||||||
if (name == "sendResultToCpp" && arguments.size() == 1) {
|
if (name == "sendResultToCpp" && arguments.size() == 1)
|
||||||
|
{
|
||||||
CefRefPtr<CefProcessMessage> msg = CefProcessMessage::Create("resultMessage");
|
CefRefPtr<CefProcessMessage> msg = CefProcessMessage::Create("resultMessage");
|
||||||
|
|
||||||
CefRefPtr<CefListValue> args = msg->GetArgumentList();
|
CefRefPtr<CefListValue> args = msg->GetArgumentList();
|
||||||
|
|
@ -61,6 +62,7 @@ public:
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -69,8 +71,16 @@ private:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
int CALLBACK WinMain(_In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nCmdShow)
|
int CALLBACK WinMain(_In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nCmdShow)
|
||||||
{
|
{
|
||||||
CefMainArgs args(hInstance);
|
CefMainArgs args(hInstance);
|
||||||
return CefExecuteProcess(args, new AyaSubProcess(), nullptr);
|
return CefExecuteProcess(args, new AyaSubProcess(), nullptr);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
int main(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
CefMainArgs args(argc, argv);
|
||||||
|
return CefExecuteProcess(args, new AyaSubProcess(), nullptr);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
Loading…
Reference in New Issue