Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CefCompositionUnderline"/> struct.
 /// </summary>
 /// <param name="range">The underline character range.</param>
 /// <param name="color">The text color.</param>
 /// <param name="backgroundColor">The background color.</param>
 /// <param name="thick">The thick underline.</param>
 public CefCompositionUnderline(CefRange range, CefColor color, CefColor backgroundColor, bool thick)
 {
     _instance = new cef_composition_underline_t
     {
         range            = range,
         color            = color,
         background_color = backgroundColor,
         thick            = thick ? 1 : 0,
     };
 }
Пример #2
0
        /// <summary>
        /// Completes the existing composition by optionally inserting the specified
        /// |text| into the composition node. |replacement_range| is an optional range
        /// of the existing text that will be replaced. |relative_cursor_pos| is where
        /// the cursor will be positioned relative to the current cursor position. See
        /// comments on ImeSetComposition for usage. The |replacement_range| and
        /// |relative_cursor_pos| values are only used on OS X. This function is only
        /// used when window rendering is disabled.
        /// </summary>
        public unsafe virtual void ImeCommitText(string text, CefRange replacementRange, int relativeCursorPos)
        {
            fixed(char *s0 = text)
            {
                var cstr0 = new cef_string_t {
                    Str = s0, Length = text != null ? text.Length : 0
                };

                NativeInstance->ImeCommitText(&cstr0, (cef_range_t *)&replacementRange, relativeCursorPos);
            }

            GC.KeepAlive(this);
        }
Пример #3
0
        /// <summary>
        /// Begins a new composition or updates the existing composition. Blink has a
        /// special node (a composition node) that allows the input function to change
        /// text without affecting other DOM nodes. |text| is the optional text that
        /// will be inserted into the composition node. |underlines| is an optional set
        /// of ranges that will be underlined in the resulting text.
        /// |replacement_range| is an optional range of the existing text that will be
        /// replaced. |selection_range| is an optional range of the resulting text that
        /// will be selected after insertion or replacement. The |replacement_range|
        /// value is only used on OS X.
        /// This function may be called multiple times as the composition changes. When
        /// the client is done making changes the composition should either be canceled
        /// or completed. To cancel the composition call ImeCancelComposition. To
        /// complete the composition call either ImeCommitText or
        /// ImeFinishComposingText. Completion is usually signaled when:
        /// A. The client receives a WM_IME_COMPOSITION message with a GCS_RESULTSTR
        /// flag (on Windows), or;
        /// B. The client receives a &quot;commit&quot; signal of GtkIMContext (on Linux), or;
        /// C. insertText of NSTextInput is called (on Mac).
        /// This function is only used when window rendering is disabled.
        /// </summary>
        public unsafe virtual void ImeSetComposition(string text, CefCompositionUnderline[] underlines, CefRange replacementRange, CefRange selectionRange)
        {
            fixed(char *s0 = text)
            fixed(CefCompositionUnderline * p2 = underlines)
            {
                var cstr0 = new cef_string_t {
                    Str = s0, Length = text != null ? text.Length : 0
                };

                NativeInstance->ImeSetComposition(&cstr0, new UIntPtr((uint)underlines.Length), (cef_composition_underline_t *)p2, (cef_range_t *)&replacementRange, (cef_range_t *)&selectionRange);
            }
            GC.KeepAlive(this);
        }