Skip to content

Commit de1b033

Browse files
committed
[[ CefLinux ]] Add linux build files for revbrowser and supporting external functions
1 parent c07efd4 commit de1b033

File tree

17 files changed

+694
-2
lines changed

17 files changed

+694
-2
lines changed

Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,23 @@ server-revzip: libzip libz libexternal
181181
revandroid: libexternalv1
182182
$(MAKE) -C ./revmobile revandroid
183183

184+
###############################################################################
185+
# revBrowser Targets
186+
187+
.PHONY: revbrowser libcef libcefwrapper revbrowser-cefprocess
188+
189+
libcef:
190+
$(MAKE) -C ./thirdparty/libcef libcef
191+
192+
libcefwrapper:
193+
$(MAKE) -C ./thirdparty/libcef libcefwrapper
194+
195+
revbrowser-cefprocess: libcef libcefwrapper
196+
$(MAKE) -C ./revbrowser revbrowser-cefprocess
197+
198+
revbrowser: libcore libexternal libcef libcefwrapper libexternalv1 revbrowser-cefprocess
199+
$(MAKE) -C ./revbrowser revbrowser
200+
184201
###############################################################################
185202
# MLC Targets
186203

@@ -223,6 +240,7 @@ all: revdb dbodbc dbsqlite dbmysql dbpostgresql
223240
all: server-revdb server-dbodbc server-dbsqlite server-dbmysql server-dbpostgresql
224241
all: development standalone installer server
225242
all: revpdfprinter revandroid
243+
all: revbrowser
226244
all: lc-test
227245

228246
bootstrap: lc-bootstrap-compile

engine/src/externalv0.cpp

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ extern MCExecContext *MCECptr;
6262

6363
// IM-2014-03-06: [[ revBrowserCEF ]] Add revision number to v0 external interface
6464
// SN-2014-07-08: [[ UnicodeExternalsV0 ]] Bump revision number after unicode update
65-
#define EXTERNAL_INTERFACE_VERSION 2
65+
#define EXTERNAL_INTERFACE_VERSION 3
6666

6767
typedef struct _Xternal
6868
{
@@ -1677,6 +1677,26 @@ static char *window_to_stack_rect(const char *arg1, const char *arg2,
16771677
return nil;
16781678
}
16791679

1680+
static char *get_display_handle(const char *arg1, const char *arg2, const char *arg3, int *retval)
1681+
{
1682+
void *t_display;
1683+
t_display = nil;
1684+
1685+
if (!MCscreen->platform_get_display_handle(t_display))
1686+
{
1687+
*retval = xresFail;
1688+
return nil;
1689+
}
1690+
1691+
void **t_return;
1692+
t_return = (void**)arg3;
1693+
1694+
*t_return = t_display;
1695+
*retval = xresSucc;
1696+
1697+
return nil;
1698+
}
1699+
16801700
// IM-2014-03-06: [[ revBrowserCEF ]] Add externals extension to the callback list
16811701
// SN-2014-07-08: [[ UnicodeExternalsV0 ]] Add externals extension to handle UTF8-encoded parameters
16821702
XCB MCcbs[] =
@@ -1740,6 +1760,8 @@ XCB MCcbs[] =
17401760
get_array_utf8_binary,
17411761
set_array_utf8_text,
17421762
set_array_utf8_binary,
1763+
1764+
get_display_handle,
17431765

17441766
NULL
17451767
};

engine/src/lnxdc.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,13 @@ MCRectangle MCScreenDC::screentologicalrect(const MCRectangle &p_rect)
429429
return p_rect;
430430
}
431431

432+
bool MCScreenDC::platform_get_display_handle(void *&r_display)
433+
{
434+
r_display = x11::gdk_x11_display_get_xdisplay(getDisplay());
435+
436+
return true;
437+
}
438+
432439
////////////////////////////////////////////////////////////////////////////////
433440

434441
void MCResPlatformInitPixelScaling(void)

engine/src/lnxdc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,8 @@ class MCScreenDC : public MCUIDC
259259
virtual void platform_querymouse(int16_t &r_x, int16_t &r_y);
260260
virtual void platform_setmouse(int16_t p_x, int16_t p_y);
261261

