mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Implement Views framework on Windows and Linux (issue #1749).
- Add Views header files in a new include/views directory. - Add initial top-level window (CefWindow), control (CefBrowserView, CefLabelButton, CefMenuButton, CefPanel, CefScrollView, CefTextfield) and layout (CefBoxLayout, CefFlowLayout) support. See libcef/browser/views/view_impl.h comments for implementation details. - Add Views example usage in cefclient and cefsimple and Views unit tests in cef_unittests. Pass the `--use-views` command-line flag to cefclient, cefsimple and cef_unittests to run using the Views framework instead of platform APIs. For cefclient and cefsimple this will create the browser window and all related functionality using the Views framework. For cef_unittests this will run all tests (except OSR tests) in a Views-based browser window. Views- specific unit tests (`--gtest_filter=Views*`) will be run even if the the `--use-views` flag is not specified. - Pass the `--hide-frame` command-line flag to cefclient to demo a frameless Views-based browser window. - Pass the `--hide-controls` command-line flag to cefclient to demo a browser window without top controls. This also works in non-Views mode. - Pass the `--enable-high-dpi-support` command-line flag to cef_unittests on Windows to test high-DPI support on a display that supports it. - Add CefImage for reading/writing image file formats. - Add CefBrowser::DownloadImage() for downloading image URLs as a CefImage representation. This is primarily for loading favicons. - Add CefMenuModel::CreateMenuModel() and CefMenuModelDelegate for creating custom menus. This is primarily for use with CefMenuButton. - Add CefBrowser::TryCloseBrowser() helper for closing a browser. Also improve related documentation in cef_life_span_handler.h. - Rename cef_page_range_t to cef_range_t. It is now also used by CefTextfield. - Remove CefLifeSpanHandler::RunModal() which is never called. - Add draggable regions example to cefclient.
This commit is contained in:
@@ -41,6 +41,7 @@
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
#include "include/capi/cef_drag_data_capi.h"
|
||||
#include "include/capi/cef_frame_capi.h"
|
||||
#include "include/capi/cef_image_capi.h"
|
||||
#include "include/capi/cef_navigation_entry_capi.h"
|
||||
#include "include/capi/cef_process_message_capi.h"
|
||||
#include "include/capi/cef_request_context_capi.h"
|
||||
@@ -251,6 +252,29 @@ typedef struct _cef_pdf_print_callback_t {
|
||||
} cef_pdf_print_callback_t;
|
||||
|
||||
|
||||
///
|
||||
// Callback structure for cef_browser_host_t::DownloadImage. The functions of
|
||||
// this structure will be called on the browser process UI thread.
|
||||
///
|
||||
typedef struct _cef_download_image_callback_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Method that will be executed when the image download has completed.
|
||||
// |image_url| is the URL that was downloaded and |http_status_code| is the
|
||||
// resulting HTTP status code. |image| is the resulting image, possibly at
|
||||
// multiple scale factors, or NULL if the download failed.
|
||||
///
|
||||
void (CEF_CALLBACK *on_download_image_finished)(
|
||||
struct _cef_download_image_callback_t* self,
|
||||
const cef_string_t* image_url, int http_status_code,
|
||||
struct _cef_image_t* image);
|
||||
} cef_download_image_callback_t;
|
||||
|
||||
|
||||
///
|
||||
// Structure used to represent the browser process aspects of a browser window.
|
||||
// The functions of this structure can only be called in the browser process.
|
||||
@@ -282,6 +306,16 @@ typedef struct _cef_browser_host_t {
|
||||
void (CEF_CALLBACK *close_browser)(struct _cef_browser_host_t* self,
|
||||
int force_close);
|
||||
|
||||
///
|
||||
// Helper for closing a browser. Call this function from the top-level window
|
||||
// close handler. Internally this calls CloseBrowser(false (0)) if the close
|
||||
// has not yet been initiated. This function returns false (0) while the close
|
||||
// is pending and true (1) after the close has completed. See close_browser()
|
||||
// and cef_life_span_handler_t::do_close() documentation for additional usage
|
||||
// information. This function must be called on the browser process UI thread.
|
||||
///
|
||||
int (CEF_CALLBACK *try_close_browser)(struct _cef_browser_host_t* self);
|
||||
|
||||
///
|
||||
// Set whether the browser is focused.
|
||||
///
|
||||
@@ -295,19 +329,27 @@ typedef struct _cef_browser_host_t {
|
||||
int visible);
|
||||
|
||||
///
|
||||
// Retrieve the window handle for this browser.
|
||||
// Retrieve the window handle for this browser. If this browser is wrapped in
|
||||
// a cef_browser_view_t this function should be called on the browser process
|
||||
// UI thread and it will return the handle for the top-level native window.
|
||||
///
|
||||
cef_window_handle_t (CEF_CALLBACK *get_window_handle)(
|
||||
struct _cef_browser_host_t* self);
|
||||
|
||||
///
|
||||
// Retrieve the window handle of the browser that opened this browser. Will
|
||||
// return NULL for non-popup windows. This function can be used in combination
|
||||
// with custom handling of modal windows.
|
||||
// return NULL for non-popup windows or if this browser is wrapped in a
|
||||
// cef_browser_view_t. This function can be used in combination with custom
|
||||
// handling of modal windows.
|
||||
///
|
||||
cef_window_handle_t (CEF_CALLBACK *get_opener_window_handle)(
|
||||
struct _cef_browser_host_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if this browser is wrapped in a cef_browser_view_t.
|
||||
///
|
||||
int (CEF_CALLBACK *has_view)(struct _cef_browser_host_t* self);
|
||||
|
||||
///
|
||||
// Returns the client for this browser.
|
||||
///
|
||||
@@ -362,6 +404,22 @@ typedef struct _cef_browser_host_t {
|
||||
void (CEF_CALLBACK *start_download)(struct _cef_browser_host_t* self,
|
||||
const cef_string_t* url);
|
||||
|
||||
///
|
||||
// Download |image_url| and execute |callback| on completion with the images
|
||||
// received from the renderer. If |is_favicon| is true (1) then cookies are
|
||||
// not sent and not accepted during download. Images with density independent
|
||||
// pixel (DIP) sizes larger than |max_image_size| are filtered out from the
|
||||
// image results. Versions of the image at different scale factors may be
|
||||
// downloaded up to the maximum scale factor supported by the system. If there
|
||||
// are no image results <= |max_image_size| then the smallest image is resized
|
||||
// to |max_image_size| and is the only result. A |max_image_size| of 0 means
|
||||
// unlimited. If |bypass_cache| is true (1) then |image_url| is requested from
|
||||
// the server even if it is present in the browser cache.
|
||||
///
|
||||
void (CEF_CALLBACK *download_image)(struct _cef_browser_host_t* self,
|
||||
const cef_string_t* image_url, int is_favicon, uint32 max_image_size,
|
||||
int bypass_cache, struct _cef_download_image_callback_t* callback);
|
||||
|
||||
///
|
||||
// Print the current browser contents.
|
||||
///
|
||||
@@ -398,7 +456,9 @@ typedef struct _cef_browser_host_t {
|
||||
|
||||
///
|
||||
// Open developer tools in its own window. If |inspect_element_at| is non-
|
||||
// NULL the element at the specified (x,y) location will be inspected.
|
||||
// NULL the element at the specified (x,y) location will be inspected. The
|
||||
// |windowInfo| parameter will be ignored if this browser is wrapped in a
|
||||
// cef_browser_view_t.
|
||||
///
|
||||
void (CEF_CALLBACK *show_dev_tools)(struct _cef_browser_host_t* self,
|
||||
const struct _cef_window_info_t* windowInfo,
|
||||
|
187
include/capi/cef_image_capi.h
Normal file
187
include/capi/cef_image_capi.h
Normal file
@@ -0,0 +1,187 @@
|
||||
// Copyright (c) 2016 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_IMAGE_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_IMAGE_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
#include "include/capi/cef_values_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Container for a single image represented at different scale factors. All
|
||||
// image representations should be the same size in density independent pixel
|
||||
// (DIP) units. For example, if the image at scale factor 1.0 is 100x100 pixels
|
||||
// then the image at scale factor 2.0 should be 200x200 pixels -- both images
|
||||
// will display with a DIP size of 100x100 units. The functions of this
|
||||
// structure must be called on the browser process UI thread.
|
||||
///
|
||||
typedef struct _cef_image_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Returns true (1) if this Image is NULL.
|
||||
///
|
||||
int (CEF_CALLBACK *is_empty)(struct _cef_image_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if this Image and |that| Image share the same underlying
|
||||
// storage. Will also return true (1) if both images are NULL.
|
||||
///
|
||||
int (CEF_CALLBACK *is_same)(struct _cef_image_t* self,
|
||||
struct _cef_image_t* that);
|
||||
|
||||
///
|
||||
// Add a bitmap image representation for |scale_factor|. Only 32-bit RGBA/BGRA
|
||||
// formats are supported. |pixel_width| and |pixel_height| are the bitmap
|
||||
// representation size in pixel coordinates. |pixel_data| is the array of
|
||||
// pixel data and should be |pixel_width| x |pixel_height| x 4 bytes in size.
|
||||
// |color_type| and |alpha_type| values specify the pixel format.
|
||||
///
|
||||
int (CEF_CALLBACK *add_bitmap)(struct _cef_image_t* self, float scale_factor,
|
||||
int pixel_width, int pixel_height, cef_color_type_t color_type,
|
||||
cef_alpha_type_t alpha_type, const void* pixel_data,
|
||||
size_t pixel_data_size);
|
||||
|
||||
///
|
||||
// Add a PNG image representation for |scale_factor|. |png_data| is the image
|
||||
// data of size |png_data_size|. Any alpha transparency in the PNG data will
|
||||
// be maintained.
|
||||
///
|
||||
int (CEF_CALLBACK *add_png)(struct _cef_image_t* self, float scale_factor,
|
||||
const void* png_data, size_t png_data_size);
|
||||
|
||||
///
|
||||
// Create a JPEG image representation for |scale_factor|. |jpeg_data| is the
|
||||
// image data of size |jpeg_data_size|. The JPEG format does not support
|
||||
// transparency so the alpha byte will be set to 0xFF for all pixels.
|
||||
///
|
||||
int (CEF_CALLBACK *add_jpeg)(struct _cef_image_t* self, float scale_factor,
|
||||
const void* jpeg_data, size_t jpeg_data_size);
|
||||
|
||||
///
|
||||
// Returns the image width in density independent pixel (DIP) units.
|
||||
///
|
||||
size_t (CEF_CALLBACK *get_width)(struct _cef_image_t* self);
|
||||
|
||||
///
|
||||
// Returns the image height in density independent pixel (DIP) units.
|
||||
///
|
||||
size_t (CEF_CALLBACK *get_height)(struct _cef_image_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if this image contains a representation for
|
||||
// |scale_factor|.
|
||||
///
|
||||
int (CEF_CALLBACK *has_representation)(struct _cef_image_t* self,
|
||||
float scale_factor);
|
||||
|
||||
///
|
||||
// Removes the representation for |scale_factor|. Returns true (1) on success.
|
||||
///
|
||||
int (CEF_CALLBACK *remove_representation)(struct _cef_image_t* self,
|
||||
float scale_factor);
|
||||
|
||||
///
|
||||
// Returns information for the representation that most closely matches
|
||||
// |scale_factor|. |actual_scale_factor| is the actual scale factor for the
|
||||
// representation. |pixel_width| and |pixel_height| are the representation
|
||||
// size in pixel coordinates. Returns true (1) on success.
|
||||
///
|
||||
int (CEF_CALLBACK *get_representation_info)(struct _cef_image_t* self,
|
||||
float scale_factor, float* actual_scale_factor, int* pixel_width,
|
||||
int* pixel_height);
|
||||
|
||||
///
|
||||
// Returns the bitmap representation that most closely matches |scale_factor|.
|
||||
// Only 32-bit RGBA/BGRA formats are supported. |color_type| and |alpha_type|
|
||||
// values specify the desired output pixel format. |pixel_width| and
|
||||
// |pixel_height| are the output representation size in pixel coordinates.
|
||||
// Returns a cef_binary_value_t containing the pixel data on success or NULL
|
||||
// on failure.
|
||||
///
|
||||
struct _cef_binary_value_t* (CEF_CALLBACK *get_as_bitmap)(
|
||||
struct _cef_image_t* self, float scale_factor,
|
||||
cef_color_type_t color_type, cef_alpha_type_t alpha_type,
|
||||
int* pixel_width, int* pixel_height);
|
||||
|
||||
///
|
||||
// Returns the PNG representation that most closely matches |scale_factor|. If
|
||||
// |with_transparency| is true (1) any alpha transparency in the image will be
|
||||
// represented in the resulting PNG data. |pixel_width| and |pixel_height| are
|
||||
// the output representation size in pixel coordinates. Returns a
|
||||
// cef_binary_value_t containing the PNG image data on success or NULL on
|
||||
// failure.
|
||||
///
|
||||
struct _cef_binary_value_t* (CEF_CALLBACK *get_as_png)(
|
||||
struct _cef_image_t* self, float scale_factor, int with_transparency,
|
||||
int* pixel_width, int* pixel_height);
|
||||
|
||||
///
|
||||
// Returns the JPEG representation that most closely matches |scale_factor|.
|
||||
// |quality| determines the compression level with 0 == lowest and 100 ==
|
||||
// highest. The JPEG format does not support alpha transparency and the alpha
|
||||
// channel, if any, will be discarded. |pixel_width| and |pixel_height| are
|
||||
// the output representation size in pixel coordinates. Returns a
|
||||
// cef_binary_value_t containing the JPEG image data on success or NULL on
|
||||
// failure.
|
||||
///
|
||||
struct _cef_binary_value_t* (CEF_CALLBACK *get_as_jpeg)(
|
||||
struct _cef_image_t* self, float scale_factor, int quality,
|
||||
int* pixel_width, int* pixel_height);
|
||||
} cef_image_t;
|
||||
|
||||
|
||||
///
|
||||
// Create a new cef_image_t. It will initially be NULL. Use the Add*() functions
|
||||
// to add representations at different scale factors.
|
||||
///
|
||||
CEF_EXPORT cef_image_t* cef_image_create();
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_IMAGE_CAPI_H_
|
@@ -74,7 +74,9 @@ typedef struct _cef_life_span_handler_t {
|
||||
// popup browser return true (1). The |client| and |settings| values will
|
||||
// default to the source browser's values. If the |no_javascript_access| value
|
||||
// is set to false (0) the new browser will not be scriptable and may not be
|
||||
// hosted in the same renderer process as the source browser.
|
||||
// hosted in the same renderer process as the source browser. Any
|
||||
// modifications to |windowInfo| will be ignored if the parent browser is
|
||||
// wrapped in a cef_browser_view_t.
|
||||
///
|
||||
int (CEF_CALLBACK *on_before_popup)(struct _cef_life_span_handler_t* self,
|
||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
||||
@@ -85,56 +87,81 @@ typedef struct _cef_life_span_handler_t {
|
||||
struct _cef_browser_settings_t* settings, int* no_javascript_access);
|
||||
|
||||
///
|
||||
// Called after a new browser is created.
|
||||
// Called after a new browser is created. This callback will be the first
|
||||
// notification that references |browser|.
|
||||
///
|
||||
void (CEF_CALLBACK *on_after_created)(struct _cef_life_span_handler_t* self,
|
||||
struct _cef_browser_t* browser);
|
||||
|
||||
///
|
||||
// Called when a modal window is about to display and the modal loop should
|
||||
// begin running. Return false (0) to use the default modal loop
|
||||
// implementation or true (1) to use a custom implementation.
|
||||
///
|
||||
int (CEF_CALLBACK *run_modal)(struct _cef_life_span_handler_t* self,
|
||||
struct _cef_browser_t* browser);
|
||||
|
||||
///
|
||||
// Called when a browser has recieved a request to close. This may result
|
||||
// directly from a call to cef_browser_host_t::close_browser() or indirectly
|
||||
// if the browser is a top-level OS window created by CEF and the user
|
||||
// attempts to close the window. This function will be called after the
|
||||
// JavaScript 'onunload' event has been fired. It will not be called for
|
||||
// browsers after the associated OS window has been destroyed (for those
|
||||
// browsers it is no longer possible to cancel the close).
|
||||
// directly from a call to cef_browser_host_t::*close_browser() or indirectly
|
||||
// if the browser is parented to a top-level window created by CEF and the
|
||||
// user attempts to close that window (by clicking the 'X', for example). The
|
||||
// do_close() function will be called after the JavaScript 'onunload' event
|
||||
// has been fired.
|
||||
//
|
||||
// If CEF created an OS window for the browser returning false (0) will send
|
||||
// an OS close notification to the browser window's top-level owner (e.g.
|
||||
// WM_CLOSE on Windows, performClose: on OS-X and "delete_event" on Linux). If
|
||||
// no OS window exists (window rendering disabled) returning false (0) will
|
||||
// cause the browser object to be destroyed immediately. Return true (1) if
|
||||
// the browser is parented to another window and that other window needs to
|
||||
// receive close notification via some non-standard technique.
|
||||
//
|
||||
// If an application provides its own top-level window it should handle OS
|
||||
// close notifications by calling cef_browser_host_t::CloseBrowser(false (0))
|
||||
// instead of immediately closing (see the example below). This gives CEF an
|
||||
// An application should handle top-level owner window close notifications by
|
||||
// calling cef_browser_host_t::Tryclose_browser() or
|
||||
// cef_browser_host_t::CloseBrowser(false (0)) instead of allowing the window
|
||||
// to close immediately (see the examples below). This gives CEF an
|
||||
// opportunity to process the 'onbeforeunload' event and optionally cancel the
|
||||
// close before do_close() is called.
|
||||
//
|
||||
// When windowed rendering is enabled CEF will internally create a window or
|
||||
// view to host the browser. In that case returning false (0) from do_close()
|
||||
// will send the standard close notification to the browser's top-level owner
|
||||
// window (e.g. WM_CLOSE on Windows, performClose: on OS X, "delete_event" on
|
||||
// Linux or cef_window_delegate_t::can_close() callback from Views). If the
|
||||
// browser's host window/view has already been destroyed (via view hierarchy
|
||||
// tear-down, for example) then do_close() will not be called for that browser
|
||||
// since is no longer possible to cancel the close.
|
||||
//
|
||||
// When windowed rendering is disabled returning false (0) from do_close()
|
||||
// will cause the browser object to be destroyed immediately.
|
||||
//
|
||||
// If the browser's top-level owner window requires a non-standard close
|
||||
// notification then send that notification from do_close() and return true
|
||||
// (1).
|
||||
//
|
||||
// The cef_life_span_handler_t::on_before_close() function will be called
|
||||
// immediately before the browser object is destroyed. The application should
|
||||
// only exit after on_before_close() has been called for all existing
|
||||
// browsers.
|
||||
// after do_close() (if do_close() is called) and immediately before the
|
||||
// browser object is destroyed. The application should only exit after
|
||||
// on_before_close() has been called for all existing browsers.
|
||||
//
|
||||
// If the browser represents a modal window and a custom modal loop
|
||||
// implementation was provided in cef_life_span_handler_t::run_modal() this
|
||||
// callback should be used to restore the opener window to a usable state.
|
||||
// The below examples describe what should happen during window close when the
|
||||
// browser is parented to an application-provided top-level window.
|
||||
//
|
||||
// By way of example consider what should happen during window close when the
|
||||
// browser is parented to an application-provided top-level OS window. 1.
|
||||
// User clicks the window close button which sends an OS close
|
||||
// notification (e.g. WM_CLOSE on Windows, performClose: on OS-X and
|
||||
// "delete_event" on Linux).
|
||||
// Example 1: Using cef_browser_host_t::Tryclose_browser(). This is
|
||||
// recommended for clients using standard close handling and windows created
|
||||
// on the browser process UI thread. 1. User clicks the window close button
|
||||
// which sends a close notification to
|
||||
// the application's top-level window.
|
||||
// 2. Application's top-level window receives the close notification and
|
||||
// calls TryCloseBrowser() (which internally calls CloseBrowser(false)).
|
||||
// TryCloseBrowser() returns false so the client cancels the window close.
|
||||
// 3. JavaScript 'onbeforeunload' handler executes and shows the close
|
||||
// confirmation dialog (which can be overridden via
|
||||
// CefJSDialogHandler::OnBeforeUnloadDialog()).
|
||||
// 4. User approves the close. 5. JavaScript 'onunload' handler executes. 6.
|
||||
// CEF sends a close notification to the application's top-level window
|
||||
// (because DoClose() returned false by default).
|
||||
// 7. Application's top-level window receives the close notification and
|
||||
// calls TryCloseBrowser(). TryCloseBrowser() returns true so the client
|
||||
// allows the window close.
|
||||
// 8. Application's top-level window is destroyed. 9. Application's
|
||||
// on_before_close() handler is called and the browser object
|
||||
// is destroyed.
|
||||
// 10. Application exits by calling cef_quit_message_loop() if no other
|
||||
// browsers
|
||||
// exist.
|
||||
//
|
||||
// Example 2: Using cef_browser_host_t::CloseBrowser(false (0)) and
|
||||
// implementing the do_close() callback. This is recommended for clients using
|
||||
// non-standard close handling or windows that were not created on the browser
|
||||
// process UI thread. 1. User clicks the window close button which sends a
|
||||
// close notification to
|
||||
// the application's top-level window.
|
||||
// 2. Application's top-level window receives the close notification and:
|
||||
// A. Calls CefBrowserHost::CloseBrowser(false).
|
||||
// B. Cancels the window close.
|
||||
@@ -145,12 +172,12 @@ typedef struct _cef_life_span_handler_t {
|
||||
// Application's do_close() handler is called. Application will:
|
||||
// A. Set a flag to indicate that the next close attempt will be allowed.
|
||||
// B. Return false.
|
||||
// 7. CEF sends an OS close notification. 8. Application's top-level window
|
||||
// receives the OS close notification and
|
||||
// 7. CEF sends an close notification to the application's top-level window.
|
||||
// 8. Application's top-level window receives the close notification and
|
||||
// allows the window to close based on the flag from #6B.
|
||||
// 9. Browser OS window is destroyed. 10. Application's
|
||||
// cef_life_span_handler_t::on_before_close() handler is called and
|
||||
// the browser object is destroyed.
|
||||
// 9. Application's top-level window is destroyed. 10. Application's
|
||||
// on_before_close() handler is called and the browser object
|
||||
// is destroyed.
|
||||
// 11. Application exits by calling cef_quit_message_loop() if no other
|
||||
// browsers
|
||||
// exist.
|
||||
@@ -161,9 +188,8 @@ typedef struct _cef_life_span_handler_t {
|
||||
///
|
||||
// Called just before a browser is destroyed. Release all references to the
|
||||
// browser object and do not attempt to execute any functions on the browser
|
||||
// object after this callback returns. If this is a modal window and a custom
|
||||
// modal loop implementation was provided in run_modal() this callback should
|
||||
// be used to exit the custom modal loop. See do_close() documentation for
|
||||
// object after this callback returns. This callback will be the last
|
||||
// notification that references |browser|. See do_close() documentation for
|
||||
// additional usage information.
|
||||
///
|
||||
void (CEF_CALLBACK *on_before_close)(struct _cef_life_span_handler_t* self,
|
||||
|
@@ -39,6 +39,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
#include "include/capi/cef_menu_model_delegate_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -381,6 +382,13 @@ typedef struct _cef_menu_model_t {
|
||||
} cef_menu_model_t;
|
||||
|
||||
|
||||
///
|
||||
// Create a new MenuModel with the specified |delegate|.
|
||||
///
|
||||
CEF_EXPORT cef_menu_model_t* cef_menu_model_create(
|
||||
struct _cef_menu_model_delegate_t* delegate);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
80
include/capi/cef_menu_model_delegate_capi.h
Normal file
80
include/capi/cef_menu_model_delegate_capi.h
Normal file
@@ -0,0 +1,80 @@
|
||||
// Copyright (c) 2016 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_MENU_MODEL_DELEGATE_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_MENU_MODEL_DELEGATE_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct _cef_menu_model_t;
|
||||
|
||||
///
|
||||
// Implement this structure to handle menu model events. The functions of this
|
||||
// structure will be called on the browser process UI thread unless otherwise
|
||||
// indicated.
|
||||
///
|
||||
typedef struct _cef_menu_model_delegate_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Perform the action associated with the specified |command_id| and optional
|
||||
// |event_flags|.
|
||||
///
|
||||
void (CEF_CALLBACK *execute_command)(struct _cef_menu_model_delegate_t* self,
|
||||
struct _cef_menu_model_t* menu_model, int command_id,
|
||||
cef_event_flags_t event_flags);
|
||||
|
||||
///
|
||||
// The menu is about to show.
|
||||
///
|
||||
void (CEF_CALLBACK *menu_will_show)(struct _cef_menu_model_delegate_t* self,
|
||||
struct _cef_menu_model_t* menu_model);
|
||||
} cef_menu_model_delegate_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_MENU_MODEL_DELEGATE_CAPI_H_
|
@@ -121,7 +121,7 @@ typedef struct _cef_print_settings_t {
|
||||
// Set the page ranges.
|
||||
///
|
||||
void (CEF_CALLBACK *set_page_ranges)(struct _cef_print_settings_t* self,
|
||||
size_t rangesCount, cef_page_range_t const* ranges);
|
||||
size_t rangesCount, cef_range_t const* ranges);
|
||||
|
||||
///
|
||||
// Returns the number of page ranges that currently exist.
|
||||
@@ -133,7 +133,7 @@ typedef struct _cef_print_settings_t {
|
||||
// Retrieve the page ranges.
|
||||
///
|
||||
void (CEF_CALLBACK *get_page_ranges)(struct _cef_print_settings_t* self,
|
||||
size_t* rangesCount, cef_page_range_t* ranges);
|
||||
size_t* rangesCount, cef_range_t* ranges);
|
||||
|
||||
///
|
||||
// Set whether only the selection will be printed.
|
||||
|
86
include/capi/views/cef_box_layout_capi.h
Normal file
86
include/capi/views/cef_box_layout_capi.h
Normal file
@@ -0,0 +1,86 @@
|
||||
// Copyright (c) 2016 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_BOX_LAYOUT_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_VIEWS_CEF_BOX_LAYOUT_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/views/cef_layout_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct _cef_view_t;
|
||||
|
||||
///
|
||||
// A Layout manager that arranges child views vertically or horizontally in a
|
||||
// side-by-side fashion with spacing around and between the child views. The
|
||||
// child views are always sized according to their preferred size. If the host's
|
||||
// bounds provide insufficient space, child views will be clamped. Excess space
|
||||
// will not be distributed. Methods must be called on the browser process UI
|
||||
// thread unless otherwise indicated.
|
||||
///
|
||||
typedef struct _cef_box_layout_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_layout_t base;
|
||||
|
||||
///
|
||||
// Set the flex weight for the given |view|. Using the preferred size as the
|
||||
// basis, free space along the main axis is distributed to views in the ratio
|
||||
// of their flex weights. Similarly, if the views will overflow the parent,
|
||||
// space is subtracted in these ratios. A flex of 0 means this view is not
|
||||
// resized. Flex values must not be negative.
|
||||
///
|
||||
void (CEF_CALLBACK *set_flex_for_view)(struct _cef_box_layout_t* self,
|
||||
struct _cef_view_t* view, int flex);
|
||||
|
||||
///
|
||||
// Clears the flex for the given |view|, causing it to use the default flex
|
||||
// specified via cef_box_layout_tSettings.default_flex.
|
||||
///
|
||||
void (CEF_CALLBACK *clear_flex_for_view)(struct _cef_box_layout_t* self,
|
||||
struct _cef_view_t* view);
|
||||
} cef_box_layout_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_VIEWS_CEF_BOX_LAYOUT_CAPI_H_
|
90
include/capi/views/cef_browser_view_capi.h
Normal file
90
include/capi/views/cef_browser_view_capi.h
Normal file
@@ -0,0 +1,90 @@
|
||||
// Copyright (c) 2016 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_BROWSER_VIEW_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_VIEWS_CEF_BROWSER_VIEW_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/cef_browser_capi.h"
|
||||
#include "include/capi/views/cef_browser_view_delegate_capi.h"
|
||||
#include "include/capi/views/cef_view_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// A View hosting a cef_browser_t instance. Methods must be called on the
|
||||
// browser process UI thread unless otherwise indicated.
|
||||
///
|
||||
typedef struct _cef_browser_view_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_view_t base;
|
||||
|
||||
///
|
||||
// Returns the cef_browser_t hosted by this BrowserView. Will return NULL if
|
||||
// the browser has not yet been created or has already been destroyed.
|
||||
///
|
||||
struct _cef_browser_t* (CEF_CALLBACK *get_browser)(
|
||||
struct _cef_browser_view_t* self);
|
||||
} cef_browser_view_t;
|
||||
|
||||
|
||||
///
|
||||
// Create a new BrowserView. The underlying cef_browser_t will not be created
|
||||
// until this view is added to the views hierarchy.
|
||||
///
|
||||
CEF_EXPORT cef_browser_view_t* cef_browser_view_create(
|
||||
struct _cef_client_t* client, const cef_string_t* url,
|
||||
const struct _cef_browser_settings_t* settings,
|
||||
struct _cef_request_context_t* request_context,
|
||||
struct _cef_browser_view_delegate_t* delegate);
|
||||
|
||||
///
|
||||
// Returns the BrowserView associated with |browser|.
|
||||
///
|
||||
CEF_EXPORT cef_browser_view_t* cef_browser_view_get_for_browser(
|
||||
struct _cef_browser_t* browser);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_VIEWS_CEF_BROWSER_VIEW_CAPI_H_
|
118
include/capi/views/cef_browser_view_delegate_capi.h
Normal file
118
include/capi/views/cef_browser_view_delegate_capi.h
Normal file
@@ -0,0 +1,118 @@
|
||||
// Copyright (c) 2016 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_BROWSER_VIEW_DELEGATE_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_VIEWS_CEF_BROWSER_VIEW_DELEGATE_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/cef_client_capi.h"
|
||||
#include "include/capi/views/cef_view_delegate_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct _cef_browser_t;
|
||||
struct _cef_browser_view_t;
|
||||
|
||||
///
|
||||
// Implement this structure to handle BrowserView events. The functions of this
|
||||
// structure will be called on the browser process UI thread unless otherwise
|
||||
// indicated.
|
||||
///
|
||||
typedef struct _cef_browser_view_delegate_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_view_delegate_t base;
|
||||
|
||||
///
|
||||
// Called when |browser| associated with |browser_view| is created. This
|
||||
// function will be called after cef_life_span_handler_t::on_after_created()
|
||||
// is called for |browser| and before on_popup_browser_view_created() is
|
||||
// called for |browser|'s parent delegate if |browser| is a popup.
|
||||
///
|
||||
void (CEF_CALLBACK *on_browser_created)(
|
||||
struct _cef_browser_view_delegate_t* self,
|
||||
struct _cef_browser_view_t* browser_view,
|
||||
struct _cef_browser_t* browser);
|
||||
|
||||
///
|
||||
// Called when |browser| associated with |browser_view| is destroyed. Release
|
||||
// all references to |browser| and do not attempt to execute any functions on
|
||||
// |browser| after this callback returns. This function will be called before
|
||||
// cef_life_span_handler_t::on_before_close() is called for |browser|.
|
||||
///
|
||||
void (CEF_CALLBACK *on_browser_destroyed)(
|
||||
struct _cef_browser_view_delegate_t* self,
|
||||
struct _cef_browser_view_t* browser_view,
|
||||
struct _cef_browser_t* browser);
|
||||
|
||||
///
|
||||
// Called before a new popup BrowserView is created. The popup originated from
|
||||
// |browser_view|. |settings| and |client| are the values returned from
|
||||
// cef_life_span_handler_t::on_before_popup(). |is_devtools| will be true (1)
|
||||
// if the popup will be a DevTools browser. Return the delegate that will be
|
||||
// used for the new popup BrowserView.
|
||||
///
|
||||
struct _cef_browser_view_delegate_t* (
|
||||
CEF_CALLBACK *get_delegate_for_popup_browser_view)(
|
||||
struct _cef_browser_view_delegate_t* self,
|
||||
struct _cef_browser_view_t* browser_view,
|
||||
const struct _cef_browser_settings_t* settings,
|
||||
struct _cef_client_t* client, int is_devtools);
|
||||
|
||||
///
|
||||
// Called after |popup_browser_view| is created. This function will be called
|
||||
// after cef_life_span_handler_t::on_after_created() and on_browser_created()
|
||||
// are called for the new popup browser. The popup originated from
|
||||
// |browser_view|. |is_devtools| will be true (1) if the popup is a DevTools
|
||||
// browser. Optionally add |popup_browser_view| to the views hierarchy
|
||||
// yourself and return true (1). Otherwise return false (0) and a default
|
||||
// cef_window_t will be created for the popup.
|
||||
///
|
||||
int (CEF_CALLBACK *on_popup_browser_view_created)(
|
||||
struct _cef_browser_view_delegate_t* self,
|
||||
struct _cef_browser_view_t* browser_view,
|
||||
struct _cef_browser_view_t* popup_browser_view, int is_devtools);
|
||||
} cef_browser_view_delegate_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_VIEWS_CEF_BROWSER_VIEW_DELEGATE_CAPI_H_
|
96
include/capi/views/cef_button_capi.h
Normal file
96
include/capi/views/cef_button_capi.h
Normal file
@@ -0,0 +1,96 @@
|
||||
// Copyright (c) 2016 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_BUTTON_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_VIEWS_CEF_BUTTON_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/views/cef_view_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct _cef_label_button_t;
|
||||
|
||||
///
|
||||
// A View representing a button. Depending on the specific type, the button
|
||||
// could be implemented by a native control or custom rendered. Methods must be
|
||||
// called on the browser process UI thread unless otherwise indicated.
|
||||
///
|
||||
typedef struct _cef_button_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_view_t base;
|
||||
|
||||
///
|
||||
// Returns this Button as a LabelButton or NULL if this is not a LabelButton.
|
||||
///
|
||||
struct _cef_label_button_t* (CEF_CALLBACK *as_label_button)(
|
||||
struct _cef_button_t* self);
|
||||
|
||||
///
|
||||
// Sets the current display state of the Button.
|
||||
///
|
||||
void (CEF_CALLBACK *set_state)(struct _cef_button_t* self,
|
||||
cef_button_state_t state);
|
||||
|
||||
///
|
||||
// Returns the current display state of the Button.
|
||||
///
|
||||
cef_button_state_t (CEF_CALLBACK *get_state)(struct _cef_button_t* self);
|
||||
|
||||
///
|
||||
// Sets the tooltip text that will be displayed when the user hovers the mouse
|
||||
// cursor over the Button.
|
||||
///
|
||||
void (CEF_CALLBACK *set_tooltip_text)(struct _cef_button_t* self,
|
||||
const cef_string_t* tooltip_text);
|
||||
|
||||
///
|
||||
// Sets the accessible name that will be exposed to assistive technology (AT).
|
||||
///
|
||||
void (CEF_CALLBACK *set_accessible_name)(struct _cef_button_t* self,
|
||||
const cef_string_t* name);
|
||||
} cef_button_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_VIEWS_CEF_BUTTON_CAPI_H_
|
72
include/capi/views/cef_button_delegate_capi.h
Normal file
72
include/capi/views/cef_button_delegate_capi.h
Normal file
@@ -0,0 +1,72 @@
|
||||
// Copyright (c) 2016 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_BUTTON_DELEGATE_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_VIEWS_CEF_BUTTON_DELEGATE_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/views/cef_view_delegate_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct _cef_button_t;
|
||||
|
||||
///
|
||||
// Implement this structure to handle Button events. The functions of this
|
||||
// structure will be called on the browser process UI thread unless otherwise
|
||||
// indicated.
|
||||
///
|
||||
typedef struct _cef_button_delegate_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_view_delegate_t base;
|
||||
|
||||
///
|
||||
// Called when |button| is pressed.
|
||||
///
|
||||
void (CEF_CALLBACK *on_button_pressed)(struct _cef_button_delegate_t* self,
|
||||
struct _cef_button_t* button);
|
||||
} cef_button_delegate_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_VIEWS_CEF_BUTTON_DELEGATE_CAPI_H_
|
145
include/capi/views/cef_display_capi.h
Normal file
145
include/capi/views/cef_display_capi.h
Normal file
@@ -0,0 +1,145 @@
|
||||
// Copyright (c) 2016 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_DISPLAY_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_VIEWS_CEF_DISPLAY_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// This structure typically, but not always, corresponds to a physical display
|
||||
// connected to the system. A fake Display may exist on a headless system, or a
|
||||
// Display may correspond to a remote, virtual display. All size and position
|
||||
// values are in density independent pixels (DIP) unless otherwise indicated.
|
||||
// Methods must be called on the browser process UI thread unless otherwise
|
||||
// indicated.
|
||||
///
|
||||
typedef struct _cef_display_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Returns the unique identifier for this Display.
|
||||
///
|
||||
int64 (CEF_CALLBACK *get_id)(struct _cef_display_t* self);
|
||||
|
||||
///
|
||||
// Returns this Display's device pixel scale factor. This specifies how much
|
||||
// the UI should be scaled when the actual output has more pixels than
|
||||
// standard displays (which is around 100~120dpi). The potential return values
|
||||
// differ by platform.
|
||||
///
|
||||
float (CEF_CALLBACK *get_device_scale_factor)(struct _cef_display_t* self);
|
||||
|
||||
///
|
||||
// Convert |point| from density independent pixels (DIP) to pixel coordinates
|
||||
// using this Display's device scale factor.
|
||||
///
|
||||
void (CEF_CALLBACK *convert_point_to_pixels)(struct _cef_display_t* self,
|
||||
cef_point_t* point);
|
||||
|
||||
///
|
||||
// Convert |point| from pixel coordinates to density independent pixels (DIP)
|
||||
// using this Display's device scale factor.
|
||||
///
|
||||
void (CEF_CALLBACK *convert_point_from_pixels)(struct _cef_display_t* self,
|
||||
cef_point_t* point);
|
||||
|
||||
///
|
||||
// Returns this Display's bounds. This is the full size of the display.
|
||||
///
|
||||
cef_rect_t (CEF_CALLBACK *get_bounds)(struct _cef_display_t* self);
|
||||
|
||||
///
|
||||
// Returns this Display's work area. This excludes areas of the display that
|
||||
// are occupied for window manager toolbars, etc.
|
||||
///
|
||||
cef_rect_t (CEF_CALLBACK *get_work_area)(struct _cef_display_t* self);
|
||||
|
||||
///
|
||||
// Returns this Display's rotation in degrees.
|
||||
///
|
||||
int (CEF_CALLBACK *get_rotation)(struct _cef_display_t* self);
|
||||
} cef_display_t;
|
||||
|
||||
|
||||
///
|
||||
// Returns the primary Display.
|
||||
///
|
||||
CEF_EXPORT cef_display_t* cef_display_get_primary();
|
||||
|
||||
///
|
||||
// Returns the Display nearest |point|. Set |input_pixel_coords| to true (1) if
|
||||
// |point| is in pixel coordinates instead of density independent pixels (DIP).
|
||||
///
|
||||
CEF_EXPORT cef_display_t* cef_display_get_nearest_point(
|
||||
const cef_point_t* point, int input_pixel_coords);
|
||||
|
||||
///
|
||||
// Returns the Display that most closely intersects |bounds|. Set
|
||||
// |input_pixel_coords| to true (1) if |bounds| is in pixel coordinates instead
|
||||
// of density independent pixels (DIP).
|
||||
///
|
||||
CEF_EXPORT cef_display_t* cef_display_get_matching_bounds(
|
||||
const cef_rect_t* bounds, int input_pixel_coords);
|
||||
|
||||
///
|
||||
// Returns the total number of Displays. Mirrored displays are excluded; this
|
||||
// function is intended to return the number of distinct, usable displays.
|
||||
///
|
||||
CEF_EXPORT size_t cef_display_get_count();
|
||||
|
||||
///
|
||||
// Returns all Displays. Mirrored displays are excluded; this function is
|
||||
// intended to return distinct, usable displays.
|
||||
///
|
||||
CEF_EXPORT void cef_display_get_alls(size_t* displaysCount,
|
||||
cef_display_t** displays);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_VIEWS_CEF_DISPLAY_CAPI_H_
|
65
include/capi/views/cef_fill_layout_capi.h
Normal file
65
include/capi/views/cef_fill_layout_capi.h
Normal file
@@ -0,0 +1,65 @@
|
||||
// Copyright (c) 2016 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_FILL_LAYOUT_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_VIEWS_CEF_FILL_LAYOUT_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/views/cef_layout_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// A simple Layout that causes the associated Panel's one child to be sized to
|
||||
// match the bounds of its parent. Methods must be called on the browser process
|
||||
// UI thread unless otherwise indicated.
|
||||
///
|
||||
typedef struct _cef_fill_layout_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_layout_t base;
|
||||
} cef_fill_layout_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_VIEWS_CEF_FILL_LAYOUT_CAPI_H_
|
161
include/capi/views/cef_label_button_capi.h
Normal file
161
include/capi/views/cef_label_button_capi.h
Normal file
@@ -0,0 +1,161 @@
|
||||
// Copyright (c) 2016 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_LABEL_BUTTON_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_VIEWS_CEF_LABEL_BUTTON_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/cef_image_capi.h"
|
||||
#include "include/capi/views/cef_button_capi.h"
|
||||
#include "include/capi/views/cef_button_delegate_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct _cef_menu_button_t;
|
||||
|
||||
///
|
||||
// LabelButton is a button with optional text and/or icon. Methods must be
|
||||
// called on the browser process UI thread unless otherwise indicated.
|
||||
///
|
||||
typedef struct _cef_label_button_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_button_t base;
|
||||
|
||||
///
|
||||
// Returns this LabelButton as a MenuButton or NULL if this is not a
|
||||
// MenuButton.
|
||||
///
|
||||
struct _cef_menu_button_t* (CEF_CALLBACK *as_menu_button)(
|
||||
struct _cef_label_button_t* self);
|
||||
|
||||
///
|
||||
// Sets the text shown on the LabelButton. By default |text| will also be used
|
||||
// as the accessible name.
|
||||
///
|
||||
void (CEF_CALLBACK *set_text)(struct _cef_label_button_t* self,
|
||||
const cef_string_t* text);
|
||||
|
||||
///
|
||||
// Returns the text shown on the LabelButton.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_text)(
|
||||
struct _cef_label_button_t* self);
|
||||
|
||||
///
|
||||
// Sets the image shown for |button_state|. When this Button is drawn if no
|
||||
// image exists for the current state then the image for
|
||||
// CEF_BUTTON_STATE_NORMAL, if any, will be shown.
|
||||
///
|
||||
void (CEF_CALLBACK *set_image)(struct _cef_label_button_t* self,
|
||||
cef_button_state_t button_state, struct _cef_image_t* image);
|
||||
|
||||
///
|
||||
// Returns the image shown for |button_state|. If no image exists for that
|
||||
// state then the image for CEF_BUTTON_STATE_NORMAL will be returned.
|
||||
///
|
||||
struct _cef_image_t* (CEF_CALLBACK *get_image)(
|
||||
struct _cef_label_button_t* self, cef_button_state_t button_state);
|
||||
|
||||
///
|
||||
// Sets the text color shown for the specified button |for_state| to |color|.
|
||||
///
|
||||
void (CEF_CALLBACK *set_text_color)(struct _cef_label_button_t* self,
|
||||
cef_button_state_t for_state, cef_color_t color);
|
||||
|
||||
///
|
||||
// Sets the text colors shown for the non-disabled states to |color|.
|
||||
///
|
||||
void (CEF_CALLBACK *set_enabled_text_colors)(struct _cef_label_button_t* self,
|
||||
cef_color_t color);
|
||||
|
||||
///
|
||||
// Sets the font list. The format is "<FONT_FAMILY_LIST>,[STYLES] <SIZE>",
|
||||
// where: - FONT_FAMILY_LIST is a comma-separated list of font family names, -
|
||||
// STYLES is an optional space-separated list of style names (case-sensitive
|
||||
// "Bold" and "Italic" are supported), and
|
||||
// - SIZE is an integer font size in pixels with the suffix "px".
|
||||
//
|
||||
// Here are examples of valid font description strings: - "Arial, Helvetica,
|
||||
// Bold Italic 14px" - "Arial, 14px"
|
||||
///
|
||||
void (CEF_CALLBACK *set_font_list)(struct _cef_label_button_t* self,
|
||||
const cef_string_t* font_list);
|
||||
|
||||
///
|
||||
// Sets the horizontal alignment; reversed in RTL. Default is
|
||||
// CEF_HORIZONTAL_ALIGNMENT_CENTER.
|
||||
///
|
||||
void (CEF_CALLBACK *set_horizontal_alignment)(
|
||||
struct _cef_label_button_t* self, cef_horizontal_alignment_t alignment);
|
||||
|
||||
///
|
||||
// Reset the minimum size of this LabelButton to |size|.
|
||||
///
|
||||
void (CEF_CALLBACK *set_minimum_size)(struct _cef_label_button_t* self,
|
||||
const cef_size_t* size);
|
||||
|
||||
///
|
||||
// Reset the maximum size of this LabelButton to |size|.
|
||||
///
|
||||
void (CEF_CALLBACK *set_maximum_size)(struct _cef_label_button_t* self,
|
||||
const cef_size_t* size);
|
||||
} cef_label_button_t;
|
||||
|
||||
|
||||
///
|
||||
// Create a new LabelButton. A |delegate| must be provided to handle the button
|
||||
// click. |text| will be shown on the LabelButton and used as the default
|
||||
// accessible name. If |with_frame| is true (1) the button will have a visible
|
||||
// frame at all times, center alignment, additional padding and a default
|
||||
// minimum size of 70x33 DIP. If |with_frame| is false (0) the button will only
|
||||
// have a visible frame on hover/press, left alignment, less padding and no
|
||||
// default minimum size.
|
||||
///
|
||||
CEF_EXPORT cef_label_button_t* cef_label_button_create(
|
||||
struct _cef_button_delegate_t* delegate, const cef_string_t* text,
|
||||
int with_frame);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_VIEWS_CEF_LABEL_BUTTON_CAPI_H_
|
84
include/capi/views/cef_layout_capi.h
Normal file
84
include/capi/views/cef_layout_capi.h
Normal file
@@ -0,0 +1,84 @@
|
||||
// Copyright (c) 2016 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_LAYOUT_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_VIEWS_CEF_LAYOUT_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct _cef_box_layout_t;
|
||||
struct _cef_fill_layout_t;
|
||||
|
||||
///
|
||||
// A Layout handles the sizing of the children of a Panel according to
|
||||
// implementation-specific heuristics. Methods must be called on the browser
|
||||
// process UI thread unless otherwise indicated.
|
||||
///
|
||||
typedef struct _cef_layout_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Returns this Layout as a BoxLayout or NULL if this is not a BoxLayout.
|
||||
///
|
||||
struct _cef_box_layout_t* (CEF_CALLBACK *as_box_layout)(
|
||||
struct _cef_layout_t* self);
|
||||
|
||||
///
|
||||
// Returns this Layout as a FillLayout or NULL if this is not a FillLayout.
|
||||
///
|
||||
struct _cef_fill_layout_t* (CEF_CALLBACK *as_fill_layout)(
|
||||
struct _cef_layout_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if this Layout is valid.
|
||||
///
|
||||
int (CEF_CALLBACK *is_valid)(struct _cef_layout_t* self);
|
||||
} cef_layout_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_VIEWS_CEF_LAYOUT_CAPI_H_
|
93
include/capi/views/cef_menu_button_capi.h
Normal file
93
include/capi/views/cef_menu_button_capi.h
Normal file
@@ -0,0 +1,93 @@
|
||||
// Copyright (c) 2016 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_MENU_BUTTON_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_VIEWS_CEF_MENU_BUTTON_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/cef_menu_model_capi.h"
|
||||
#include "include/capi/views/cef_label_button_capi.h"
|
||||
#include "include/capi/views/cef_menu_button_delegate_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// MenuButton is a button with optional text, icon and/or menu marker that shows
|
||||
// a menu when clicked with the left mouse button. All size and position values
|
||||
// are in density independent pixels (DIP) unless otherwise indicated. Methods
|
||||
// must be called on the browser process UI thread unless otherwise indicated.
|
||||
///
|
||||
typedef struct _cef_menu_button_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_label_button_t base;
|
||||
|
||||
///
|
||||
// Show a menu with contents |menu_model|. |screen_point| specifies the menu
|
||||
// position in screen coordinates. |anchor_position| specifies how the menu
|
||||
// will be anchored relative to |screen_point|. This function should be called
|
||||
// from cef_menu_button_delegate_t::on_menu_button_pressed().
|
||||
///
|
||||
void (CEF_CALLBACK *show_menu)(struct _cef_menu_button_t* self,
|
||||
struct _cef_menu_model_t* menu_model, const cef_point_t* screen_point,
|
||||
cef_menu_anchor_position_t anchor_position);
|
||||
} cef_menu_button_t;
|
||||
|
||||
|
||||
///
|
||||
// Create a new MenuButton. A |delegate| must be provided to call show_menu()
|
||||
// when the button is clicked. |text| will be shown on the MenuButton and used
|
||||
// as the default accessible name. If |with_frame| is true (1) the button will
|
||||
// have a visible frame at all times, center alignment, additional padding and a
|
||||
// default minimum size of 70x33 DIP. If |with_frame| is false (0) the button
|
||||
// will only have a visible frame on hover/press, left alignment, less padding
|
||||
// and no default minimum size. If |with_menu_marker| is true (1) a menu marker
|
||||
// will be added to the button.
|
||||
///
|
||||
CEF_EXPORT cef_menu_button_t* cef_menu_button_create(
|
||||
struct _cef_menu_button_delegate_t* delegate, const cef_string_t* text,
|
||||
int with_frame, int with_menu_marker);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_VIEWS_CEF_MENU_BUTTON_CAPI_H_
|
75
include/capi/views/cef_menu_button_delegate_capi.h
Normal file
75
include/capi/views/cef_menu_button_delegate_capi.h
Normal file
@@ -0,0 +1,75 @@
|
||||
// Copyright (c) 2016 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_MENU_BUTTON_DELEGATE_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_VIEWS_CEF_MENU_BUTTON_DELEGATE_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/views/cef_button_delegate_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct _cef_menu_button_t;
|
||||
|
||||
///
|
||||
// Implement this structure to handle MenuButton events. The functions of this
|
||||
// structure will be called on the browser process UI thread unless otherwise
|
||||
// indicated.
|
||||
///
|
||||
typedef struct _cef_menu_button_delegate_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_button_delegate_t base;
|
||||
|
||||
///
|
||||
// Called when |button| is pressed. Call cef_menu_button_t::show_menu() to
|
||||
// show the resulting menu at |screen_point|.
|
||||
///
|
||||
void (CEF_CALLBACK *on_menu_button_pressed)(
|
||||
struct _cef_menu_button_delegate_t* self,
|
||||
struct _cef_menu_button_t* menu_button,
|
||||
const cef_point_t* screen_point);
|
||||
} cef_menu_button_delegate_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_VIEWS_CEF_MENU_BUTTON_DELEGATE_CAPI_H_
|
149
include/capi/views/cef_panel_capi.h
Normal file
149
include/capi/views/cef_panel_capi.h
Normal file
@@ -0,0 +1,149 @@
|
||||
// Copyright (c) 2016 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_PANEL_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_VIEWS_CEF_PANEL_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/views/cef_panel_delegate_capi.h"
|
||||
#include "include/capi/views/cef_view_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct _cef_box_layout_t;
|
||||
struct _cef_fill_layout_t;
|
||||
struct _cef_layout_t;
|
||||
struct _cef_window_t;
|
||||
|
||||
///
|
||||
// A Panel is a container in the views hierarchy that can contain other Views as
|
||||
// children. Methods must be called on the browser process UI thread unless
|
||||
// otherwise indicated.
|
||||
///
|
||||
typedef struct _cef_panel_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_view_t base;
|
||||
|
||||
///
|
||||
// Returns this Panel as a Window or NULL if this is not a Window.
|
||||
///
|
||||
struct _cef_window_t* (CEF_CALLBACK *as_window)(struct _cef_panel_t* self);
|
||||
|
||||
///
|
||||
// Set this Panel's Layout to FillLayout and return the FillLayout object.
|
||||
///
|
||||
struct _cef_fill_layout_t* (CEF_CALLBACK *set_to_fill_layout)(
|
||||
struct _cef_panel_t* self);
|
||||
|
||||
///
|
||||
// Set this Panel's Layout to BoxLayout and return the BoxLayout object.
|
||||
///
|
||||
struct _cef_box_layout_t* (CEF_CALLBACK *set_to_box_layout)(
|
||||
struct _cef_panel_t* self,
|
||||
const struct _cef_box_layout_settings_t* settings);
|
||||
|
||||
///
|
||||
// Get the Layout.
|
||||
///
|
||||
struct _cef_layout_t* (CEF_CALLBACK *get_layout)(struct _cef_panel_t* self);
|
||||
|
||||
///
|
||||
// Lay out the child Views (set their bounds based on sizing heuristics
|
||||
// specific to the current Layout).
|
||||
///
|
||||
void (CEF_CALLBACK *layout)(struct _cef_panel_t* self);
|
||||
|
||||
///
|
||||
// Add a child View.
|
||||
///
|
||||
void (CEF_CALLBACK *add_child_view)(struct _cef_panel_t* self,
|
||||
struct _cef_view_t* view);
|
||||
|
||||
///
|
||||
// Add a child View at the specified |index|. If |index| matches the result of
|
||||
// GetChildCount() then the View will be added at the end.
|
||||
///
|
||||
void (CEF_CALLBACK *add_child_view_at)(struct _cef_panel_t* self,
|
||||
struct _cef_view_t* view, int index);
|
||||
|
||||
///
|
||||
// Move the child View to the specified |index|. A negative value for |index|
|
||||
// will move the View to the end.
|
||||
///
|
||||
void (CEF_CALLBACK *reorder_child_view)(struct _cef_panel_t* self,
|
||||
struct _cef_view_t* view, int index);
|
||||
|
||||
///
|
||||
// Remove a child View. The View can then be added to another Panel.
|
||||
///
|
||||
void (CEF_CALLBACK *remove_child_view)(struct _cef_panel_t* self,
|
||||
struct _cef_view_t* view);
|
||||
|
||||
///
|
||||
// Remove all child Views. The removed Views will be deleted if the client
|
||||
// holds no references to them.
|
||||
///
|
||||
void (CEF_CALLBACK *remove_all_child_views)(struct _cef_panel_t* self);
|
||||
|
||||
///
|
||||
// Returns the number of child Views.
|
||||
///
|
||||
size_t (CEF_CALLBACK *get_child_view_count)(struct _cef_panel_t* self);
|
||||
|
||||
///
|
||||
// Returns the child View at the specified |index|.
|
||||
///
|
||||
struct _cef_view_t* (CEF_CALLBACK *get_child_view_at)(
|
||||
struct _cef_panel_t* self, int index);
|
||||
} cef_panel_t;
|
||||
|
||||
|
||||
///
|
||||
// Create a new Panel.
|
||||
///
|
||||
CEF_EXPORT cef_panel_t* cef_panel_create(
|
||||
struct _cef_panel_delegate_t* delegate);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_VIEWS_CEF_PANEL_CAPI_H_
|
65
include/capi/views/cef_panel_delegate_capi.h
Normal file
65
include/capi/views/cef_panel_delegate_capi.h
Normal file
@@ -0,0 +1,65 @@
|
||||
// Copyright (c) 2016 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_PANEL_DELEGATE_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_VIEWS_CEF_PANEL_DELEGATE_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/views/cef_view_delegate_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// Implement this structure to handle Panel events. The functions of this
|
||||
// structure will be called on the browser process UI thread unless otherwise
|
||||
// indicated.
|
||||
///
|
||||
typedef struct _cef_panel_delegate_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_view_delegate_t base;
|
||||
} cef_panel_delegate_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_VIEWS_CEF_PANEL_DELEGATE_CAPI_H_
|
113
include/capi/views/cef_scroll_view_capi.h
Normal file
113
include/capi/views/cef_scroll_view_capi.h
Normal file
@@ -0,0 +1,113 @@
|
||||
// Copyright (c) 2016 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_SCROLL_VIEW_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_VIEWS_CEF_SCROLL_VIEW_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/views/cef_view_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// A ScrollView will show horizontal and/or vertical scrollbars when necessary
|
||||
// based on the size of the attached content view. Methods must be called on the
|
||||
// browser process UI thread unless otherwise indicated.
|
||||
///
|
||||
typedef struct _cef_scroll_view_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_view_t base;
|
||||
|
||||
///
|
||||
// Set the content View. The content View must have a specified size (e.g. via
|
||||
// cef_view_t::SetBounds or cef_view_tDelegate::GetPreferredSize).
|
||||
///
|
||||
void (CEF_CALLBACK *set_content_view)(struct _cef_scroll_view_t* self,
|
||||
struct _cef_view_t* view);
|
||||
|
||||
///
|
||||
// Returns the content View.
|
||||
///
|
||||
struct _cef_view_t* (CEF_CALLBACK *get_content_view)(
|
||||
struct _cef_scroll_view_t* self);
|
||||
|
||||
///
|
||||
// Returns the visible region of the content View.
|
||||
///
|
||||
cef_rect_t (CEF_CALLBACK *get_visible_content_rect)(
|
||||
struct _cef_scroll_view_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if the horizontal scrollbar is currently showing.
|
||||
///
|
||||
int (CEF_CALLBACK *has_horizontal_scrollbar)(struct _cef_scroll_view_t* self);
|
||||
|
||||
///
|
||||
// Returns the height of the horizontal scrollbar.
|
||||
///
|
||||
int (CEF_CALLBACK *get_horizontal_scrollbar_height)(
|
||||
struct _cef_scroll_view_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if the vertical scrollbar is currently showing.
|
||||
///
|
||||
int (CEF_CALLBACK *has_vertical_scrollbar)(struct _cef_scroll_view_t* self);
|
||||
|
||||
///
|
||||
// Returns the width of the vertical scrollbar.
|
||||
///
|
||||
int (CEF_CALLBACK *get_vertical_scrollbar_width)(
|
||||
struct _cef_scroll_view_t* self);
|
||||
} cef_scroll_view_t;
|
||||
|
||||
|
||||
///
|
||||
// Create a new ScrollView.
|
||||
///
|
||||
CEF_EXPORT cef_scroll_view_t* cef_scroll_view_create(
|
||||
struct _cef_view_delegate_t* delegate);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_VIEWS_CEF_SCROLL_VIEW_CAPI_H_
|
279
include/capi/views/cef_textfield_capi.h
Normal file
279
include/capi/views/cef_textfield_capi.h
Normal file
@@ -0,0 +1,279 @@
|
||||
// Copyright (c) 2016 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_TEXTFIELD_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_VIEWS_CEF_TEXTFIELD_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/views/cef_textfield_delegate_capi.h"
|
||||
#include "include/capi/views/cef_view_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// A Textfield supports editing of text. This control is custom rendered with no
|
||||
// platform-specific code. Methods must be called on the browser process UI
|
||||
// thread unless otherwise indicated.
|
||||
///
|
||||
typedef struct _cef_textfield_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_view_t base;
|
||||
|
||||
///
|
||||
// Sets whether the text will be displayed as asterisks.
|
||||
///
|
||||
void (CEF_CALLBACK *set_password_input)(struct _cef_textfield_t* self,
|
||||
int password_input);
|
||||
|
||||
///
|
||||
// Returns true (1) if the text will be displayed as asterisks.
|
||||
///
|
||||
int (CEF_CALLBACK *is_password_input)(struct _cef_textfield_t* self);
|
||||
|
||||
///
|
||||
// Sets whether the text will read-only.
|
||||
///
|
||||
void (CEF_CALLBACK *set_read_only)(struct _cef_textfield_t* self,
|
||||
int read_only);
|
||||
|
||||
///
|
||||
// Returns true (1) if the text is read-only.
|
||||
///
|
||||
int (CEF_CALLBACK *is_read_only)(struct _cef_textfield_t* self);
|
||||
|
||||
///
|
||||
// Returns the currently displayed text.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_text)(struct _cef_textfield_t* self);
|
||||
|
||||
///
|
||||
// Sets the contents to |text|. The cursor will be moved to end of the text if
|
||||
// the current position is outside of the text range.
|
||||
///
|
||||
void (CEF_CALLBACK *set_text)(struct _cef_textfield_t* self,
|
||||
const cef_string_t* text);
|
||||
|
||||
///
|
||||
// Appends |text| to the previously-existing text.
|
||||
///
|
||||
void (CEF_CALLBACK *append_text)(struct _cef_textfield_t* self,
|
||||
const cef_string_t* text);
|
||||
|
||||
///
|
||||
// Inserts |text| at the current cursor position replacing any selected text.
|
||||
///
|
||||
void (CEF_CALLBACK *insert_or_replace_text)(struct _cef_textfield_t* self,
|
||||
const cef_string_t* text);
|
||||
|
||||
///
|
||||
// Returns true (1) if there is any selected text.
|
||||
///
|
||||
int (CEF_CALLBACK *has_selection)(struct _cef_textfield_t* self);
|
||||
|
||||
///
|
||||
// Returns the currently selected text.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_selected_text)(
|
||||
struct _cef_textfield_t* self);
|
||||
|
||||
///
|
||||
// Selects all text. If |reversed| is true (1) the range will end at the
|
||||
// logical beginning of the text; this generally shows the leading portion of
|
||||
// text that overflows its display area.
|
||||
///
|
||||
void (CEF_CALLBACK *select_all)(struct _cef_textfield_t* self, int reversed);
|
||||
|
||||
///
|
||||
// Clears the text selection and sets the caret to the end.
|
||||
///
|
||||
void (CEF_CALLBACK *clear_selection)(struct _cef_textfield_t* self);
|
||||
|
||||
///
|
||||
// Returns the selected logical text range.
|
||||
///
|
||||
cef_range_t (CEF_CALLBACK *get_selected_range)(struct _cef_textfield_t* self);
|
||||
|
||||
///
|
||||
// Selects the specified logical text range.
|
||||
///
|
||||
void (CEF_CALLBACK *select_range)(struct _cef_textfield_t* self,
|
||||
const cef_range_t* range);
|
||||
|
||||
///
|
||||
// Returns the current cursor position.
|
||||
///
|
||||
size_t (CEF_CALLBACK *get_cursor_position)(struct _cef_textfield_t* self);
|
||||
|
||||
///
|
||||
// Sets the text color.
|
||||
///
|
||||
void (CEF_CALLBACK *set_text_color)(struct _cef_textfield_t* self,
|
||||
cef_color_t color);
|
||||
|
||||
///
|
||||
// Returns the text color.
|
||||
///
|
||||
cef_color_t (CEF_CALLBACK *get_text_color)(struct _cef_textfield_t* self);
|
||||
|
||||
///
|
||||
// Sets the selection text color.
|
||||
///
|
||||
void (CEF_CALLBACK *set_selection_text_color)(struct _cef_textfield_t* self,
|
||||
cef_color_t color);
|
||||
|
||||
///
|
||||
// Returns the selection text color.
|
||||
///
|
||||
cef_color_t (CEF_CALLBACK *get_selection_text_color)(
|
||||
struct _cef_textfield_t* self);
|
||||
|
||||
///
|
||||
// Sets the selection background color.
|
||||
///
|
||||
void (CEF_CALLBACK *set_selection_background_color)(
|
||||
struct _cef_textfield_t* self, cef_color_t color);
|
||||
|
||||
///
|
||||
// Returns the selection background color.
|
||||
///
|
||||
cef_color_t (CEF_CALLBACK *get_selection_background_color)(
|
||||
struct _cef_textfield_t* self);
|
||||
|
||||
///
|
||||
// Sets the font list. The format is "<FONT_FAMILY_LIST>,[STYLES] <SIZE>",
|
||||
// where: - FONT_FAMILY_LIST is a comma-separated list of font family names, -
|
||||
// STYLES is an optional space-separated list of style names (case-sensitive
|
||||
// "Bold" and "Italic" are supported), and
|
||||
// - SIZE is an integer font size in pixels with the suffix "px".
|
||||
//
|
||||
// Here are examples of valid font description strings: - "Arial, Helvetica,
|
||||
// Bold Italic 14px" - "Arial, 14px"
|
||||
///
|
||||
void (CEF_CALLBACK *set_font_list)(struct _cef_textfield_t* self,
|
||||
const cef_string_t* font_list);
|
||||
|
||||
///
|
||||
// Applies |color| to the specified |range| without changing the default
|
||||
// color. If |range| is NULL the color will be set on the complete text
|
||||
// contents.
|
||||
///
|
||||
void (CEF_CALLBACK *apply_text_color)(struct _cef_textfield_t* self,
|
||||
cef_color_t color, const cef_range_t* range);
|
||||
|
||||
///
|
||||
// Applies |style| to the specified |range| without changing the default
|
||||
// style. If |add| is true (1) the style will be added, otherwise the style
|
||||
// will be removed. If |range| is NULL the style will be set on the complete
|
||||
// text contents.
|
||||
///
|
||||
void (CEF_CALLBACK *apply_text_style)(struct _cef_textfield_t* self,
|
||||
cef_text_style_t style, int add, const cef_range_t* range);
|
||||
|
||||
///
|
||||
// Returns true (1) if the action associated with the specified command id is
|
||||
// enabled. See additional comments on execute_command().
|
||||
///
|
||||
int (CEF_CALLBACK *is_command_enabled)(struct _cef_textfield_t* self,
|
||||
int command_id);
|
||||
|
||||
///
|
||||
// Performs the action associated with the specified command id. Valid values
|
||||
// include IDS_APP_UNDO, IDS_APP_REDO, IDS_APP_CUT, IDS_APP_COPY,
|
||||
// IDS_APP_PASTE, IDS_APP_DELETE, IDS_APP_SELECT_ALL, IDS_DELETE_* and
|
||||
// IDS_MOVE_*. See include/cef_pack_strings.h for definitions.
|
||||
///
|
||||
void (CEF_CALLBACK *execute_command)(struct _cef_textfield_t* self,
|
||||
int command_id);
|
||||
|
||||
///
|
||||
// Clears Edit history.
|
||||
///
|
||||
void (CEF_CALLBACK *clear_edit_history)(struct _cef_textfield_t* self);
|
||||
|
||||
///
|
||||
// Sets the placeholder text that will be displayed when the Textfield is
|
||||
// NULL.
|
||||
///
|
||||
void (CEF_CALLBACK *set_placeholder_text)(struct _cef_textfield_t* self,
|
||||
const cef_string_t* text);
|
||||
|
||||
///
|
||||
// Returns the placeholder text that will be displayed when the Textfield is
|
||||
// NULL.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_placeholder_text)(
|
||||
struct _cef_textfield_t* self);
|
||||
|
||||
///
|
||||
// Sets the placeholder text color.
|
||||
///
|
||||
void (CEF_CALLBACK *set_placeholder_text_color)(struct _cef_textfield_t* self,
|
||||
cef_color_t color);
|
||||
|
||||
///
|
||||
// Returns the placeholder text color.
|
||||
///
|
||||
cef_color_t (CEF_CALLBACK *get_placeholder_text_color)(
|
||||
struct _cef_textfield_t* self);
|
||||
|
||||
///
|
||||
// Set the accessible name that will be exposed to assistive technology (AT).
|
||||
///
|
||||
void (CEF_CALLBACK *set_accessible_name)(struct _cef_textfield_t* self,
|
||||
const cef_string_t* name);
|
||||
} cef_textfield_t;
|
||||
|
||||
|
||||
///
|
||||
// Create a new Textfield.
|
||||
///
|
||||
CEF_EXPORT cef_textfield_t* cef_textfield_create(
|
||||
struct _cef_textfield_delegate_t* delegate);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_VIEWS_CEF_TEXTFIELD_CAPI_H_
|
82
include/capi/views/cef_textfield_delegate_capi.h
Normal file
82
include/capi/views/cef_textfield_delegate_capi.h
Normal file
@@ -0,0 +1,82 @@
|
||||
// Copyright (c) 2016 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_TEXTFIELD_DELEGATE_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_VIEWS_CEF_TEXTFIELD_DELEGATE_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/views/cef_view_delegate_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct _cef_textfield_t;
|
||||
|
||||
///
|
||||
// Implement this structure to handle Textfield events. The functions of this
|
||||
// structure will be called on the browser process UI thread unless otherwise
|
||||
// indicated.
|
||||
///
|
||||
typedef struct _cef_textfield_delegate_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_view_delegate_t base;
|
||||
|
||||
///
|
||||
// Called when |textfield| recieves a keyboard event. |event| contains
|
||||
// information about the keyboard event. Return true (1) if the keyboard event
|
||||
// was handled or false (0) otherwise for default handling.
|
||||
///
|
||||
int (CEF_CALLBACK *on_key_event)(struct _cef_textfield_delegate_t* self,
|
||||
struct _cef_textfield_t* textfield,
|
||||
const struct _cef_key_event_t* event);
|
||||
|
||||
///
|
||||
// Called after performing a user action that may change |textfield|.
|
||||
///
|
||||
void (CEF_CALLBACK *on_after_user_action)(
|
||||
struct _cef_textfield_delegate_t* self,
|
||||
struct _cef_textfield_t* textfield);
|
||||
} cef_textfield_delegate_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_VIEWS_CEF_TEXTFIELD_DELEGATE_CAPI_H_
|
374
include/capi/views/cef_view_capi.h
Normal file
374
include/capi/views/cef_view_capi.h
Normal file
@@ -0,0 +1,374 @@
|
||||
// Copyright (c) 2016 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_VIEW_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_VIEWS_CEF_VIEW_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/views/cef_view_delegate_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct _cef_browser_view_t;
|
||||
struct _cef_button_t;
|
||||
struct _cef_panel_t;
|
||||
struct _cef_scroll_view_t;
|
||||
struct _cef_textfield_t;
|
||||
struct _cef_window_t;
|
||||
|
||||
///
|
||||
// A View is a rectangle within the views View hierarchy. It is the base
|
||||
// structure for all Views. All size and position values are in density
|
||||
// independent pixels (DIP) unless otherwise indicated. Methods must be called
|
||||
// on the browser process UI thread unless otherwise indicated.
|
||||
///
|
||||
typedef struct _cef_view_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Returns this View as a BrowserView or NULL if this is not a BrowserView.
|
||||
///
|
||||
struct _cef_browser_view_t* (CEF_CALLBACK *as_browser_view)(
|
||||
struct _cef_view_t* self);
|
||||
|
||||
///
|
||||
// Returns this View as a Button or NULL if this is not a Button.
|
||||
///
|
||||
struct _cef_button_t* (CEF_CALLBACK *as_button)(struct _cef_view_t* self);
|
||||
|
||||
///
|
||||
// Returns this View as a Panel or NULL if this is not a Panel.
|
||||
///
|
||||
struct _cef_panel_t* (CEF_CALLBACK *as_panel)(struct _cef_view_t* self);
|
||||
|
||||
///
|
||||
// Returns this View as a ScrollView or NULL if this is not a ScrollView.
|
||||
///
|
||||
struct _cef_scroll_view_t* (CEF_CALLBACK *as_scroll_view)(
|
||||
struct _cef_view_t* self);
|
||||
|
||||
///
|
||||
// Returns this View as a Textfield or NULL if this is not a Textfield.
|
||||
///
|
||||
struct _cef_textfield_t* (CEF_CALLBACK *as_textfield)(
|
||||
struct _cef_view_t* self);
|
||||
|
||||
///
|
||||
// Returns the type of this View as a string. Used primarily for testing
|
||||
// purposes.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_type_string)(
|
||||
struct _cef_view_t* self);
|
||||
|
||||
///
|
||||
// Returns a string representation of this View which includes the type and
|
||||
// various type-specific identifying attributes. If |include_children| is true
|
||||
// (1) any child Views will also be included. Used primarily for testing
|
||||
// purposes.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *to_string)(struct _cef_view_t* self,
|
||||
int include_children);
|
||||
|
||||
///
|
||||
// Returns true (1) if this View is valid.
|
||||
///
|
||||
int (CEF_CALLBACK *is_valid)(struct _cef_view_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if this View is currently attached to another View. A View
|
||||
// can only be attached to one View at a time.
|
||||
///
|
||||
int (CEF_CALLBACK *is_attached)(struct _cef_view_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if this View is the same as |that| View.
|
||||
///
|
||||
int (CEF_CALLBACK *is_same)(struct _cef_view_t* self,
|
||||
struct _cef_view_t* that);
|
||||
|
||||
///
|
||||
// Returns the delegate associated with this View, if any.
|
||||
///
|
||||
struct _cef_view_delegate_t* (CEF_CALLBACK *get_delegate)(
|
||||
struct _cef_view_t* self);
|
||||
|
||||
///
|
||||
// Returns the top-level Window hosting this View, if any.
|
||||
///
|
||||
struct _cef_window_t* (CEF_CALLBACK *get_window)(struct _cef_view_t* self);
|
||||
|
||||
///
|
||||
// Returns the ID for this View.
|
||||
///
|
||||
int (CEF_CALLBACK *get_id)(struct _cef_view_t* self);
|
||||
|
||||
///
|
||||
// Sets the ID for this View. ID should be unique within the subtree that you
|
||||
// intend to search for it. 0 is the default ID for views.
|
||||
///
|
||||
void (CEF_CALLBACK *set_id)(struct _cef_view_t* self, int id);
|
||||
|
||||
///
|
||||
// Returns the View that contains this View, if any.
|
||||
///
|
||||
struct _cef_view_t* (CEF_CALLBACK *get_parent_view)(struct _cef_view_t* self);
|
||||
|
||||
///
|
||||
// Recursively descends the view tree starting at this View, and returns the
|
||||
// first child that it encounters with the given ID. Returns NULL if no
|
||||
// matching child view is found.
|
||||
///
|
||||
struct _cef_view_t* (CEF_CALLBACK *get_view_for_id)(struct _cef_view_t* self,
|
||||
int id);
|
||||
|
||||
///
|
||||
// Sets the bounds (size and position) of this View. Position is in parent
|
||||
// coordinates.
|
||||
///
|
||||
void (CEF_CALLBACK *set_bounds)(struct _cef_view_t* self,
|
||||
const cef_rect_t* bounds);
|
||||
|
||||
///
|
||||
// Returns the bounds (size and position) of this View. Position is in parent
|
||||
// coordinates.
|
||||
///
|
||||
cef_rect_t (CEF_CALLBACK *get_bounds)(struct _cef_view_t* self);
|
||||
|
||||
///
|
||||
// Returns the bounds (size and position) of this View. Position is in screen
|
||||
// coordinates.
|
||||
///
|
||||
cef_rect_t (CEF_CALLBACK *get_bounds_in_screen)(struct _cef_view_t* self);
|
||||
|
||||
///
|
||||
// Sets the size of this View without changing the position.
|
||||
///
|
||||
void (CEF_CALLBACK *set_size)(struct _cef_view_t* self,
|
||||
const cef_size_t* size);
|
||||
|
||||
///
|
||||
// Returns the size of this View.
|
||||
///
|
||||
cef_size_t (CEF_CALLBACK *get_size)(struct _cef_view_t* self);
|
||||
|
||||
///
|
||||
// Sets the position of this View without changing the size. |position| is in
|
||||
// parent coordinates.
|
||||
///
|
||||
void (CEF_CALLBACK *set_position)(struct _cef_view_t* self,
|
||||
const cef_point_t* position);
|
||||
|
||||
///
|
||||
// Returns the position of this View. Position is in parent coordinates.
|
||||
///
|
||||
cef_point_t (CEF_CALLBACK *get_position)(struct _cef_view_t* self);
|
||||
|
||||
///
|
||||
// Returns the size this View would like to be if enough space is available.
|
||||
///
|
||||
cef_size_t (CEF_CALLBACK *get_preferred_size)(struct _cef_view_t* self);
|
||||
|
||||
///
|
||||
// Size this View to its preferred size.
|
||||
///
|
||||
void (CEF_CALLBACK *size_to_preferred_size)(struct _cef_view_t* self);
|
||||
|
||||
///
|
||||
// Returns the minimum size for this View.
|
||||
///
|
||||
cef_size_t (CEF_CALLBACK *get_minimum_size)(struct _cef_view_t* self);
|
||||
|
||||
///
|
||||
// Returns the maximum size for this View.
|
||||
///
|
||||
cef_size_t (CEF_CALLBACK *get_maximum_size)(struct _cef_view_t* self);
|
||||
|
||||
///
|
||||
// Returns the height necessary to display this View with the provided width.
|
||||
///
|
||||
int (CEF_CALLBACK *get_height_for_width)(struct _cef_view_t* self, int width);
|
||||
|
||||
///
|
||||
// Indicate that this View and all parent Views require a re-layout. This
|
||||
// ensures the next call to layout() will propagate to this View even if the
|
||||
// bounds of parent Views do not change.
|
||||
///
|
||||
void (CEF_CALLBACK *invalidate_layout)(struct _cef_view_t* self);
|
||||
|
||||
///
|
||||
// Sets whether this View is visible. Windows are hidden by default and other
|
||||
// views are visible by default. This View and any parent views must be set as
|
||||
// visible for this View to be drawn in a Window. If this View is set as
|
||||
// hidden then it and any child views will not be drawn and, if any of those
|
||||
// views currently have focus, then focus will also be cleared. Painting is
|
||||
// scheduled as needed. If this View is a Window then calling this function is
|
||||
// equivalent to calling the Window show() and hide() functions.
|
||||
///
|
||||
void (CEF_CALLBACK *set_visible)(struct _cef_view_t* self, int visible);
|
||||
|
||||
///
|
||||
// Returns whether this View is visible. A view may be visible but still not
|
||||
// drawn in a Window if any parent views are hidden. If this View is a Window
|
||||
// then a return value of true (1) indicates that this Window is currently
|
||||
// visible to the user on-screen. If this View is not a Window then call
|
||||
// is_drawn() to determine whether this View and all parent views are visible
|
||||
// and will be drawn.
|
||||
///
|
||||
int (CEF_CALLBACK *is_visible)(struct _cef_view_t* self);
|
||||
|
||||
///
|
||||
// Returns whether this View is visible and drawn in a Window. A view is drawn
|
||||
// if it and all parent views are visible. If this View is a Window then
|
||||
// calling this function is equivalent to calling is_visible(). Otherwise, to
|
||||
// determine if the containing Window is visible to the user on-screen call
|
||||
// is_visible() on the Window.
|
||||
///
|
||||
int (CEF_CALLBACK *is_drawn)(struct _cef_view_t* self);
|
||||
|
||||
///
|
||||
// Set whether this View is enabled. A disabled View does not receive keyboard
|
||||
// or mouse inputs. If |enabled| differs from the current value the View will
|
||||
// be repainted. Also, clears focus if the focused View is disabled.
|
||||
///
|
||||
void (CEF_CALLBACK *set_enabled)(struct _cef_view_t* self, int enabled);
|
||||
|
||||
///
|
||||
// Returns whether this View is enabled.
|
||||
///
|
||||
int (CEF_CALLBACK *is_enabled)(struct _cef_view_t* self);
|
||||
|
||||
///
|
||||
// Sets whether this View is capable of taking focus. It will clear focus if
|
||||
// the focused View is set to be non-focusable. This is false (0) by default
|
||||
// so that a View used as a container does not get the focus.
|
||||
///
|
||||
void (CEF_CALLBACK *set_focusable)(struct _cef_view_t* self, int focusable);
|
||||
|
||||
///
|
||||
// Returns true (1) if this View is focusable, enabled and drawn.
|
||||
///
|
||||
int (CEF_CALLBACK *is_focusable)(struct _cef_view_t* self);
|
||||
|
||||
///
|
||||
// Return whether this View is focusable when the user requires full keyboard
|
||||
// access, even though it may not be normally focusable.
|
||||
///
|
||||
int (CEF_CALLBACK *is_accessibility_focusable)(struct _cef_view_t* self);
|
||||
|
||||
///
|
||||
// Request keyboard focus. If this View is focusable it will become the
|
||||
// focused View.
|
||||
///
|
||||
void (CEF_CALLBACK *request_focus)(struct _cef_view_t* self);
|
||||
|
||||
///
|
||||
// Sets the background color for this View.
|
||||
///
|
||||
void (CEF_CALLBACK *set_background_color)(struct _cef_view_t* self,
|
||||
cef_color_t color);
|
||||
|
||||
///
|
||||
// Returns the background color for this View.
|
||||
///
|
||||
cef_color_t (CEF_CALLBACK *get_background_color)(struct _cef_view_t* self);
|
||||
|
||||
///
|
||||
// Convert |point| from this View's coordinate system to that of the screen.
|
||||
// This View must belong to a Window when calling this function. Returns true
|
||||
// (1) if the conversion is successful or false (0) otherwise. Use
|
||||
// cef_display_t::convert_point_to_pixels() after calling this function if
|
||||
// further conversion to display-specific pixel coordinates is desired.
|
||||
///
|
||||
int (CEF_CALLBACK *convert_point_to_screen)(struct _cef_view_t* self,
|
||||
cef_point_t* point);
|
||||
|
||||
///
|
||||
// Convert |point| to this View's coordinate system from that of the screen.
|
||||
// This View must belong to a Window when calling this function. Returns true
|
||||
// (1) if the conversion is successful or false (0) otherwise. Use
|
||||
// cef_display_t::convert_point_from_pixels() before calling this function if
|
||||
// conversion from display-specific pixel coordinates is necessary.
|
||||
///
|
||||
int (CEF_CALLBACK *convert_point_from_screen)(struct _cef_view_t* self,
|
||||
cef_point_t* point);
|
||||
|
||||
///
|
||||
// Convert |point| from this View's coordinate system to that of the Window.
|
||||
// This View must belong to a Window when calling this function. Returns true
|
||||
// (1) if the conversion is successful or false (0) otherwise.
|
||||
///
|
||||
int (CEF_CALLBACK *convert_point_to_window)(struct _cef_view_t* self,
|
||||
cef_point_t* point);
|
||||
|
||||
///
|
||||
// Convert |point| to this View's coordinate system from that of the Window.
|
||||
// This View must belong to a Window when calling this function. Returns true
|
||||
// (1) if the conversion is successful or false (0) otherwise.
|
||||
///
|
||||
int (CEF_CALLBACK *convert_point_from_window)(struct _cef_view_t* self,
|
||||
cef_point_t* point);
|
||||
|
||||
///
|
||||
// Convert |point| from this View's coordinate system to that of |view|.
|
||||
// |view| needs to be in the same Window but not necessarily the same view
|
||||
// hierarchy. Returns true (1) if the conversion is successful or false (0)
|
||||
// otherwise.
|
||||
///
|
||||
int (CEF_CALLBACK *convert_point_to_view)(struct _cef_view_t* self,
|
||||
struct _cef_view_t* view, cef_point_t* point);
|
||||
|
||||
///
|
||||
// Convert |point| to this View's coordinate system from that |view|. |view|
|
||||
// needs to be in the same Window but not necessarily the same view hierarchy.
|
||||
// Returns true (1) if the conversion is successful or false (0) otherwise.
|
||||
///
|
||||
int (CEF_CALLBACK *convert_point_from_view)(struct _cef_view_t* self,
|
||||
struct _cef_view_t* view, cef_point_t* point);
|
||||
} cef_view_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_VIEWS_CEF_VIEW_CAPI_H_
|
115
include/capi/views/cef_view_delegate_capi.h
Normal file
115
include/capi/views/cef_view_delegate_capi.h
Normal file
@@ -0,0 +1,115 @@
|
||||
// Copyright (c) 2016 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_VIEW_DELEGATE_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_VIEWS_CEF_VIEW_DELEGATE_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct _cef_view_t;
|
||||
|
||||
///
|
||||
// Implement this structure to handle view events. The functions of this
|
||||
// structure will be called on the browser process UI thread unless otherwise
|
||||
// indicated.
|
||||
///
|
||||
typedef struct _cef_view_delegate_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_t base;
|
||||
|
||||
///
|
||||
// Return the preferred size for |view|. The Layout will use this information
|
||||
// to determine the display size.
|
||||
///
|
||||
cef_size_t (CEF_CALLBACK *get_preferred_size)(
|
||||
struct _cef_view_delegate_t* self, struct _cef_view_t* view);
|
||||
|
||||
///
|
||||
// Return the minimum size for |view|.
|
||||
///
|
||||
cef_size_t (CEF_CALLBACK *get_minimum_size)(struct _cef_view_delegate_t* self,
|
||||
struct _cef_view_t* view);
|
||||
|
||||
///
|
||||
// Return the maximum size for |view|.
|
||||
///
|
||||
cef_size_t (CEF_CALLBACK *get_maximum_size)(struct _cef_view_delegate_t* self,
|
||||
struct _cef_view_t* view);
|
||||
|
||||
///
|
||||
// Return the height necessary to display |view| with the provided |width|. If
|
||||
// not specified the result of get_preferred_size().height will be used by
|
||||
// default. Override if |view|'s preferred height depends upon the width (for
|
||||
// example, with Labels).
|
||||
///
|
||||
int (CEF_CALLBACK *get_height_for_width)(struct _cef_view_delegate_t* self,
|
||||
struct _cef_view_t* view, int width);
|
||||
|
||||
///
|
||||
// Called when the parent of |view| has changed. If |view| is being added to
|
||||
// |parent| then |added| will be true (1). If |view| is being removed from
|
||||
// |parent| then |added| will be false (0). If |view| is being reparented the
|
||||
// remove notification will be sent before the add notification. Do not modify
|
||||
// the view hierarchy in this callback.
|
||||
///
|
||||
void (CEF_CALLBACK *on_parent_view_changed)(struct _cef_view_delegate_t* self,
|
||||
struct _cef_view_t* view, int added, struct _cef_view_t* parent);
|
||||
|
||||
///
|
||||
// Called when a child of |view| has changed. If |child| is being added to
|
||||
// |view| then |added| will be true (1). If |child| is being removed from
|
||||
// |view| then |added| will be false (0). If |child| is being reparented the
|
||||
// remove notification will be sent to the old parent before the add
|
||||
// notification is sent to the new parent. Do not modify the view hierarchy in
|
||||
// this callback.
|
||||
///
|
||||
void (CEF_CALLBACK *on_child_view_changed)(struct _cef_view_delegate_t* self,
|
||||
struct _cef_view_t* view, int added, struct _cef_view_t* child);
|
||||
} cef_view_delegate_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_VIEWS_CEF_VIEW_DELEGATE_CAPI_H_
|
286
include/capi/views/cef_window_capi.h
Normal file
286
include/capi/views/cef_window_capi.h
Normal file
@@ -0,0 +1,286 @@
|
||||
// Copyright (c) 2016 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_WINDOW_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_VIEWS_CEF_WINDOW_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/cef_image_capi.h"
|
||||
#include "include/capi/cef_menu_model_capi.h"
|
||||
#include "include/capi/views/cef_display_capi.h"
|
||||
#include "include/capi/views/cef_panel_capi.h"
|
||||
#include "include/capi/views/cef_window_delegate_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
///
|
||||
// A Window is a top-level Window/widget in the Views hierarchy. By default it
|
||||
// will have a non-client area with title bar, icon and buttons that supports
|
||||
// moving and resizing. All size and position values are in density independent
|
||||
// pixels (DIP) unless otherwise indicated. Methods must be called on the
|
||||
// browser process UI thread unless otherwise indicated.
|
||||
///
|
||||
typedef struct _cef_window_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_panel_t base;
|
||||
|
||||
///
|
||||
// Show the Window.
|
||||
///
|
||||
void (CEF_CALLBACK *show)(struct _cef_window_t* self);
|
||||
|
||||
///
|
||||
// Hide the Window.
|
||||
///
|
||||
void (CEF_CALLBACK *hide)(struct _cef_window_t* self);
|
||||
|
||||
///
|
||||
// Sizes the Window to |size| and centers it in the current display.
|
||||
///
|
||||
void (CEF_CALLBACK *center_window)(struct _cef_window_t* self,
|
||||
const cef_size_t* size);
|
||||
|
||||
///
|
||||
// Close the Window.
|
||||
///
|
||||
void (CEF_CALLBACK *close)(struct _cef_window_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if the Window has been closed.
|
||||
///
|
||||
int (CEF_CALLBACK *is_closed)(struct _cef_window_t* self);
|
||||
|
||||
///
|
||||
// Activate the Window, assuming it already exists and is visible.
|
||||
///
|
||||
void (CEF_CALLBACK *activate)(struct _cef_window_t* self);
|
||||
|
||||
///
|
||||
// Deactivate the Window, making the next Window in the Z order the active
|
||||
// Window.
|
||||
///
|
||||
void (CEF_CALLBACK *deactivate)(struct _cef_window_t* self);
|
||||
|
||||
///
|
||||
// Returns whether the Window is the currently active Window.
|
||||
///
|
||||
int (CEF_CALLBACK *is_active)(struct _cef_window_t* self);
|
||||
|
||||
///
|
||||
// Bring this Window to the top of other Windows in the Windowing system.
|
||||
///
|
||||
void (CEF_CALLBACK *bring_to_top)(struct _cef_window_t* self);
|
||||
|
||||
///
|
||||
// Set the Window to be on top of other Windows in the Windowing system.
|
||||
///
|
||||
void (CEF_CALLBACK *set_always_on_top)(struct _cef_window_t* self,
|
||||
int on_top);
|
||||
|
||||
///
|
||||
// Returns whether the Window has been set to be on top of other Windows in
|
||||
// the Windowing system.
|
||||
///
|
||||
int (CEF_CALLBACK *is_always_on_top)(struct _cef_window_t* self);
|
||||
|
||||
///
|
||||
// Maximize the Window.
|
||||
///
|
||||
void (CEF_CALLBACK *maximize)(struct _cef_window_t* self);
|
||||
|
||||
///
|
||||
// Minimize the Window.
|
||||
///
|
||||
void (CEF_CALLBACK *minimize)(struct _cef_window_t* self);
|
||||
|
||||
///
|
||||
// Restore the Window.
|
||||
///
|
||||
void (CEF_CALLBACK *restore)(struct _cef_window_t* self);
|
||||
|
||||
///
|
||||
// Set fullscreen Window state.
|
||||
///
|
||||
void (CEF_CALLBACK *set_fullscreen)(struct _cef_window_t* self,
|
||||
int fullscreen);
|
||||
|
||||
///
|
||||
// Returns true (1) if the Window is maximized.
|
||||
///
|
||||
int (CEF_CALLBACK *is_maximized)(struct _cef_window_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if the Window is minimized.
|
||||
///
|
||||
int (CEF_CALLBACK *is_minimized)(struct _cef_window_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if the Window is fullscreen.
|
||||
///
|
||||
int (CEF_CALLBACK *is_fullscreen)(struct _cef_window_t* self);
|
||||
|
||||
///
|
||||
// Set the Window title.
|
||||
///
|
||||
void (CEF_CALLBACK *set_title)(struct _cef_window_t* self,
|
||||
const cef_string_t* title);
|
||||
|
||||
///
|
||||
// Get the Window title.
|
||||
///
|
||||
// The resulting string must be freed by calling cef_string_userfree_free().
|
||||
cef_string_userfree_t (CEF_CALLBACK *get_title)(struct _cef_window_t* self);
|
||||
|
||||
///
|
||||
// Set the Window icon. This should be a 16x16 icon suitable for use in the
|
||||
// Windows's title bar.
|
||||
///
|
||||
void (CEF_CALLBACK *set_window_icon)(struct _cef_window_t* self,
|
||||
struct _cef_image_t* image);
|
||||
|
||||
///
|
||||
// Get the Window icon.
|
||||
///
|
||||
struct _cef_image_t* (CEF_CALLBACK *get_window_icon)(
|
||||
struct _cef_window_t* self);
|
||||
|
||||
///
|
||||
// Set the Window App icon. This should be a larger icon for use in the host
|
||||
// environment app switching UI. On Windows, this is the ICON_BIG used in Alt-
|
||||
// Tab list and Windows taskbar. The Window icon will be used by default if no
|
||||
// Window App icon is specified.
|
||||
///
|
||||
void (CEF_CALLBACK *set_window_app_icon)(struct _cef_window_t* self,
|
||||
struct _cef_image_t* image);
|
||||
|
||||
///
|
||||
// Get the Window App icon.
|
||||
///
|
||||
struct _cef_image_t* (CEF_CALLBACK *get_window_app_icon)(
|
||||
struct _cef_window_t* self);
|
||||
|
||||
///
|
||||
// Show a menu with contents |menu_model|. |screen_point| specifies the menu
|
||||
// position in screen coordinates. |anchor_position| specifies how the menu
|
||||
// will be anchored relative to |screen_point|.
|
||||
///
|
||||
void (CEF_CALLBACK *show_menu)(struct _cef_window_t* self,
|
||||
struct _cef_menu_model_t* menu_model, const cef_point_t* screen_point,
|
||||
cef_menu_anchor_position_t anchor_position);
|
||||
|
||||
///
|
||||
// Cancel the menu that is currently showing, if any.
|
||||
///
|
||||
void (CEF_CALLBACK *cancel_menu)(struct _cef_window_t* self);
|
||||
|
||||
///
|
||||
// Returns the Display that most closely intersects the bounds of this Window.
|
||||
// May return NULL if this Window is not currently displayed.
|
||||
///
|
||||
struct _cef_display_t* (CEF_CALLBACK *get_display)(
|
||||
struct _cef_window_t* self);
|
||||
|
||||
///
|
||||
// Returns the bounds (size and position) of this Window's client area.
|
||||
// Position is in screen coordinates.
|
||||
///
|
||||
cef_rect_t (CEF_CALLBACK *get_client_area_bounds_in_screen)(
|
||||
struct _cef_window_t* self);
|
||||
|
||||
///
|
||||
// Set the regions where mouse events will be intercepted by this Window to
|
||||
// support drag operations. Call this function with an NULL vector to clear
|
||||
// the draggable regions. The draggable region bounds should be in window
|
||||
// coordinates.
|
||||
///
|
||||
void (CEF_CALLBACK *set_draggable_regions)(struct _cef_window_t* self,
|
||||
size_t regionsCount, cef_draggable_region_t const* regions);
|
||||
|
||||
///
|
||||
// Retrieve the platform window handle for this Window.
|
||||
///
|
||||
cef_window_handle_t (CEF_CALLBACK *get_window_handle)(
|
||||
struct _cef_window_t* self);
|
||||
|
||||
///
|
||||
// Simulate a key press. |key_code| is the VKEY_* value from Chromium's
|
||||
// ui/events/keycodes/keyboard_codes.h header (VK_* values on Windows).
|
||||
// |event_flags| is some combination of EVENTFLAG_SHIFT_DOWN,
|
||||
// EVENTFLAG_CONTROL_DOWN and/or EVENTFLAG_ALT_DOWN. This function is exposed
|
||||
// primarily for testing purposes.
|
||||
///
|
||||
void (CEF_CALLBACK *send_key_press)(struct _cef_window_t* self, int key_code,
|
||||
uint32 event_flags);
|
||||
|
||||
///
|
||||
// Simulate a mouse move. The mouse cursor will be moved to the specified
|
||||
// (screen_x, screen_y) position. This function is exposed primarily for
|
||||
// testing purposes.
|
||||
///
|
||||
void (CEF_CALLBACK *send_mouse_move)(struct _cef_window_t* self, int screen_x,
|
||||
int screen_y);
|
||||
|
||||
///
|
||||
// Simulate mouse down and/or mouse up events. |button| is the mouse button
|
||||
// type. If |mouse_down| is true (1) a mouse down event will be sent. If
|
||||
// |mouse_up| is true (1) a mouse up event will be sent. If both are true (1)
|
||||
// a mouse down event will be sent followed by a mouse up event (equivalent to
|
||||
// clicking the mouse button). The events will be sent using the current
|
||||
// cursor position so make sure to call send_mouse_move() first to position
|
||||
// the mouse. This function is exposed primarily for testing purposes.
|
||||
///
|
||||
void (CEF_CALLBACK *send_mouse_events)(struct _cef_window_t* self,
|
||||
cef_mouse_button_type_t button, int mouse_down, int mouse_up);
|
||||
} cef_window_t;
|
||||
|
||||
|
||||
///
|
||||
// Create a new Window.
|
||||
///
|
||||
CEF_EXPORT cef_window_t* cef_window_create_top_level(
|
||||
struct _cef_window_delegate_t* delegate);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_VIEWS_CEF_WINDOW_CAPI_H_
|
113
include/capi/views/cef_window_delegate_capi.h
Normal file
113
include/capi/views/cef_window_delegate_capi.h
Normal file
@@ -0,0 +1,113 @@
|
||||
// Copyright (c) 2016 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_WINDOW_DELEGATE_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_VIEWS_CEF_WINDOW_DELEGATE_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/views/cef_panel_delegate_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct _cef_window_t;
|
||||
|
||||
///
|
||||
// Implement this structure to handle window events. The functions of this
|
||||
// structure will be called on the browser process UI thread unless otherwise
|
||||
// indicated.
|
||||
///
|
||||
typedef struct _cef_window_delegate_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_panel_delegate_t base;
|
||||
|
||||
///
|
||||
// Called when |window| is created.
|
||||
///
|
||||
void (CEF_CALLBACK *on_window_created)(struct _cef_window_delegate_t* self,
|
||||
struct _cef_window_t* window);
|
||||
|
||||
///
|
||||
// Called when |window| is destroyed. Release all references to |window| and
|
||||
// do not attempt to execute any functions on |window| after this callback
|
||||
// returns.
|
||||
///
|
||||
void (CEF_CALLBACK *on_window_destroyed)(struct _cef_window_delegate_t* self,
|
||||
struct _cef_window_t* window);
|
||||
|
||||
///
|
||||
// Return true (1) if |window| should be created without a frame or title bar.
|
||||
// The window will be resizable if can_resize() returns true (1). Use
|
||||
// cef_window_t::set_draggable_regions() to specify draggable regions.
|
||||
///
|
||||
int (CEF_CALLBACK *is_frameless)(struct _cef_window_delegate_t* self,
|
||||
struct _cef_window_t* window);
|
||||
|
||||
///
|
||||
// Return true (1) if |window| can be resized.
|
||||
///
|
||||
int (CEF_CALLBACK *can_resize)(struct _cef_window_delegate_t* self,
|
||||
struct _cef_window_t* window);
|
||||
|
||||
///
|
||||
// Return true (1) if |window| can be maximized.
|
||||
///
|
||||
int (CEF_CALLBACK *can_maximize)(struct _cef_window_delegate_t* self,
|
||||
struct _cef_window_t* window);
|
||||
|
||||
///
|
||||
// Return true (1) if |window| can be minimized.
|
||||
///
|
||||
int (CEF_CALLBACK *can_minimize)(struct _cef_window_delegate_t* self,
|
||||
struct _cef_window_t* window);
|
||||
|
||||
///
|
||||
// Return true (1) if |window| can be closed. This will be called for user-
|
||||
// initiated window close actions and when cef_window_t::close() is called.
|
||||
///
|
||||
int (CEF_CALLBACK *can_close)(struct _cef_window_delegate_t* self,
|
||||
struct _cef_window_t* window);
|
||||
} cef_window_delegate_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_VIEWS_CEF_WINDOW_DELEGATE_CAPI_H_
|
Reference in New Issue
Block a user