girara
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Data Structures | Functions | Variables
session.h File Reference
#include "types.h"
#include "macros.h"
#include "callbacks.h"
#include <gtk/gtk.h>
#include <gtk/gtkx.h>
#include <gdk/gdkkeysyms.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
 

Functions

girara_session_t * girara_session_create ()
 
bool girara_session_init (girara_session_t *session, const char *appname)
 
bool girara_session_destroy (girara_session_t *session)
 
bool girara_set_view (girara_session_t *session, GtkWidget *widget)
 
char * girara_buffer_get (girara_session_t *session)
 
void girara_libnotify (girara_session_t *session, const char *summary, const char *body)
 
void girara_notify (girara_session_t *session, int level, const char *format,...) GIRARA_PRINTF(3
 
void 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_mode_t girara_mode_add (girara_session_t *session, const char *name)
 
void girara_mode_set (girara_session_t *session, girara_mode_t mode)
 
girara_mode_t girara_mode_get (girara_session_t *session)
 
bool girara_set_window_title (girara_session_t *session, const char *name)
 
bool girara_set_window_icon (girara_session_t *session, const char *name)
 
girara_list_t * girara_get_command_history (girara_session_t *session)
 
GiraraTemplate * girara_session_get_template (girara_session_t *session)
 

Variables

GdkRGBA default_foreground
 
GdkRGBA default_background
 
GdkRGBA inputbar_foreground
 
GdkRGBA inputbar_background
 
GdkRGBA statusbar_foreground
 
GdkRGBA statusbar_background
 
GdkRGBA completion_foreground
 
GdkRGBA completion_background
 
GdkRGBA completion_group_foreground
 
GdkRGBA completion_group_background
 
GdkRGBA completion_highlight_foreground
 
GdkRGBA completion_highlight_background
 
GdkRGBA notification_error_foreground
 
GdkRGBA notification_error_background
 
GdkRGBA notification_warning_foreground
 
GdkRGBA notification_warning_background
 
GdkRGBA notification_default_foreground
 
GdkRGBA notification_default_background
 
GdkRGBA tabbar_foreground
 
GdkRGBA tabbar_background
 
GdkRGBA tabbar_focus_foreground
 
GdkRGBA tabbar_focus_background
 
PangoFontDescription * font
 

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 625 of file session.c.

void 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 746 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 872 of file session.c.

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

Definition at line 633 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 807 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 840 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 799 of file session.c.

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_t* girara_session_create ( )

Creates a girara session

Returns
A valid session object
NULL when an error occured

Definition at line 220 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 544 of file session.c.

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

Definition at line 879 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 307 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 780 of file session.c.

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

Definition at line 860 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 848 of file session.c.

Variable Documentation

GdkRGBA completion_background

The background color of a completion item

Definition at line 287 of file session.h.

GdkRGBA completion_foreground

The foreground color of a completion item

Definition at line 286 of file session.h.

GdkRGBA completion_group_background

The background color of a completion group entry

Definition at line 289 of file session.h.

GdkRGBA completion_group_foreground

The foreground color of a completion group entry

Definition at line 288 of file session.h.

GdkRGBA completion_highlight_background

The background color of a highlighted completion item

Definition at line 291 of file session.h.

GdkRGBA completion_highlight_foreground

The foreground color of a highlighted completion item

Definition at line 290 of file session.h.

GdkRGBA default_background

The default background color

Definition at line 281 of file session.h.

GdkRGBA default_foreground

The default foreground color

Definition at line 280 of file session.h.

PangoFontDescription* font

The used font

Definition at line 302 of file session.h.

GdkRGBA inputbar_background

The background color of the inputbar

Definition at line 283 of file session.h.

GdkRGBA inputbar_foreground

The foreground color of the inputbar

Definition at line 282 of file session.h.

GdkRGBA notification_default_background

The background color of a default notification

Definition at line 297 of file session.h.

GdkRGBA notification_default_foreground

The foreground color of a default notification

Definition at line 296 of file session.h.

GdkRGBA notification_error_background

The background color of an error notification

Definition at line 293 of file session.h.

GdkRGBA notification_error_foreground

The foreground color of an error notification

Definition at line 292 of file session.h.

GdkRGBA notification_warning_background

The background color of a warning notification

Definition at line 295 of file session.h.

GdkRGBA notification_warning_foreground

The foreground color of a warning notification

Definition at line 294 of file session.h.

GdkRGBA statusbar_background

The background color of the statusbar

Definition at line 285 of file session.h.

GdkRGBA statusbar_foreground

The foreground color of the statusbar

Definition at line 284 of file session.h.

GdkRGBA tabbar_background

The background color for a tab

Definition at line 299 of file session.h.

GdkRGBA tabbar_focus_background

The background color for a focused tab

Definition at line 301 of file session.h.

GdkRGBA tabbar_focus_foreground

The foreground color for a focused tab

Definition at line 300 of file session.h.

GdkRGBA tabbar_foreground

The foreground color for a tab

Definition at line 298 of file session.h.