girara
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Macros | Functions
session.c File Reference
#include <stdlib.h>
#include <glib/gi18n-lib.h>
#include "session.h"
#include "settings.h"
#include "datastructures.h"
#include "internal.h"
#include "commands.h"
#include "callbacks.h"
#include "shortcuts.h"
#include "config.h"
#include "utils.h"
#include "input-history.h"

Go to the source code of this file.

Macros

#define DO_PRAGMA(x)
#define IGNORE_DEPRECATED
#define UNIGNORE   DO_PRAGMA(GCC diagnostic pop)

Functions

girara_session_t * girara_session_create ()
bool girara_session_init (girara_session_t *session, const char *sessionname)
bool girara_session_destroy (girara_session_t *session)
char * girara_buffer_get (girara_session_t *session)
void girara_notify (girara_session_t *session, int level, const char *format,...)
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)
bool girara_set_view (girara_session_t *session, GtkWidget *widget)
void girara_mode_set (girara_session_t *session, girara_mode_t mode)
girara_mode_t girara_mode_add (girara_session_t *session, const char *name)
void girara_mode_string_free (girara_mode_string_t *mode)
girara_mode_t girara_mode_get (girara_session_t *session)
bool girara_set_window_title (girara_session_t *session, const char *name)
girara_list_t * girara_get_command_history (girara_session_t *session)

Macro Definition Documentation

#define DO_PRAGMA (   x)

Definition at line 20 of file session.c.

#define IGNORE_DEPRECATED
Value:
DO_PRAGMA(GCC diagnostic push) \
DO_PRAGMA(GCC diagnostic ignored "-Wdeprecated-declarations")

Definition at line 23 of file session.c.

#define UNIGNORE   DO_PRAGMA(GCC diagnostic pop)

Definition at line 26 of file session.c.

Function Documentation

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

Definition at line 501 of file session.c.

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

Definition at line 563 of file session.c.

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

Definition at line 677 of file session.c.

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

Definition at line 624 of file session.c.

girara_mode_t girara_mode_get ( girara_session_t *  session)

Returns the current mode

Parameters
sessionThe used girara session
Returns
The current mode

Definition at line 657 of file session.c.

void girara_mode_set ( girara_session_t *  session,
girara_mode_t  mode 
)

Sets the current mode

Parameters
sessionThe used girara session
modeThe new mode

Definition at line 616 of file session.c.

void girara_mode_string_free ( girara_mode_string_t *  mode)

Definition at line 646 of file session.c.

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

Definition at line 509 of file session.c.

girara_session_t* girara_session_create ( )

Creates a girara session

Returns
A valid session object
NULL when an error occured

Definition at line 47 of file session.c.

bool girara_session_destroy ( girara_session_t *  session)

Destroys an girara session

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

Definition at line 422 of file session.c.

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 occured
FALSE An error occured

Definition at line 129 of file session.c.

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 occured
FALSE An error occured

Definition at line 597 of file session.c.

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 occured
false if an error occured

Definition at line 665 of file session.c.