Blender V2.61 - r43446
Defines | Functions | Variables

editfont.c File Reference

#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <wchar.h>
#include <unistd.h>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "DNA_curve_types.h"
#include "DNA_object_types.h"
#include "DNA_vfont_types.h"
#include "DNA_scene_types.h"
#include "DNA_text_types.h"
#include "BKE_context.h"
#include "BKE_curve.h"
#include "BKE_depsgraph.h"
#include "BKE_font.h"
#include "BKE_library.h"
#include "BKE_object.h"
#include "BKE_report.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_curve.h"
#include "ED_object.h"
#include "ED_screen.h"
#include "ED_util.h"
#include "UI_interface.h"
#include "curve_intern.h"

Go to the source code of this file.

Defines

#define MAXTEXT   32766

Functions

static char findaccent (char char1, unsigned int code)
static void update_string (Curve *cu)
static int insert_into_textbuf (Object *obedit, uintptr_t c)
static void text_update_edited (bContext *C, Scene *scene, Object *obedit, int recalc, int mode)
static int insert_lorem_exec (bContext *C, wmOperator *UNUSED(op))
void FONT_OT_insert_lorem (wmOperatorType *ot)
static int paste_file (bContext *C, ReportList *reports, const char *filename)
static int paste_file_exec (bContext *C, wmOperator *op)
static int paste_file_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(event))
void FONT_OT_file_paste (wmOperatorType *ot)
static void txt_add_object (bContext *C, TextLine *firstline, int totline, float offset[3])
void ED_text_to_object (bContext *C, Text *text, int split_lines)
static short next_word (Curve *cu)
static short prev_word (Curve *cu)
static int kill_selection (Object *obedit, int ins)
static int set_style (bContext *C, const int style, const int clear)
static int set_style_exec (bContext *C, wmOperator *op)
void FONT_OT_style_set (wmOperatorType *ot)
static int toggle_style_exec (bContext *C, wmOperator *op)
void FONT_OT_style_toggle (wmOperatorType *ot)
static void copy_selection (Object *obedit)
static int copy_text_exec (bContext *C, wmOperator *UNUSED(op))
void FONT_OT_text_copy (wmOperatorType *ot)
static int cut_text_exec (bContext *C, wmOperator *UNUSED(op))
void FONT_OT_text_cut (wmOperatorType *ot)
static int paste_selection (Object *obedit, ReportList *reports)
static int paste_text_exec (bContext *C, wmOperator *op)
void FONT_OT_text_paste (wmOperatorType *ot)
static int move_cursor (bContext *C, int type, int select)
static int move_exec (bContext *C, wmOperator *op)
void FONT_OT_move (wmOperatorType *ot)
static int move_select_exec (bContext *C, wmOperator *op)
void FONT_OT_move_select (wmOperatorType *ot)
static int change_spacing_exec (bContext *C, wmOperator *op)
void FONT_OT_change_spacing (wmOperatorType *ot)
static int change_character_exec (bContext *C, wmOperator *op)
void FONT_OT_change_character (wmOperatorType *ot)
static int line_break_exec (bContext *C, wmOperator *op)
void FONT_OT_line_break (wmOperatorType *ot)
static int delete_exec (bContext *C, wmOperator *op)
void FONT_OT_delete (wmOperatorType *ot)
static int insert_text_exec (bContext *C, wmOperator *op)
static int insert_text_invoke (bContext *C, wmOperator *op, wmEvent *evt)
void FONT_OT_text_insert (wmOperatorType *ot)
static int textbox_add_exec (bContext *C, wmOperator *UNUSED(op))
void FONT_OT_textbox_add (wmOperatorType *ot)
static int textbox_remove_exec (bContext *C, wmOperator *op)
void FONT_OT_textbox_remove (wmOperatorType *ot)
void make_editText (Object *obedit)
void load_editText (Object *obedit)
void free_editText (Object *obedit)
static int set_case (bContext *C, int ccase)
static int set_case_exec (bContext *C, wmOperator *op)
void FONT_OT_case_set (wmOperatorType *ot)
static int toggle_case_exec (bContext *C, wmOperator *UNUSED(op))
void FONT_OT_case_toggle (wmOperatorType *ot)
static void font_ui_template_init (bContext *C, wmOperator *op)
static int font_open_cancel (bContext *UNUSED(C), wmOperator *op)
static int font_open_exec (bContext *C, wmOperator *op)
static int open_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(event))
void FONT_OT_open (wmOperatorType *ot)
static int font_unlink_exec (bContext *C, wmOperator *op)
void FONT_OT_unlink (wmOperatorType *ot)
static void undoFont_to_editFont (void *strv, void *ecu)
static void * editFont_to_undoFont (void *ecu)
static void free_undoFont (void *strv)
static void * get_undoFont (bContext *C)
void undo_push_font (bContext *C, const char *name)

