mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-28 20:26:00 +01:00
Add function documentation
This commit is contained in:
parent
ccfe1d9fba
commit
4c19c798f7
7 changed files with 265 additions and 12 deletions
62
commands.h
62
commands.h
|
@ -6,12 +6,74 @@
|
|||
#include <stdbool.h>
|
||||
#include <girara.h>
|
||||
|
||||
/**
|
||||
* Create a bookmark
|
||||
*
|
||||
* @param session The used girara session
|
||||
* @param argc Number of arguments
|
||||
* @param argv Value of the arguments
|
||||
* @return true if no error occured
|
||||
*/
|
||||
bool cmd_bookmark_create(girara_session_t* session, int argc, char** argv);
|
||||
|
||||
/**
|
||||
* Delete a bookmark
|
||||
*
|
||||
* @param session The used girara session
|
||||
* @param argc Number of arguments
|
||||
* @param argv Value of the arguments
|
||||
* @return true if no error occured
|
||||
*/
|
||||
bool cmd_bookmark_delete(girara_session_t* session, int argc, char** argv);
|
||||
|
||||
/**
|
||||
* Open a bookmark
|
||||
*
|
||||
* @param session The used girara session
|
||||
* @param argc Number of arguments
|
||||
* @param argv Value of the arguments
|
||||
* @return true if no error occured
|
||||
*/
|
||||
bool cmd_bookmark_open(girara_session_t* session, int argc, char** argv);
|
||||
|
||||
/**
|
||||
* Close zathura
|
||||
*
|
||||
* @param session The used girara session
|
||||
* @param argc Number of arguments
|
||||
* @param argv Value of the arguments
|
||||
* @return true if no error occured
|
||||
*/
|
||||
bool cmd_close(girara_session_t* session, int argc, char** argv);
|
||||
|
||||
/**
|
||||
* Display document information
|
||||
*
|
||||
* @param session The used girara session
|
||||
* @param argc Number of arguments
|
||||
* @param argv Value of the arguments
|
||||
* @return true if no error occured
|
||||
*/
|
||||
bool cmd_info(girara_session_t* session, int argc, char** argv);
|
||||
|
||||
/**
|
||||
* Print the current file
|
||||
*
|
||||
* @param session The used girara session
|
||||
* @param argc Number of arguments
|
||||
* @param argv Value of the arguments
|
||||
* @return true if no error occured
|
||||
*/
|
||||
bool cmd_print(girara_session_t* session, int argc, char** argv);
|
||||
|
||||
/**
|
||||
* Save the current file
|
||||
*
|
||||
* @param session The used girara session
|
||||
* @param argc Number of arguments
|
||||
* @param argv Value of the arguments
|
||||
* @return true if no error occured
|
||||
*/
|
||||
bool cmd_save(girara_session_t* session, int argc, char** argv);
|
||||
|
||||
#endif // COMMANDS_H
|
||||
|
|
|
@ -5,6 +5,13 @@
|
|||
|
||||
#include <girara.h>
|
||||
|
||||
/**
|
||||
* Completion for the print command. Creates a list of available printers
|
||||
*
|
||||
* @param session The used girara session
|
||||
* @param input The current input
|
||||
* @return The completion object or NULL if an error occured
|
||||
*/
|
||||
girara_completion_t* cc_print(girara_session_t* session, char* input);
|
||||
|
||||
#endif // COMPLETION_H
|
||||
|
|
3
config.h
3
config.h
|
@ -3,6 +3,9 @@
|
|||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
/**
|
||||
* This function loads the default values of the configuration
|
||||
*/
|
||||
void config_load_default(void);
|
||||
|
||||
#endif // CONFIG_H
|
||||
|
|
28
render.h
28
render.h
|
@ -11,14 +11,34 @@
|
|||
|
||||
typedef struct render_thread_s
|
||||
{
|
||||
girara_list_t* list;
|
||||
GThread* thread;
|
||||
GMutex* lock;
|
||||
GCond* cond;
|
||||
girara_list_t* list; /**> The list of pages */
|
||||
GThread* thread; /**> The thread object */
|
||||
GMutex* lock; /**> Lock */
|
||||
GCond* cond; /**> Condition */
|
||||
} render_thread_t;
|
||||
|
||||
/**
|
||||
* This function initializes a render thread
|
||||
*
|
||||
* @return The render thread object or NULL if an error occured
|
||||
*/
|
||||
render_thread_t* render_init(void);
|
||||
|
||||
/**
|
||||
* This function destroys the render thread object
|
||||
*
|
||||
* @param render_thread The render thread object
|
||||
*/
|
||||
void render_free(render_thread_t* render_thread);
|
||||
|
||||
/**
|
||||
* This function is used to add a page to the render thread list
|
||||
* that should be rendered.
|
||||
*
|
||||
* @param render_thread The render thread object
|
||||
* @param page The page that should be rendered
|
||||
* @return true if no error occured
|
||||
*/
|
||||
bool render_page(render_thread_t* render_thread, zathura_page_t* page);
|
||||
|
||||
#endif // RENDER_H
|
||||
|
|
167
shortcuts.h
167
shortcuts.h
|
@ -5,26 +5,193 @@
|
|||
|
||||
#include <girara.h>
|
||||
|
||||
/**
|
||||
* Abort the current action and return to normal mode
|
||||
*
|
||||
* @param session The used girara session
|
||||
* @param argument The used argument
|
||||
* @return true if no error occured otherwise false
|
||||
*/
|
||||
bool sc_abort(girara_session_t* session, girara_argument_t* argument);
|
||||
|
||||
/**
|
||||
* Adjust the rendered pages to the window
|
||||
*
|
||||
* @param session The used girara session
|
||||
* @param argument The used argument
|
||||
* @return true if no error occured otherwise false
|
||||
*/
|
||||
bool sc_adjust_window(girara_session_t* session, girara_argument_t* argument);
|
||||
|
||||
/**
|
||||
* Modify the current buffer
|
||||
*
|
||||
* @param session The used girara session
|
||||
* @param argument The used argument
|
||||
* @return true if no error occured otherwise false
|
||||
*/
|
||||
bool sc_change_buffer(girara_session_t* session, girara_argument_t* argument);
|
||||
|
||||
/**
|
||||
* Change the current mode
|
||||
*
|
||||
* @param session The used girara session
|
||||
* @param argument The used argument
|
||||
* @return true if no error occured otherwise false
|
||||
*/
|
||||
bool sc_change_mode(girara_session_t* session, girara_argument_t* argument);
|
||||
|
||||
/**
|
||||
* Focus the inputbar
|
||||
*
|
||||
* @param session The used girara session
|
||||
* @param argument The used argument
|
||||
* @return true if no error occured otherwise false
|
||||
*/
|
||||
bool sc_focus_inputbar(girara_session_t* session, girara_argument_t* argument);
|
||||
|
||||
/**
|
||||
* Follow a link
|
||||
*
|
||||
* @param session The used girara session
|
||||
* @param argument The used argument
|
||||
* @return true if no error occured otherwise false
|
||||
*/
|
||||
bool sc_follow(girara_session_t* session, girara_argument_t* argument);
|
||||
|
||||
/**
|
||||
* Go to a specific page or position
|
||||
*
|
||||
* @param session The used girara session
|
||||
* @param argument The used argument
|
||||
* @return true if no error occured otherwise false
|
||||
*/
|
||||
bool sc_goto(girara_session_t* session, girara_argument_t* argument);
|
||||
|
||||
/**
|
||||
* Navigate through the document
|
||||
*
|
||||
* @param session The used girara session
|
||||
* @param argument The used argument
|
||||
* @return true if no error occured otherwise false
|
||||
*/
|
||||
bool sc_navigate(girara_session_t* session, girara_argument_t* argument);
|
||||
|
||||
/**
|
||||
* Recolor the pages
|
||||
*
|
||||
* @param session The used girara session
|
||||
* @param argument The used argument
|
||||
* @return true if no error occured otherwise false
|
||||
*/
|
||||
bool sc_recolor(girara_session_t* session, girara_argument_t* argument);
|
||||
|
||||
/**
|
||||
* Reload the current document
|
||||
*
|
||||
* @param session The used girara session
|
||||
* @param argument The used argument
|
||||
* @return true if no error occured otherwise false
|
||||
*/
|
||||
bool sc_reload(girara_session_t* session, girara_argument_t* argument);
|
||||
|
||||
/**
|
||||
* Rotate the pages
|
||||
*
|
||||
* @param session The used girara session
|
||||
* @param argument The used argument
|
||||
* @return true if no error occured otherwise false
|
||||
*/
|
||||
bool sc_rotate(girara_session_t* session, girara_argument_t* argument);
|
||||
|
||||
/**
|
||||
* Scroll through the pages
|
||||
*
|
||||
* @param session The used girara session
|
||||
* @param argument The used argument
|
||||
* @return true if no error occured otherwise false
|
||||
*/
|
||||
bool sc_scroll(girara_session_t* session, girara_argument_t* argument);
|
||||
|
||||
/**
|
||||
* Search through the document for the latest search item
|
||||
*
|
||||
* @param session The used girara session
|
||||
* @param argument The used argument
|
||||
* @return true if no error occured otherwise false
|
||||
*/
|
||||
bool sc_search(girara_session_t* session, girara_argument_t* argument);
|
||||
|
||||
/**
|
||||
* Switch go to mode (numeric, labels)
|
||||
*
|
||||
* @param session The used girara session
|
||||
* @param argument The used argument
|
||||
* @return true if no error occured otherwise false
|
||||
*/
|
||||
bool sc_switch_goto_mode(girara_session_t* session, girara_argument_t* argument);
|
||||
|
||||
/**
|
||||
* Navigate through the index of the document
|
||||
*
|
||||
* @param session The used girara session
|
||||
* @param argument The used argument
|
||||
* @return true if no error occured otherwise false
|
||||
*/
|
||||
bool sc_navigate_index(girara_session_t* session, girara_argument_t* argument);
|
||||
|
||||
/**
|
||||
* Show/Hide the index of the document
|
||||
*
|
||||
* @param session The used girara session
|
||||
* @param argument The used argument
|
||||
* @return true if no error occured otherwise false
|
||||
*/
|
||||
bool sc_toggle_index(girara_session_t* session, girara_argument_t* argument);
|
||||
|
||||
/**
|
||||
* Show/Hide the inputbar
|
||||
*
|
||||
* @param session The used girara session
|
||||
* @param argument The used argument
|
||||
* @return true if no error occured otherwise false
|
||||
*/
|
||||
bool sc_toggle_inputbar(girara_session_t* session, girara_argument_t* argument);
|
||||
|
||||
/**
|
||||
* Toggle fullscreen mode
|
||||
*
|
||||
* @param session The used girara session
|
||||
* @param argument The used argument
|
||||
* @return true if no error occured otherwise false
|
||||
*/
|
||||
bool sc_toggle_fullscreen(girara_session_t* session, girara_argument_t* argument);
|
||||
|
||||
/**
|
||||
* Show/Hide the statusbar
|
||||
*
|
||||
* @param session The used girara session
|
||||
* @param argument The used argument
|
||||
* @return true if no error occured otherwise false
|
||||
*/
|
||||
bool sc_toggle_statusbar(girara_session_t* session, girara_argument_t* argument);
|
||||
|
||||
/**
|
||||
* Quit zathura
|
||||
*
|
||||
* @param session The used girara session
|
||||
* @param argument The used argument
|
||||
* @return true if no error occured otherwise false
|
||||
*/
|
||||
bool sc_quit(girara_session_t* session, girara_argument_t* argument);
|
||||
|
||||
/**
|
||||
* Change the zoom level
|
||||
*
|
||||
* @param session The used girara session
|
||||
* @param argument The used argument
|
||||
* @return true if no error occured otherwise false
|
||||
*/
|
||||
bool sc_zoom(girara_session_t* session, girara_argument_t* argument);
|
||||
|
||||
#endif // SHORTCUTS_H
|
||||
|
|
|
@ -25,7 +25,6 @@ init_zathura()
|
|||
Zathura.UI.statusbar.file = NULL;
|
||||
Zathura.UI.statusbar.buffer = NULL;
|
||||
Zathura.UI.statusbar.page_number = NULL;
|
||||
Zathura.UI.drawing_area = NULL;
|
||||
Zathura.UI.page_view = NULL;
|
||||
|
||||
/* page view */
|
||||
|
@ -71,10 +70,6 @@ init_zathura()
|
|||
|
||||
error_free:
|
||||
|
||||
if(Zathura.UI.drawing_area) {
|
||||
g_object_unref(Zathura.UI.drawing_area);
|
||||
}
|
||||
|
||||
if(Zathura.UI.page_view) {
|
||||
g_object_unref(Zathura.UI.page_view);
|
||||
}
|
||||
|
|
|
@ -37,13 +37,12 @@ struct
|
|||
girara_statusbar_item_t* page_number; /**> page number statusbar entry */
|
||||
} statusbar;
|
||||
|
||||
GtkWidget *drawing_area;
|
||||
GtkWidget *page_view;
|
||||
GtkWidget *page_view; /**> Widget that contains all rendered pages */
|
||||
} UI;
|
||||
|
||||
struct
|
||||
{
|
||||
render_thread_t* render_thread;
|
||||
render_thread_t* render_thread; /**> The thread responsible for rendering the pages */
|
||||
} Sync;
|
||||
|
||||
zathura_document_t* document; /**> The current document */
|
||||
|
|
Loading…
Reference in a new issue