~ubuntu-branches/ubuntu/trusty/blender/trusty-proposed

« back to all changes in this revision

Viewing changes to source/blender/editors/space_text/space_text.c

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2013-08-14 10:43:49 UTC
  • mfrom: (14.2.19 sid)
  • Revision ID: package-import@ubuntu.com-20130814104349-t1d5mtwkphp12dyj
Tags: 2.68a-3
* Upload to unstable
* debian/: python3.3 Depends simplified
  - debian/control: python3.3 Depends dropped
    for blender-data package
  - 0001-blender_thumbnailer.patch refreshed
* debian/control: libavcodec b-dep versioning dropped

Show diffs side-by-side

added added

removed removed

Lines of Context:
116
116
        return (SpaceLink *)stextn;
117
117
}
118
118
 
119
 
static void text_listener(ScrArea *sa, wmNotifier *wmn)
 
119
static void text_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn)
120
120
{
121
121
        SpaceText *st = sa->spacedata.first;
122
122
 
220
220
        WM_operatortype_append(TEXT_OT_replace);
221
221
        WM_operatortype_append(TEXT_OT_replace_set_selected);
222
222
 
 
223
        WM_operatortype_append(TEXT_OT_start_find);
 
224
        
223
225
        WM_operatortype_append(TEXT_OT_to_3d_object);
224
226
 
225
227
        WM_operatortype_append(TEXT_OT_resolve_conflict);
233
235
        wmKeyMapItem *kmi;
234
236
        
235
237
        keymap = WM_keymap_find(keyconf, "Text Generic", SPACE_TEXT, 0);
236
 
        WM_keymap_add_item(keymap, "TEXT_OT_properties", FKEY, KM_PRESS, KM_CTRL, 0);
 
238
        WM_keymap_add_item(keymap, "TEXT_OT_start_find", FKEY, KM_PRESS, KM_CTRL, 0);
237
239
#ifdef __APPLE__
238
 
        WM_keymap_add_item(keymap, "TEXT_OT_properties", FKEY, KM_PRESS, KM_OSKEY, 0);
 
240
        WM_keymap_add_item(keymap, "TEXT_OT_start_find", FKEY, KM_PRESS, KM_OSKEY, 0);
239
241
#endif
240
242
        
241
243
        keymap = WM_keymap_find(keyconf, "Text", SPACE_TEXT, 0);
242
244
        
243
 
        #ifdef __APPLE__
 
245
#ifdef __APPLE__
244
246
        RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", LEFTARROWKEY, KM_PRESS, KM_OSKEY, 0)->ptr, "type", LINE_BEGIN);
245
247
        RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", RIGHTARROWKEY, KM_PRESS, KM_OSKEY, 0)->ptr, "type", LINE_END);
246
248
        RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", LEFTARROWKEY, KM_PRESS, KM_ALT, 0)->ptr, "type", PREV_WORD);
266
268
        WM_keymap_add_item(keymap, "TEXT_OT_find", GKEY, KM_PRESS, KM_OSKEY, 0);
267
269
        WM_keymap_add_item(keymap, "TEXT_OT_select_all", AKEY, KM_PRESS, KM_OSKEY, 0);
268
270
        WM_keymap_add_item(keymap, "TEXT_OT_select_line", AKEY, KM_PRESS, KM_SHIFT | KM_OSKEY, 0);
269
 
        #endif
 
271
#endif
270
272
        
271
273
        kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", WHEELUPMOUSE, KM_PRESS, KM_CTRL, 0);
272
274
        RNA_string_set(kmi->ptr, "data_path", "space_data.font_size");
458
460
 
459
461
/* ************* dropboxes ************* */
460
462
 
461
 
static int text_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event))
 
463
static int text_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event))
462
464
{
463
465
        if (drag->type == WM_DRAG_PATH)
464
466
                if (ELEM(drag->icon, ICON_FILE_SCRIPT, ICON_FILE_BLANK))    /* rule might not work? */
504
506
{
505
507
        wmKeyMap *keymap;
506
508
 
507
 
        keymap = WM_keymap_find(wm->defaultconf, "Text Generic", SPACE_TEXT, 0);
508
 
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
509
 
 
 
509
        ar->v2d.scroll = V2D_SCROLL_RIGHT | V2D_SCROLL_VERTICAL_HIDE;
510
510
        ED_region_panels_init(wm, ar);
 
511
 
 
512
        /* own keymaps */
 
513
        keymap = WM_keymap_find(wm->defaultconf, "Text Generic", SPACE_TEXT, 0);
 
514
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 
515
 
511
516
}
512
517
 
513
518
static void text_properties_area_draw(const bContext *C, ARegion *ar)
514
519
{
 
520
        SpaceText *st = CTX_wm_space_text(C);
 
521
        
515
522
        ED_region_panels(C, ar, 1, NULL, -1);
 
523
        
 
524
        /* this flag trick is make sure buttons have been added already */
 
525
        if (st->flags & ST_FIND_ACTIVATE) {
 
526
                if (UI_textbutton_activate_event(C, ar, st, "find_text")) {
 
527
                        /* if the panel was already open we need to do another redraw */
 
528
                        ScrArea *sa = CTX_wm_area(C);
 
529
                        WM_event_add_notifier(C, NC_SPACE | ND_SPACE_TEXT, sa);
 
530
                }
 
531
                st->flags &= ~ST_FIND_ACTIVATE;
 
532
        }
516
533
}
517
534
 
518
535
/********************* registration ********************/