Variables

static EnumPropertyItem style_items []
static EnumPropertyItem move_type_items []
static EnumPropertyItem delete_type_items []
static EnumPropertyItem case_items []

Detailed Description

Definition in file editfont.c.


Define Documentation

#define MAXTEXT   32766

Function Documentation

static int change_character_exec ( bContext C,
wmOperator op 
) [static]
static int change_spacing_exec ( bContext C,
wmOperator op 
) [static]
static void copy_selection ( Object obedit) [static]
static int copy_text_exec ( bContext C,
wmOperator UNUSEDop 
) [static]

Definition at line 683 of file editfont.c.

References copy_selection(), CTX_data_edit_object(), and OPERATOR_FINISHED.

Referenced by FONT_OT_text_copy().

static int cut_text_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
static int delete_exec ( bContext C,
wmOperator op 
) [static]
void ED_text_to_object ( bContext C,
Text text,
int  split_lines 
)
static void* editFont_to_undoFont ( void *  ecu) [static]
static char findaccent ( char  char1,
unsigned int  code 
) [static]

Definition at line 81 of file editfont.c.

Referenced by insert_text_invoke().

static int font_open_cancel ( bContext UNUSEDC,
wmOperator op 
) [static]

Definition at line 1612 of file editfont.c.

References wmOperator::customdata, MEM_freeN(), NULL, and OPERATOR_CANCELLED.

Referenced by FONT_OT_open().

static int font_open_exec ( bContext C,
wmOperator op 
) [static]
void FONT_OT_case_set ( wmOperatorType ot)
void FONT_OT_case_toggle ( wmOperatorType ot)
void FONT_OT_change_character ( wmOperatorType ot)
void FONT_OT_change_spacing ( wmOperatorType ot)
void FONT_OT_delete ( wmOperatorType ot)
void FONT_OT_file_paste ( wmOperatorType ot)
void FONT_OT_insert_lorem ( wmOperatorType ot)
void FONT_OT_line_break ( wmOperatorType ot)
void FONT_OT_move ( wmOperatorType ot)
void FONT_OT_move_select ( wmOperatorType ot)
void FONT_OT_open ( wmOperatorType ot)
void FONT_OT_style_set ( wmOperatorType ot)
void FONT_OT_style_toggle ( wmOperatorType ot)
void FONT_OT_text_copy ( wmOperatorType ot)
void FONT_OT_text_cut ( wmOperatorType ot)
void FONT_OT_text_insert ( wmOperatorType ot)
void FONT_OT_text_paste ( wmOperatorType ot)
void FONT_OT_textbox_add ( wmOperatorType ot)
void FONT_OT_textbox_remove ( wmOperatorType ot)
void FONT_OT_unlink ( wmOperatorType ot)
static void font_ui_template_init ( bContext C,
wmOperator op 
) [static]
static int font_unlink_exec ( bContext C,
wmOperator op 
) [static]
void free_editText ( Object obedit)

Definition at line 1492 of file editfont.c.

References BKE_free_editfont(), and Object::data.

Referenced by ED_object_exit_editmode().

static void free_undoFont ( void *  strv) [static]

Definition at line 1778 of file editfont.c.

References MEM_freeN().

Referenced by undo_push_font().

static void* get_undoFont ( bContext C) [static]

Definition at line 1783 of file editfont.c.

References CTX_data_edit_object(), Object::data, NULL, OB_FONT, and Object::type.

Referenced by undo_push_font().

static int insert_into_textbuf ( Object obedit,
uintptr_t  c 
) [static]
static int insert_lorem_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
static int insert_text_exec ( bContext C,
wmOperator op 
) [static]
static int insert_text_invoke ( bContext C,
wmOperator op,
wmEvent evt 
) [static]
static int kill_selection ( Object obedit,
int  ins 
) [static]
static int line_break_exec ( bContext C,
wmOperator op 
) [static]
void load_editText ( Object obedit)
void make_editText ( Object obedit)
static int move_cursor ( bContext C,
int  type,
int  select 
) [static]
static int move_exec ( bContext C,
wmOperator op 
) [static]

Definition at line 911 of file editfont.c.

References move_cursor(), wmOperator::ptr, and RNA_enum_get().

Referenced by FONT_OT_move().

static int move_select_exec ( bContext C,
wmOperator op 
) [static]

Definition at line 938 of file editfont.c.

References move_cursor(), wmOperator::ptr, and RNA_enum_get().

Referenced by FONT_OT_move_select().

