Blender V5.0
GHOST_SystemX11.cc File Reference
#include <X11/XKBlib.h>
#include <X11/Xatom.h>
#include <X11/Xutil.h>
#include <X11/keysym.h>
#include "GHOST_EventButton.hh"
#include "GHOST_EventCursor.hh"
#include "GHOST_EventDragnDrop.hh"
#include "GHOST_EventKey.hh"
#include "GHOST_EventWheel.hh"
#include "GHOST_SystemX11.hh"
#include "GHOST_TimerManager.hh"
#include "GHOST_WindowManager.hh"
#include "GHOST_WindowX11.hh"
#include "GHOST_utildefines.hh"
#include "GHOST_Debug.hh"
#include <sys/time.h>
#include <unistd.h>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <vector>

Go to the source code of this file.

Classes

struct  init_timestamp_data
class  DialogData

Macros

#define USE_UNITY_WORKAROUND
#define USE_NON_LATIN_KB_WORKAROUND
#define GHOST_INTERN_ATOM_IF_EXISTS(atom)
#define GHOST_INTERN_ATOM(atom)
#define GXMAP(k, x, y)
#define MAKE_ID(a, b, c, d)
#define XCLIB_XCOUT_NONE   0 /* no context */
#define XCLIB_XCOUT_SENTCONVSEL   1 /* sent a request */
#define XCLIB_XCOUT_INCR   2 /* in an incr loop */
#define XCLIB_XCOUT_FALLBACK   3 /* STRING failed, need fallback to UTF8 */
#define XCLIB_XCOUT_FALLBACK_UTF8   4 /* UTF8 failed, move to compound. */
#define XCLIB_XCOUT_FALLBACK_COMP   5 /* compound failed, move to text. */
#define XCLIB_XCOUT_FALLBACK_TEXT   6

Functions

static uchar bit_is_on (const uchar *ptr, int bit)
static GHOST_TKey ghost_key_from_keysym (const KeySym key)
static GHOST_TKey ghost_key_from_keycode (const XkbDescPtr xkb_descr, const KeyCode keycode)
static GHOST_TKey ghost_key_from_keysym_or_keycode (const KeySym key_sym, const XkbDescPtr xkb_descr, const KeyCode keycode)
static void SleepTillEvent (Display *display, int64_t maxSleep)
static Bool init_timestamp_scanner (Display *, XEvent *event, XPointer arg)
static GHOST_TSuccess getCursorPosition_impl (Display *display, int32_t &x, int32_t &y, Window *child_return)
int GHOST_X11_ApplicationErrorHandler (Display *display, XErrorEvent *event)
int GHOST_X11_ApplicationIOErrorHandler (Display *)
Message Box
static void split (const char *text, const char *seps, char ***str, int *count)

Variables

static char * txt_cut_buffer = nullptr
static char * txt_select_buffer = nullptr

Macro Definition Documentation

◆ GHOST_INTERN_ATOM

#define GHOST_INTERN_ATOM ( atom)
Value:
{ \
atom_.atom = XInternAtom(display_, #atom, False); \
} \
(void)0

Referenced by GHOST_SystemX11::GHOST_SystemX11().

◆ GHOST_INTERN_ATOM_IF_EXISTS

#define GHOST_INTERN_ATOM_IF_EXISTS ( atom)
Value:
{ \
atom_.atom = XInternAtom(display_, #atom, True); \
} \
(void)0

Referenced by GHOST_SystemX11::GHOST_SystemX11().

◆ GXMAP

#define GXMAP ( k,
x,
y )
Value:

Definition at line 1867 of file GHOST_SystemX11.cc.

Referenced by ghost_key_from_keysym().

◆ MAKE_ID

#define MAKE_ID ( a,
b,
c,
d )
Value:
(int(d) << 24 | int(c) << 16 | (b) << 8 | (a))

Definition at line 1997 of file GHOST_SystemX11.cc.

Referenced by ghost_key_from_keycode().

◆ USE_NON_LATIN_KB_WORKAROUND

#define USE_NON_LATIN_KB_WORKAROUND

Definition at line 82 of file GHOST_SystemX11.cc.

◆ USE_UNITY_WORKAROUND

#define USE_UNITY_WORKAROUND

Definition at line 78 of file GHOST_SystemX11.cc.

◆ XCLIB_XCOUT_FALLBACK

#define XCLIB_XCOUT_FALLBACK   3 /* STRING failed, need fallback to UTF8 */

Definition at line 2030 of file GHOST_SystemX11.cc.

Referenced by GHOST_SystemX11::getClipboard().

◆ XCLIB_XCOUT_FALLBACK_COMP

#define XCLIB_XCOUT_FALLBACK_COMP   5 /* compound failed, move to text. */

◆ XCLIB_XCOUT_FALLBACK_TEXT

#define XCLIB_XCOUT_FALLBACK_TEXT   6

◆ XCLIB_XCOUT_FALLBACK_UTF8

#define XCLIB_XCOUT_FALLBACK_UTF8   4 /* UTF8 failed, move to compound. */

◆ XCLIB_XCOUT_INCR

#define XCLIB_XCOUT_INCR   2 /* in an incr loop */

Definition at line 2029 of file GHOST_SystemX11.cc.

Referenced by GHOST_SystemX11::getClipboard_xcout().

◆ XCLIB_XCOUT_NONE

