Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.

Commit f30eb33

Browse files
authored
Merge pull request #571 from ficristo/client-types
Add client_types.h, match gtk gyp inclusion of cefclient
2 parents da088ef + b5144f0 commit f30eb33

5 files changed

Lines changed: 92 additions & 20 deletions

File tree

Gruntfile.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,10 @@ module.exports = function (grunt) {
158158
"Brackets",
159159
"Brackets-node",
160160
"cef.pak",
161-
"devtools_resources.pak"
161+
"cef_100_percent.pak",
162+
"cef_200_percent.pak",
163+
"devtools_resources.pak",
164+
"icudtl.dat",
162165
],
163166
"dest" : "<%= build.staging %>"
164167
},

appshell.gyp

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -315,15 +315,25 @@
315315
},
316316
'copies': [
317317
{
318-
'destination': '<(PRODUCT_DIR)/lib',
318+
'destination': '<(PRODUCT_DIR)/files',
319319
'files': [
320-
'<@(appshell_bundle_libraries_linux)',
320+
'<@(appshell_bundle_resources_linux)',
321321
],
322322
},
323323
{
324-
'destination': '<(PRODUCT_DIR)',
324+
'destination': '<(PRODUCT_DIR)/',
325325
'files': [
326-
'<@(appshell_bundle_resources_linux)'
326+
'Resources/cef.pak',
327+
'Resources/cef_100_percent.pak',
328+
'Resources/cef_200_percent.pak',
329+
'Resources/cef_extensions.pak',
330+
'Resources/devtools_resources.pak',
331+
'Resources/icudtl.dat',
332+
'Resources/locales/',
333+
'$(BUILDTYPE)/chrome-sandbox',
334+
'$(BUILDTYPE)/libcef.so',
335+
'$(BUILDTYPE)/natives_blob.bin',
336+
'$(BUILDTYPE)/snapshot_blob.bin',
327337
],
328338
},
329339
{
@@ -340,15 +350,17 @@
340350
'files': ['appshell/node-core/'],
341351
},
342352
],
353+
'dependencies': [
354+
'gtk',
355+
],
343356
'link_settings': {
344357
'ldflags': [
345-
'<!@(<(pkg-config) --libs-only-other gtk+-2.0 gthread-2.0)',
346358
'-Wl,-rpath,\$$ORIGIN/lib',
347359
'<(march)'
348360
],
349361
'libraries': [
350-
'<!@(<(pkg-config) --libs-only-l gtk+-2.0 gthread-2.0)',
351-
'$(BUILDTYPE)/libcef.so',
362+
"$(BUILDTYPE)/libcef.so",
363+
"-lX11",
352364
'appshell_extensions_js.o',
353365
],
354366
},
@@ -392,8 +404,7 @@
392404
'conditions': [
393405
['OS=="linux"', {
394406
'cflags': [
395-
'<!@(<(pkg-config) --cflags gtk+-2.0 gthread-2.0)',
396-
'<(march)',
407+
'<(march)',
397408
],
398409
'default_configuration': 'Release',
399410
'configurations': {
@@ -504,6 +515,32 @@
504515
}, # target appshell_helper_app
505516
],
506517
}], # OS=="mac"
518+
[ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
519+
'targets': [
520+
{
521+
'target_name': 'gtk',
522+
'type': 'none',
523+
'variables': {
524+
# gtk requires gmodule, but it does not list it as a dependency
525+
# in some misconfigured systems.
526+
'gtk_packages': 'gmodule-2.0 gtk+-2.0 gthread-2.0 gtk+-unix-print-2.0',
527+
},
528+
'direct_dependent_settings': {
529+
'cflags': [
530+
'$(shell <(pkg-config) --cflags <(gtk_packages))',
531+
],
532+
},
533+
'link_settings': {
534+
'ldflags': [
535+
'$(shell <(pkg-config) --libs-only-L --libs-only-other <(gtk_packages))',
536+
],
537+
'libraries': [
538+
'$(shell <(pkg-config) --libs-only-l <(gtk_packages))',
539+
],
540+
},
541+
},
542+
],
543+
}], # OS=="linux" or OS=="freebsd" or OS=="openbsd"
507544
['target_arch=="ia32"', {
508545
'variables': {
509546
'output_bfd': 'elf32-i386',

appshell/browser/client_types.h

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
2+
// reserved. Use of this source code is governed by a BSD-style license that
3+
// can be found in the LICENSE file.
4+
5+
#ifndef CEF_TESTS_CEFCLIENT_BROWSER_CLIENT_TYPES_H_
6+
#define CEF_TESTS_CEFCLIENT_BROWSER_CLIENT_TYPES_H_
7+
#pragma once
8+
9+
#include "include/cef_base.h"
10+
11+
#if defined(OS_LINUX)
12+
#include <gtk/gtk.h>
13+
14+
// The Linux client uses GTK instead of the underlying platform type (X11).
15+
#define ClientWindowHandle GtkWidget*
16+
#else
17+
#define ClientWindowHandle CefWindowHandle
18+
#endif
19+
20+
#if defined(OS_MACOSX)
21+
// Forward declaration of ObjC types used by cefclient and not provided by
22+
// include/internal/cef_types_mac.h.
23+
#ifdef __cplusplus
24+
#ifdef __OBJC__
25+
@class NSWindow;
26+
#else
27+
class NSWindow;
28+
#endif
29+
#endif
30+
#endif // defined OS_MACOSX
31+
32+
#endif // CEF_TESTS_CEFCLIENT_BROWSER_CLIENT_TYPES_H_
33+

appshell/client_app_gtk.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "include/cef_base.h"
2727
#include "config.h"
2828

29+
#include <gtk/gtk.h>
2930
#include <pwd.h>
3031
#include <algorithm>
3132
//#include <MMSystem.h>

appshell_paths.gypi

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,11 @@
140140
'<@(autogen_client_side)',
141141
],
142142
'appshell_sources_browser': [
143+
'appshell/browser/client_types.h',
143144
'appshell/browser/resource.h',
144145
'appshell/browser/resource_util.h',
145146
],
146-
'appshell_sources_common': [
147+
'appshell_sources_common_helper': [
147148
'appshell/common/client_switches.cc',
148149
'appshell/common/client_switches.h',
149150
'appshell/appshell_extensions.cpp',
@@ -155,8 +156,6 @@
155156
'appshell/appshell_node_process.cpp',
156157
'appshell/command_callbacks.h',
157158
'appshell/config.h',
158-
'appshell/cefclient.cpp',
159-
'appshell/cefclient.h',
160159
'appshell/client_app.cpp',
161160
'appshell/client_app.h',
162161
'appshell/client_app_delegates.cpp',
@@ -165,6 +164,11 @@
165164
'appshell/native_menu_model.cpp',
166165
'appshell/native_menu_model.h',
167166
],
167+
'appshell_sources_common': [
168+
'appshell/cefclient.cpp',
169+
'appshell/cefclient.h',
170+
'<@(appshell_sources_common_helper)',
171+
],
168172
'appshell_sources_renderer': [
169173
],
170174
'appshell_sources_resources': [
@@ -257,7 +261,7 @@
257261
'appshell/client_app_mac.mm',
258262
'appshell/client_handler_mac.mm',
259263
'appshell/process_helper_mac.cpp',
260-
'<@(appshell_sources_common)',
264+
'<@(appshell_sources_common_helper)',
261265
'<@(appshell_sources_renderer)',
262266
],
263267
'appshell_bundle_resources_mac': [
@@ -328,17 +332,11 @@
328332
'<@(appshell_sources_renderer)',
329333
],
330334
'appshell_bundle_resources_linux': [
331-
'Resources/locales',
332335
'appshell/res/appshell32.png',
333336
'appshell/res/appshell48.png',
334337
'appshell/res/appshell128.png',
335338
'appshell/res/appshell256.png',
336-
'Resources/cef.pak',
337-
'Resources/devtools_resources.pak',
338339
'<@(appshell_sources_resources)',
339340
],
340-
'appshell_bundle_libraries_linux': [
341-
'$(BUILDTYPE)/libcef.so',
342-
],
343341
},
344342
}

0 commit comments

Comments
 (0)