girara
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Macros | Functions
tabs.c File Reference
#include "tabs.h"
#include "session.h"
#include "internal.h"

Go to the source code of this file.

Macros

#define UNTITLED_TAB_TITLE   "untitled"
 

Functions

void girara_tabs_enable (girara_session_t *session)
 
girara_tab_t * girara_tab_new (girara_session_t *session, const char *title, GtkWidget *widget, bool next_to_current, void *data)
 
void girara_tab_remove (girara_session_t *session, girara_tab_t *tab)
 
girara_tab_t * girara_tab_get (girara_session_t *session, unsigned int index)
 
int girara_get_number_of_tabs (girara_session_t *session)
 
void girara_tab_update (girara_session_t *session)
 
girara_tab_t * girara_tab_current_get (girara_session_t *session)
 
void girara_tab_current_set (girara_session_t *session, girara_tab_t *tab)
 
void girara_tab_title_set (girara_tab_t *tab, const char *title)
 
const char * girara_tab_title_get (girara_tab_t *tab)
 
int girara_tab_position_get (girara_session_t *session, girara_tab_t *tab)
 
void girara_tab_position_set (girara_session_t *session, girara_tab_t *tab, unsigned int position)
 

Macro Definition Documentation

#define UNTITLED_TAB_TITLE   "untitled"

Definition at line 7 of file tabs.c.

Function Documentation

int girara_get_number_of_tabs ( girara_session_t *  session)

Returns the number of tabs

Parameters
sessionThe girara session
Returns
The number of tabs

Definition at line 129 of file tabs.c.

girara_tab_t* girara_tab_current_get ( girara_session_t *  session)

Returns the current tab

Parameters
sessionThe girara session
Returns
The current tab or NULL if an error occured

Definition at line 170 of file tabs.c.

void girara_tab_current_set ( girara_session_t *  session,
girara_tab_t *  tab 
)

Sets the current tab

Parameters
sessionThe girara session
tabThe new current tab

Definition at line 187 of file tabs.c.

girara_tab_t* girara_tab_get ( girara_session_t *  session,
unsigned int  index 
)

Returns the tab at the given index

Parameters
sessionThe girara session
indexIndex of the tab
Returns
The tab object or NULL if an error occured

Definition at line 117 of file tabs.c.

girara_tab_t* girara_tab_new ( girara_session_t *  session,
const char *  title,
GtkWidget *  widget,
bool  next_to_current,
void *  data 
)

Creates and adds a new tab to the tab view

Parameters
sessionThe girara session
titleTitle of the tab (optional)
widgetDisplayed widget
next_to_currentTab should be created right next to the current one
dataCustom data
Returns
A new tab object or NULL if an error occured

Definition at line 36 of file tabs.c.

int girara_tab_position_get ( girara_session_t *  session,
girara_tab_t *  tab 
)

Returns the position of the tab

Parameters
sessionGirara session
tabThe tab
Returns
The id of the tab or -1 if an error occured

Definition at line 230 of file tabs.c.

void girara_tab_position_set ( girara_session_t *  session,
girara_tab_t *  tab,
unsigned int  position 
)

Sets the new position of the tab

Parameters
sessionGirara session
tabThe tab
positionThe new position

Definition at line 241 of file tabs.c.

void girara_tab_remove ( girara_session_t *  session,
girara_tab_t *  tab 
)

Removes and destroys a tab from the tab view

Parameters
sessionThe girara session
tabTab

Definition at line 90 of file tabs.c.

const char* girara_tab_title_get ( girara_tab_t *  tab)

Returns the title of the tab

Parameters
tabThe tab
Returns
The title of the tab or NULL if an error occured

Definition at line 220 of file tabs.c.

void girara_tab_title_set ( girara_tab_t *  tab,
const char *  title 
)

Sets the shown title of the tab

Parameters
tabThe tab
titleThe new title

Definition at line 204 of file tabs.c.

void girara_tab_update ( girara_session_t *  session)

Updates the color and states of all tabs

Parameters
sessionThe girara session

Definition at line 139 of file tabs.c.

void girara_tabs_enable ( girara_session_t *  session)

Enables the tab view. If girara_set_view is used, the tab bar will automatically vanish and girara_tabs_enable has to be called another time to re-enable it again.

Parameters
sessionThe girara session

Definition at line 20 of file tabs.c.