NekoWM
A gfxprim proxy backend tiling window manager
Loading...
Searching...
No Matches
Data Structures | Typedefs | Enumerations | Functions
neko_view.h File Reference

View is an abstraction for a piece of a screen. More...

#include <core/gp_core.h>
#include <backends/gp_types.h>

Go to the source code of this file.

Data Structures

struct  neko_view_slot_ops
 A view slot ops. More...
 
struct  neko_view_slot
 A view slot content. More...
 
struct  neko_view
 View a part of a screen. More...
 

Typedefs

typedef struct neko_view_slot_ops neko_view_slot_ops
 A view slot ops.
 
typedef struct neko_view_slot neko_view_slot
 A view slot content.
 
typedef struct neko_view neko_view
 View a part of a screen.
 

Enumerations

enum  neko_view_split_mode
 A split mode. More...
 

Functions

neko_viewneko_view_focused_child (neko_view *self)
 Returns view focused child.
 
int neko_view_is_focused (neko_view *self)
 Returns true if view is focused.
 
static void neko_view_slot_exit (neko_view *self)
 Child did exit.
 
void neko_view_update_rect (neko_view *self, gp_coord x, gp_coord y, gp_size w, gp_size h)
 Update rectangle in the view on the screen.
 
void neko_view_flip (neko_view *self)
 Update whole view on the screen.
 
void neko_view_slot_put (neko_view *self, neko_view_slot *slot)
 Fills in a slot in a neko view.
 
void neko_view_event (neko_view *self, gp_event *ev)
 Sends an input event to a view child.
 
gp_pixmap * neko_view_pixmap (neko_view *self)
 Returns a pixmap for the view.
 
void neko_view_resize (neko_view *self, gp_size w, gp_size h)
 Resizes the view recursively along with all slots.
 
void neko_view_repaint (neko_view *self)
 Request a view repaint.
 

Detailed Description

View is an abstraction for a piece of a screen.

View can be divided into subviews recursively.

Each view has a slot, if slot is not empty the screen is taken over by the slot content.

Definition in file neko_view.h.

Typedef Documentation

◆ neko_view_slot

A view slot content.

Something to be shown in the view on the screen.

◆ neko_view_slot_ops

A view slot ops.

Callback to render a slot content.

Enumeration Type Documentation

◆ neko_view_split_mode

A split mode.

If view is split it can be split either horizontally or vertically.

Definition at line 31 of file neko_view.h.

Function Documentation

◆ neko_view_event()

void neko_view_event ( neko_view self,
gp_event *  ev 
)

Sends an input event to a view child.

Parameters
selfA neko view.
evAn input event.

◆ neko_view_flip()

void neko_view_flip ( neko_view self)

Update whole view on the screen.

This is called by the child when content needs to be updated from the view pixmap and painted on the screen.

Parameters
selfA neko view.

◆ neko_view_focused_child()

neko_view * neko_view_focused_child ( neko_view self)

Returns view focused child.

Parameters
selfA neko view.
Returns
Focused child, or NULL if view does not have any children.

◆ neko_view_is_focused()

int neko_view_is_focused ( neko_view self)

Returns true if view is focused.

Parameters
selfA neko view.
Returns
Returns true if view is focused.

◆ neko_view_pixmap()

gp_pixmap * neko_view_pixmap ( neko_view self)

Returns a pixmap for the view.

Parameters
selfA neko view.

◆ neko_view_repaint()

void neko_view_repaint ( neko_view self)

Request a view repaint.

Needs to be called after resize on view(s) shown on the screen(s).

Parameters
selfA view to be repainted.

◆ neko_view_resize()

void neko_view_resize ( neko_view self,
gp_size  w,
gp_size  h 
)

Resizes the view recursively along with all slots.

Parameters
selfA neko view.
wNew width.
hNew height.

◆ neko_view_slot_exit()

static void neko_view_slot_exit ( neko_view self)
inlinestatic

Child did exit.

This is called by a child when it did exit. The view should replace the child with a different one (if possible) in the handler.

Parameters
selfA neko view.

Definition at line 178 of file neko_view.h.

References neko_view::slot, and neko_view::slot_exit.

◆ neko_view_slot_put()

void neko_view_slot_put ( neko_view self,
neko_view_slot slot 
)

Fills in a slot in a neko view.

Sets a new view slot content, possibly replaces currently shown content. If slot is NULL the view becomes empty.

Parameters
selfA neko view.
slotA new neko view slot content to be shonw in the view.

◆ neko_view_update_rect()

void neko_view_update_rect ( neko_view self,
gp_coord  x,
gp_coord  y,
gp_size  w,
gp_size  h 
)

Update rectangle in the view on the screen.

This is called by the child when content needs to be updated from the view pixmap and painted on the screen.

Parameters
selfA neko view.