kiba-engine
Functions
window.c File Reference

Linux specific implementation of windowing functionality. More...

#include <kiba/platform/window.h>
#include <kiba/core/event.h>
#include <kiba/core/input.h>
#include <kiba/core/log.h>
#include <kiba/platform/linux/window.h>
#include <stdlib.h>
#include <string.h>
#include <xcb/xkb.h>
Include dependency graph for window.c:

Go to the source code of this file.

Functions

b8 window_create (platform_window *window, const char *title, u32 x, u32 y, u32 w, u32 h, allocator *alloc)
 Create a platform window. More...
 
void window_destroy (platform_window *window)
 Destroy platform window and clean up internal state. More...
 
key_code translate_keysym (xcb_keysym_t key_code)
 Translates xcb keysym to kiba key code. More...
 
key_code translate_button (xcb_button_t button)
 Translates xcb button to kiba key code. More...
 
b8 window_poll_events (platform_window *window)
 Poll for events emited by the window. More...
 

Detailed Description

Linux specific implementation of windowing functionality.

Definition in file window.c.

Function Documentation

◆ translate_button()

key_code translate_button ( xcb_button_t  button)

Translates xcb button to kiba key code.

Parameters
buttonthe code to traslate
Returns
the translated code, or KEY_CODE_MAX if no mapping available

Definition at line 486 of file window.c.

◆ translate_keysym()

key_code translate_keysym ( xcb_keysym_t  key_code)

Translates xcb keysym to kiba key code.

Parameters
key_codethe code to traslate
Returns
the translated code, or KEY_CODE_MAX if no mapping available

Definition at line 271 of file window.c.

◆ window_create()

b8 window_create ( platform_window window,
const char *  title,
u32  x,
u32  y,
u32  w,
u32  h,
allocator alloc 
)

Create a platform window.

Parameters
windowthe window to populate with data
titlethe text to display as the window title
xinitial horizontal position on the screen
yinitial vertical position on the screen
winitial width of the window
hinitial height of the window
Returns
false if any error occurs during creation, true if successful

Definition at line 17 of file window.c.

Here is the call graph for this function:

◆ window_destroy()

void window_destroy ( platform_window window)

Destroy platform window and clean up internal state.

Parameters
windowthe window to destroy and clean up

Definition at line 165 of file window.c.

Here is the call graph for this function:

◆ window_poll_events()

b8 window_poll_events ( platform_window window)

Poll for events emited by the window.

Will call into the input and event system.

Parameters
windowthe window to poll events from

Definition at line 197 of file window.c.

Here is the call graph for this function: