2014-04-30 15:06:16 -07:00
|
|
|
#ifndef _UI_H
|
|
|
|
#define _UI_H
|
|
|
|
|
|
|
|
#include <Evas.h>
|
|
|
|
|
2014-10-08 16:06:55 -07:00
|
|
|
#if HAVE_LIBCLANG
|
|
|
|
#include <clang-c/Index.h>
|
|
|
|
#endif
|
|
|
|
|
2014-09-13 08:48:16 -07:00
|
|
|
#include "mainview/edi_mainview_item.h"
|
|
|
|
|
2014-04-30 15:06:16 -07:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* @brief These routines are used for interacting with the main Edi editor view.
|
|
|
|
*/
|
|
|
|
|
2030-07-12 13:12:05 -07:00
|
|
|
/**
|
|
|
|
* @typedef Edi_Editor_Search
|
|
|
|
* An instance of an editor search session.
|
|
|
|
*/
|
|
|
|
typedef struct _Edi_Editor_Search Edi_Editor_Search;
|
|
|
|
|
2014-05-15 15:25:25 -07:00
|
|
|
/**
|
|
|
|
* @typedef Edi_Editor
|
|
|
|
* An instance of an editor view.
|
|
|
|
*/
|
|
|
|
typedef struct _Edi_Editor Edi_Editor;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @struct _Edi_Editor
|
|
|
|
* An instance of an editor view.
|
|
|
|
*/
|
|
|
|
struct _Edi_Editor
|
|
|
|
{
|
|
|
|
Evas_Object *entry; /**< The main text entry widget for the editor */
|
|
|
|
Eina_List *undo_stack; /**< The list of operations that can be undone */
|
|
|
|
|
|
|
|
/* Private */
|
2030-07-12 13:12:05 -07:00
|
|
|
Evas_Object *lines;
|
|
|
|
Edi_Editor_Search *search;
|
2014-05-15 15:25:25 -07:00
|
|
|
|
|
|
|
/* Add new members here. */
|
2014-10-08 16:06:55 -07:00
|
|
|
|
|
|
|
#if HAVE_LIBCLANG
|
|
|
|
/* Clang */
|
|
|
|
CXIndex idx;
|
|
|
|
CXTranslationUnit tx_unit;
|
2014-12-04 16:12:56 -08:00
|
|
|
CXToken *tokens;
|
|
|
|
CXCursor *cursors;
|
|
|
|
unsigned int token_count;
|
2014-10-08 16:06:55 -07:00
|
|
|
#endif
|
2014-12-04 16:12:56 -08:00
|
|
|
|
|
|
|
Ecore_Timer *delay_highlight;
|
2014-12-08 13:03:06 -08:00
|
|
|
int format_start, format_end, format_line;
|
2014-05-15 15:25:25 -07:00
|
|
|
};
|
|
|
|
|
2014-04-30 15:06:16 -07:00
|
|
|
/**
|
2014-05-15 14:40:19 -07:00
|
|
|
* @brief Editor.
|
|
|
|
* @defgroup Editor The main text editor functions
|
|
|
|
*
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialize a new Edi editor and add it to the parent panel.
|
|
|
|
*
|
|
|
|
* @param parent The panel into which the panel will be loaded.
|
2014-09-13 08:48:16 -07:00
|
|
|
* @param item The item describing the file to be loaded in the editor.
|
2014-05-15 14:40:19 -07:00
|
|
|
* @return the created evas object that contains the editor.
|
|
|
|
*
|
|
|
|
* @ingroup Editor
|
|
|
|
*/
|
2014-09-13 08:48:16 -07:00
|
|
|
EAPI Evas_Object *edi_editor_add(Evas_Object *parent, Edi_Mainview_Item *item);
|
2014-05-15 14:40:19 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*
|
2030-07-12 13:12:05 -07:00
|
|
|
* @brief Widgets.
|
|
|
|
* @defgroup Widget Functions that open or manipulate feature panels
|
2014-04-30 15:06:16 -07:00
|
|
|
*
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2030-07-12 13:12:05 -07:00
|
|
|
/**
|
|
|
|
* Add a search widget to the specified editor.
|
|
|
|
*
|
|
|
|
* @param parent The panel that the UI should be added to,
|
|
|
|
* @param editor The Edi_Editor instance that we are searching for text within.
|
|
|
|
*
|
|
|
|
* @ingroup Widgets
|
|
|
|
*/
|
|
|
|
EAPI void edi_editor_search_add(Evas_Object *parent, Edi_Editor *editor);
|
|
|
|
|
2014-04-30 15:06:16 -07:00
|
|
|
/**
|
|
|
|
* Start a search in the specified editor.
|
|
|
|
*
|
2030-07-12 13:12:05 -07:00
|
|
|
* @param editor the text editor instance to search within.
|
2014-04-30 15:06:16 -07:00
|
|
|
*
|
2030-07-12 13:12:05 -07:00
|
|
|
* @ingroup Widgets
|
2014-04-30 15:06:16 -07:00
|
|
|
*/
|
2030-07-12 13:12:05 -07:00
|
|
|
EAPI void edi_editor_search(Edi_Editor *editor);
|
2014-04-30 15:06:16 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|