girara
Data Structures | Typedefs | Functions | Variables
session.h File Reference
#include "types.h"
#include "macros.h"
#include "callbacks.h"
#include <gtk/gtk.h>
Include dependency graph for session.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  girara_session_t
 

Typedefs

typedef int Window
 

Functions

girara_session_t * girara_session_create (void) GIRARA_VISIBLE
 
bool girara_session_init (girara_session_t *session, const char *appname) GIRARA_VISIBLE
 
bool girara_session_destroy (girara_session_t *session) GIRARA_VISIBLE
 
bool girara_set_view (girara_session_t *session, GtkWidget *widget) GIRARA_VISIBLE
 
char * girara_buffer_get (girara_session_t *session) GIRARA_VISIBLE
 
void girara_libnotify (girara_session_t *session, const char *summary, const char *body) GIRARA_VISIBLE GIRARA_DEPRECATED_
 
void girara_notify (girara_session_t *session, int level, const char *format,...) GIRARA_PRINTF(3
 
void girara_dialog (girara_session_t *session, const char *dialog, bool invisible, girara_callback_inputbar_key_press_event_t key_press_event, girara_callback_inputbar_activate_t activate_event, void *data) GIRARA_VISIBLE
 
girara_mode_t girara_mode_add (girara_session_t *session, const char *name) GIRARA_VISIBLE
 
void girara_mode_set (girara_session_t *session, girara_mode_t mode) GIRARA_VISIBLE
 
girara_mode_t girara_mode_get (girara_session_t *session) GIRARA_VISIBLE
 
bool girara_set_window_title (girara_session_t *session, const char *name) GIRARA_VISIBLE
 
bool girara_set_window_icon (girara_session_t *session, const char *name) GIRARA_VISIBLE
 
girara_list_tgirara_get_command_history (girara_session_t *session) GIRARA_VISIBLE
 
GiraraTemplate * girara_session_get_template (girara_session_t *session) GIRARA_VISIBLE
 
void girara_session_set_template (girara_session_t *session, GiraraTemplate *template, bool init_variables) GIRARA_VISIBLE
 

Variables

void GIRARA_VISIBLE
 

Typedef Documentation

◆ Window

typedef int Window

Definition at line 15 of file session.h.

Function Documentation

◆ girara_buffer_get()

char * girara_buffer_get ( girara_session_t *  session)

Returns a copy of the buffer

Parameters
sessionThe used girara session
Returns
Copy of the current buffer

◆ girara_dialog()

void girara_dialog ( girara_session_t *  session,
const char *  dialog,
bool  invisible,
girara_callback_inputbar_key_press_event_t  key_press_event,
girara_callback_inputbar_activate_t  activate_event,
void *  data 
)

Creates a girara dialog

Parameters
sessionThe girara session
dialogThe dialog message
invisibleSets the input visibility
key_press_eventCallback function to a custom key press event handler
activate_eventCallback function to a custom activate event handler
dataCustom data that is passed to the callback functions

◆ girara_get_command_history()

girara_list_t * girara_get_command_history ( girara_session_t *  session)

Returns the command history

Parameters
sessionThe used girara session
Returns
The command history (list of strings) or NULL

◆ girara_libnotify()

void girara_libnotify ( girara_session_t *  session,
const char *  summary,
const char *  body 
)

Displays a notification popup for the user using libnotify. Basic styling is allowed using Pango's markup format: https://developer.gnome.org/pango/stable/PangoMarkupFormat.html

Parameters
sessionThe girara session
summaryThe title
bodyThe content

◆ girara_mode_add()

girara_mode_t girara_mode_add ( girara_session_t *  session,
const char *  name 
)

Adds a new mode by its string identifier

Parameters
sessionThe used girara session
nameThe string identifier used in configs/inputbar etc to refer by
Returns
A newly defined girara_mode_t associated with name

◆ girara_mode_get()

girara_mode_t girara_mode_get ( girara_session_t *  session)

Returns the current mode

Parameters
sessionThe used girara session
Returns
The current mode

◆ girara_mode_set()

void girara_mode_set ( girara_session_t *  session,
girara_mode_t  mode 
)

Sets the current mode

Parameters
sessionThe used girara session
modeThe new mode

◆ girara_notify()

void girara_notify ( girara_session_t *  session,
int  level,
const char *  format,
  ... 
)

Displays a notification for the user. It is possible to pass GIRARA_INFO, GIRARA_WARNING or GIRARA_ERROR as a notification level.

Parameters
sessionThe girara session
levelThe level
formatString format
...

◆ girara_session_create()

girara_session_t * girara_session_create ( void  )

Creates a girara session

Returns
A valid session object
NULL when an error occurred

◆ girara_session_destroy()

bool girara_session_destroy ( girara_session_t *  session)

Destroys an girara session

Parameters
sessionThe used girara session
Returns
TRUE No error occurred
FALSE An error occurred

◆ girara_session_get_template()

GiraraTemplate * girara_session_get_template ( girara_session_t *  session)

Returns the internal template object to apply custom theming options

Parameters
sessionThe girara session
Returns
GiraraTemplate object

◆ girara_session_init()

bool girara_session_init ( girara_session_t *  session,
const char *  appname 
)

Initializes an girara session

Parameters
sessionThe used girara session
appnameName of the session (can be NULL)
Returns
TRUE No error occurred
FALSE An error occurred

◆ girara_session_set_template()

void girara_session_set_template ( girara_session_t *  session,
GiraraTemplate *  template,
bool  init_variables 
)

Replaces the internal template object, thus provides entirely user-defined styling.

Parameters
sessionThe girara session
templateThe template to apply, girara_template_new
init_variablesDefines whether the default variables and current values should be added to the the template
Note
Using the template girara_template_new("") will use the default gtk style

◆ girara_set_view()

bool girara_set_view ( girara_session_t *  session,
GtkWidget *  widget 
)

Sets the view widget of girara

Parameters
sessionThe used girara session
widgetThe widget that should be displayed
Returns
TRUE No error occurred
FALSE An error occurred

◆ girara_set_window_icon()

bool girara_set_window_icon ( girara_session_t *  session,
const char *  name 
)

Set icon of the window

Parameters
sessionThe used girara session
namethe name of the themed icon
Returns
true if no error occurred
false if an error occurred

◆ girara_set_window_title()

bool girara_set_window_title ( girara_session_t *  session,
const char *  name 
)

Set name of the window title

Parameters
sessionThe used girara session
nameThe new name of the session
Returns
true if no error occurred
false if an error occurred

Variable Documentation

◆ GIRARA_VISIBLE

void GIRARA_VISIBLE

Definition at line 155 of file session.h.