262+
virtual bool platform_get_display_handle(void *&r_display);
263+
262264
// IM-2014-01-29: [[ HiDPI ]] Convenience methods to convert logical to screen coords and back
263265
MCPoint logicaltoscreenpoint(const MCPoint &p_point);
264266
MCPoint screentologicalpoint(const MCPoint &p_point);

engine/src/uidc.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1905,3 +1905,14 @@ void MCUIDC::hidecursoruntilmousemoves(void)
19051905
// Default action is to do nothing - Mac overrides and performs the
19061906
// appropriate function.
19071907
}
1908+
1909+
////////////////////////////////////////////////////////////////////////////////
1910+
1911+
bool MCUIDC::platform_get_display_handle(void *&r_display)
1912+
{
1913+
return nil;
1914+
}
1915+
1916+
////////////////////////////////////////////////////////////////////////////////
1917+
1918+

engine/src/uidc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,8 @@ class MCUIDC
384384

385385
virtual MCStack *platform_getstackatpoint(int32_t x, int32_t y);
386386

387+
virtual bool platform_get_display_handle(void *&r_display);
388+
387389
////////////////////////////////////////////////////////////////////////////////
388390

389391
// IM-2013-09-30: [[ FullscreenMode ]] Returns true if windows on this display are

libexternal/include/revolution/external.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,10 @@ extern Bool SecurityCanAccessFileUTF8(const char *p_file);
506506
extern Bool SecurityCanAccessHostUTF8(const char *p_host);
507507
extern Bool SecurityCanAccessLibraryUTF8(const char *p_library);
508508

509+
// IM-2014-09-23: [[ RevBrowserCEF ]] Retrieve the Xserver connection info
510+
extern void GetXDisplayHandle(void **r_display, int *r_success);
511+
extern void GetXScreenHandle(void **r_screen, int *r_success);
512+
509513
#ifdef __cplusplus
510514
};
511515
#endif

libexternal/src/external.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ enum
6969
/* V2 */ OPERATION_GET_ARRAY_UTF8_BINARY,
7070
/* V2 */ OPERATION_SET_ARRAY_UTF8_TEXT,
7171
/* V2 */ OPERATION_SET_ARRAY_UTF8_BINARY,
72+
73+
/* V3 */ OPERATION_GET_XDISPLAY_HANDLE,
7274
};
7375

7476
enum
@@ -800,6 +802,25 @@ Bool SecurityCanAccessLibraryUTF8(const char *p_library)
800802
return True;
801803
}
802804

805+
////////////////////////////////////////////////////////////////////////////////
806+
//
807+
// IM-2014-09-23: [[ RevBrowserCEF ]] External V3 functions
808+
809+
extern void GetXDisplayHandle(void **r_display, int *r_success)
810+
{
811+
char *t_result;
812+
813+
if (s_external_interface_version < 3)
814+
{
815+
*r_success = EXTERNAL_FAILURE;
816+
return;
817+
}
818+
819+
t_result = (s_operations[OPERATION_GET_XDISPLAY_HANDLE])(NULL, NULL, r_display, r_success);
820+
if (t_result != NULL)
821+
s_delete(t_result);
822+
}
823+
803824
////////////////////////////////////////////////////////////////////////////////
804825

805826
#ifdef TARGET_SUBPLATFORM_IPHONE

revbrowser/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
revbrowser-cefprocess:
2+
$(MAKE) -f Makefile.revbrowser-cefprocess revbrowser-cefprocess
3+
4+
revbrowser:
5+
$(MAKE) -f Makefile.revbrowser revbrowser

revbrowser/Makefile.revbrowser

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
NAME=revbrowser
2+
TYPE=library
3+
4+
include ../rules/environment.linux.makefile
5+
6+
SOURCES=revbrowser.cpp lnxbrowser.cpp cefbrowser.cpp cefbrowser_lnx.cpp cefshared_lnx.cpp signal_restore_posix.cpp
7+
8+
CUSTOM_DEFINES=
9+
10+
CUSTOM_INCLUDES=./src ../libcore/include ../thirdparty/libcef ../libexternal/include/revolution
11+
12+
CUSTOM_LIBS=core external cefwrapper cef
13+
CUSTOM_DYNAMIC_LIBS=dl X11
14+
15+
CUSTOM_CCFLAGS=
16+
17+
CUSTOM_LDFLAGS=
18+
19+
include ../rules/library.linux.makefile

0 commit comments

Comments
 (0)