#define XCLIB_XCOUT_NONE   0 /* no context */

◆ XCLIB_XCOUT_SENTCONVSEL

#define XCLIB_XCOUT_SENTCONVSEL   1 /* sent a request */

Definition at line 2028 of file GHOST_SystemX11.cc.

Referenced by GHOST_SystemX11::getClipboard_xcout().

Function Documentation

◆ bit_is_on()

uchar bit_is_on ( const uchar * ptr,
int bit )
static

Definition at line 84 of file GHOST_SystemX11.cc.

References ptr.

◆ getCursorPosition_impl()

GHOST_TSuccess getCursorPosition_impl ( Display * display,
int32_t & x,
int32_t & y,
Window * child_return )
static

◆ ghost_key_from_keycode()

GHOST_TKey ghost_key_from_keycode ( const XkbDescPtr xkb_descr,
const KeyCode keycode )
static

◆ ghost_key_from_keysym()

GHOST_TKey ghost_key_from_keysym ( const KeySym key)
static

◆ ghost_key_from_keysym_or_keycode()

GHOST_TKey ghost_key_from_keysym_or_keycode ( const KeySym key_sym,
const XkbDescPtr xkb_descr,
const KeyCode keycode )
static

◆ GHOST_X11_ApplicationErrorHandler()

int GHOST_X11_ApplicationErrorHandler ( Display * display,
XErrorEvent * event )

These callbacks can be used for debugging, so we can break-point on an X11 error.

Dummy function to get around IO Handler exiting if device invalid Basically it will not crash blender now if you have a X device that is configured but not plugged in.

Definition at line 2636 of file GHOST_SystemX11.cc.

References Display, GHOST_ISystem::getSystem(), and GHOST_ISystem::isDebugEnabled().

Referenced by GHOST_SystemX11::GHOST_SystemX11().

◆ GHOST_X11_ApplicationIOErrorHandler()

int GHOST_X11_ApplicationIOErrorHandler ( Display * display)

◆ init_timestamp_scanner()

Bool init_timestamp_scanner ( Display * ,
XEvent * event,
XPointer arg )
static

Definition at line 549 of file GHOST_SystemX11.cc.

References data, and Display.

◆ SleepTillEvent()

void SleepTillEvent ( Display * display,
int64_t maxSleep )
static

Definition at line 523 of file GHOST_SystemX11.cc.

References Display, and select.

Referenced by GHOST_SystemX11::processEvents().

◆ split()

void split ( const char * text,
const char * seps,
char *** str,
int * count )
static

Definition at line 2472 of file GHOST_SystemX11.cc.

References count, data, free(), i, and str.

Referenced by Freestyle::__recursiveSplit(), Freestyle::__recursiveSplit(), blender::nodes::add_attribute_search_or_value_buttons(), blender::nodes::add_layer_name_search_button(), adduplicateflagNurb(), area_split(), bchunk_list_ensure_min_size_last(), BKE_unit_value_as_string_adaptive(), block_create__close_file_dialog(), block_create_autorun_warning(), block_create_save_file_overwrite_dialog(), BM_edgeloop_expand(), BVHBuild::build_node(), blender::bke::pbvh::build_nodes_recursive_grids(), blender::bke::pbvh::build_nodes_recursive_mesh(), blender::nodes::node_composite_colorbalance_cc::cmp_node_colorbalance_declare(), blender::seq::colorBalance_panel_draw(), colorband_buttons_layout(), curve_delete_segments(), curvemap_buttons_layout(), EdgeDice::dice(), blender::nodes::draw_named_attributes_panel(), blender::nodes::draw_property_for_output_socket(), ed_preview_draw_rect(), generator_panel_draw(), blender::io::usd::get_asset_base_name(), get_dface(), graph_panel_key_properties(), MOD_solidify_nonmanifold_modifyMesh(), blender::ed::space_node::node_buts_image_user(), panel_draw(), blender::bke::pbvh::partition_along_axis(), blender::bke::partition_faces_recursively(), blender::bke::pbvh::partition_material_indices(), uiLayout::prop(), uiLayout::props_enum(), remap_faces_15(), remap_faces_19_21_22(), remap_faces_23(), remap_faces_3_6_9_12(), remap_faces_5_10(), remap_faces_7_11_13_14(), remap_uvs_15(), remap_uvs_19_21_22(), remap_uvs_23(), remap_uvs_3_6_9_12(), remap_uvs_5_10(), remap_uvs_7_11_13_14(), remdoubles_splitface(), screen_draw_dock_preview(), selectend_nurb(), shader_preview_render(), GHOST_SystemX11::showMessageBox(), blender::seq::sound_equalizermodifier_draw(), sound_mixdown_exec(), blender::gpu::shader::Preprocessor::split_string_not_between_balanced_pair(), Mesh::tessellate(), ui_alert_create(), ui_def_but_rna__menu(), blender::ed::space_node::ui_template_node_link_menu(), uiTemplateAnyID(), uiTemplateMovieClip(), undo_history_draw_menu(), unit_as_string_main(), v3d_transform_butsR(), view3d_panel_curve_data(), view3d_panel_vgroup(), wm_block_insert_unicode_create(), and wm_block_splash_create().

Variable Documentation

◆ txt_cut_buffer

char* txt_cut_buffer = nullptr
static

◆ txt_select_buffer

char* txt_select_buffer = nullptr
static