static short next_word ( Curve cu) [static]

Definition at line 524 of file editfont.c.

References Curve::pos, and Curve::str.

Referenced by move_cursor().

static int open_invoke ( bContext C,
wmOperator op,
wmEvent UNUSEDevent 
) [static]
static int paste_file ( bContext C,
ReportList reports,
const char *  filename 
) [static]
static int paste_file_exec ( bContext C,
wmOperator op 
) [static]
static int paste_file_invoke ( bContext C,
wmOperator op,
wmEvent UNUSEDevent 
) [static]
static int paste_selection ( Object obedit,
ReportList reports 
) [static]
static int paste_text_exec ( bContext C,
wmOperator op 
) [static]
static short prev_word ( Curve cu) [static]

Definition at line 532 of file editfont.c.

References Curve::pos, and Curve::str.

Referenced by move_cursor().

static int set_case ( bContext C,
int  ccase 
) [static]
static int set_case_exec ( bContext C,
wmOperator op 
) [static]

Definition at line 1539 of file editfont.c.

References wmOperator::ptr, RNA_enum_get(), and set_case().

Referenced by FONT_OT_case_set().

static int set_style ( bContext C,
const int  style,
const int  clear 
) [static]
static int set_style_exec ( bContext C,
wmOperator op 
) [static]

Definition at line 603 of file editfont.c.

References clear(), wmOperator::ptr, RNA_boolean_get(), RNA_enum_get(), and set_style().

Referenced by FONT_OT_style_set().

static void text_update_edited ( bContext C,
Scene scene,
Object obedit,
int  recalc,
int  mode 
) [static]
static int textbox_add_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
static int textbox_remove_exec ( bContext C,
wmOperator op 
) [static]
static int toggle_case_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
static int toggle_style_exec ( bContext C,
wmOperator op 
) [static]
static void txt_add_object ( bContext C,
TextLine firstline,
int  totline,
float  offset[3] 
) [static]
void undo_push_font ( bContext C,
const char *  name 
)
static void undoFont_to_editFont ( void *  strv,
void *  ecu 
) [static]
static void update_string ( Curve cu) [static]

Variable Documentation

Initial value:
 {
    {CASE_LOWER, "LOWER", 0, "Lower", ""},
    {CASE_UPPER, "UPPER", 0, "Upper", ""},
    {0, NULL, 0, NULL, NULL}}

Definition at line 1499 of file editfont.c.

Initial value:
 {
    {DEL_ALL, "ALL", 0, "All", ""},
    {DEL_NEXT_CHAR, "NEXT_CHARACTER", 0, "Next Character", ""},
    {DEL_PREV_CHAR, "PREVIOUS_CHARACTER", 0, "Previous Character", ""},
    {DEL_SELECTION, "SELECTION", 0, "Selection", ""},
    {DEL_NEXT_SEL, "NEXT_OR_SELECTION", 0, "Next or Selection", ""},
    {DEL_PREV_SEL, "PREVIOUS_OR_SELECTION", 0, "Previous or Selection", ""},
    {0, NULL, 0, NULL, NULL}}

Definition at line 1095 of file editfont.c.

Initial value:
 {
    {LINE_BEGIN, "LINE_BEGIN", 0, "Line Begin", ""},
    {LINE_END, "LINE_END", 0, "Line End", ""},
    {PREV_CHAR, "PREVIOUS_CHARACTER", 0, "Previous Character", ""},
    {NEXT_CHAR, "NEXT_CHARACTER", 0, "Next Character", ""},
    {PREV_WORD, "PREVIOUS_WORD", 0, "Previous Word", ""},
    {NEXT_WORD, "NEXT_WORD", 0, "Next Word", ""},
    {PREV_LINE, "PREVIOUS_LINE", 0, "Previous Line", ""},
    {NEXT_LINE, "NEXT_LINE", 0, "Next Line", ""},
    {PREV_PAGE, "PREVIOUS_PAGE", 0, "Previous Page", ""},
    {NEXT_PAGE, "NEXT_PAGE", 0, "Next Page", ""},
    {0, NULL, 0, NULL, NULL}}

Definition at line 798 of file editfont.c.

Initial value:
 {
    {CU_CHINFO_BOLD, "BOLD", 0, "Bold", ""},
    {CU_CHINFO_ITALIC, "ITALIC", 0, "Italic", ""},
    {CU_CHINFO_UNDERLINE, "UNDERLINE", 0, "Underline", ""},
    {CU_CHINFO_SMALLCAPS, "SMALL_CAPS", 0, "Small Caps", ""},
    {0, NULL, 0, NULL, NULL}}

Definition at line 573 of file editfont.c.