Dev:2.5/Doc/How to/Find a header button

提供: wiki
< Dev:2.5‎ | Doc‎ | How to
移動先: 案内検索

Search for first header button in node editor. Let's start with the space (editor) type definition

1) editors/space_node/space_node.c

  ED_spacetype_node()
    node_header_area_draw()
      // call to other module

2) editors/screen/area.c

  ED_region_header()
  // list of HeaderType structs with callbacks...
  // where do these come from?

3) makesrna/intern./rna_ui.c

  rna_Header_register()
  // ahh, this is called by a py script

4) release/scripts/ui/space_node.py

  row.template_header()
  // a template?

5) makesrna/intern./rna_ui.c

  RNA_def_function(srna, "template_header", "uiTemplateHeader");
  // that leads us to interface code...

6) editors/interface/interface_templates.c

  uiTemplateHeader()
   // call back to area.c

7) editors/screen/area.c

  ED_area_header_standardbuttons()
    ED_area_header_switchbutton()
      uiDefIconTextButC()
      // Gotcha!!!