Cleanup: use doxy sections for the outliner

This commit is contained in:
Campbell Barton 2022-03-11 11:59:53 +11:00
parent 0327a464ba
commit d73726dbbe
4 changed files with 96 additions and 27 deletions

View File

@ -46,7 +46,9 @@
static Collection *collection_parent_from_ID(ID *id);
/* ******************** Drop Target Find *********************** */
/* -------------------------------------------------------------------- */
/** \name Drop Target Find
* \{ */
static TreeElement *outliner_dropzone_element(TreeElement *te,
const float fmval[2],
@ -254,7 +256,11 @@ static int outliner_get_insert_index(TreeElement *drag_te,
return BLI_findindex(listbase, drop_te->directdata);
}
/* ******************** Parent Drop Operator *********************** */
/** \} */
/* -------------------------------------------------------------------- */
/** \name Parent Drop Operator
* \{ */
static bool parent_drop_allowed(TreeElement *te, Object *potential_child)
{
@ -443,7 +449,11 @@ void OUTLINER_OT_parent_drop(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL;
}
/* ******************** Parent Clear Operator *********************** */
/** \} */
/* -------------------------------------------------------------------- */
/** \name Parent Clear Operator
* \{ */
static bool parent_clear_poll(bContext *C, wmDrag *drag, const wmEvent *event)
{
@ -527,7 +537,11 @@ void OUTLINER_OT_parent_clear(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL;
}
/* ******************** Scene Drop Operator *********************** */
/** \} */
/* -------------------------------------------------------------------- */
/** \name Scene Drop Operator
* \{ */
static bool scene_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
{
@ -592,7 +606,11 @@ void OUTLINER_OT_scene_drop(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL;
}
/* ******************** Material Drop Operator *********************** */
/** \} */
/* -------------------------------------------------------------------- */
/** \name Material Drop Operator
* \{ */
static bool material_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
{
@ -641,15 +659,19 @@ void OUTLINER_OT_material_drop(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL;
}
/* ******************** Data Stack Drop Operator *********************** */
/** \} */
/* A generic operator to allow drag and drop for modifiers, constraints,
/* -------------------------------------------------------------------- */
/** \name Data Stack Drop Operator
*
* A generic operator to allow drag and drop for modifiers, constraints,
* and shader effects which all share the same UI stack layout.
*
* The following operations are allowed:
* - Reordering within an object.
* - Copying a single modifier/constraint/effect to another object.
* - Copying (linking) an object's modifiers/constraints/effects to another. */
* - Copying (linking) an object's modifiers/constraints/effects to another.
* \{ */
enum eDataStackDropAction {
DATA_STACK_DROP_REORDER,
@ -1069,7 +1091,11 @@ void OUTLINER_OT_datastack_drop(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL;
}
/* ******************** Collection Drop Operator *********************** */
/** \} */
/* -------------------------------------------------------------------- */
/** \name Collection Drop Operator
* \{ */
struct CollectionDrop {
Collection *from;
@ -1350,7 +1376,11 @@ void OUTLINER_OT_collection_drop(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL;
}
/* ********************* Outliner Drag Operator ******************** */
/** \} */
/* -------------------------------------------------------------------- */
/** \name Outliner Drag Operator
* \{ */
#define OUTLINER_DRAG_SCOLL_OUTSIDE_PAD 7 /* In UI units */
@ -1528,7 +1558,11 @@ void OUTLINER_OT_item_drag_drop(wmOperatorType *ot)
#undef OUTLINER_DRAG_SCOLL_OUTSIDE_PAD
/* *************************** Drop Boxes ************************** */
/** \} */
/* -------------------------------------------------------------------- */
/** \name Drop Boxes
* \{ */
void outliner_dropboxes(void)
{
@ -1551,3 +1585,5 @@ void outliner_dropboxes(void)
nullptr,
collection_drop_tooltip);
}
/** \} */

View File

@ -11,7 +11,9 @@
#include "outliner_intern.hh"
/* ************************** registration **********************************/
/* -------------------------------------------------------------------- */
/** \name Registration
* \{ */
void outliner_operatortypes(void)
{
@ -97,3 +99,5 @@ void outliner_keymap(wmKeyConfig *keyconf)
{
WM_keymap_ensure(keyconf, "Outliner", SPACE_OUTLINER, 0);
}
/** \} */

View File

@ -68,6 +68,10 @@
using namespace blender::ed::outliner;
/* -------------------------------------------------------------------- */
/** \name Internal Utilities
* \{ */
/**
* \note changes to selection are by convention and not essential.
*
@ -199,8 +203,11 @@ void outliner_item_mode_toggle(bContext *C,
}
}
/* ****************************************************** */
/* Outliner Element Selection/Activation on Click */
/** \} */
/* -------------------------------------------------------------------- */
/** \name Outliner Element Selection/Activation on Click Operator
* \{ */
static void tree_element_viewlayer_activate(bContext *C, TreeElement *te)
{
@ -1700,9 +1707,12 @@ void OUTLINER_OT_item_activate(wmOperatorType *ot)
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
/* ****************************************************** */
/** \} */
/* -------------------------------------------------------------------- */
/** \name Box Select Operator
* \{ */
/* **************** Box Select Tool ****************** */
static void outliner_item_box_select(bContext *C,
SpaceOutliner *space_outliner,
Scene *scene,
@ -1809,9 +1819,11 @@ void OUTLINER_OT_select_box(wmOperatorType *ot)
WM_operator_properties_select_operation_simple(ot);
}
/* ****************************************************** */
/** \} */
/* **************** Walk Select Tool ****************** */
/* -------------------------------------------------------------------- */
/** \name Walk Select Operator
* \{ */
/* Given a tree element return the rightmost child that is visible in the outliner */
static TreeElement *outliner_find_rightmost_visible_child(SpaceOutliner *space_outliner,
@ -2036,4 +2048,4 @@ void OUTLINER_OT_select_walk(wmOperatorType *ot)
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
/* ****************************************************** */
/** \} */

View File

@ -74,8 +74,9 @@ using namespace blender::ed::outliner;
/* prototypes */
static int outliner_exclude_filter_get(const SpaceOutliner *space_outliner);
/* ********************************************************* */
/* Persistent Data */
/* -------------------------------------------------------------------- */
/** \name Persistent Data
* \{ */
static void outliner_storage_cleanup(SpaceOutliner *space_outliner)
{
@ -175,8 +176,11 @@ static void check_persistent(
BKE_outliner_treehash_add_element(space_outliner->runtime->treehash, tselem);
}
/* ********************************************************* */
/* Tree Management */
/** \} */
/* -------------------------------------------------------------------- */
/** \name Tree Management
* \{ */
void outliner_free_tree(ListBase *tree)
{
@ -960,10 +964,14 @@ TreeElement *outliner_add_collection_recursive(SpaceOutliner *space_outliner,
return ten;
}
/** \} */
/* ======================================================= */
/* Generic Tree Building helpers - order these are called is top to bottom */
/* Sorting ------------------------------------------------------ */
/* -------------------------------------------------------------------- */
/** \name Tree Sorting Helper
* \{ */
struct tTreeSort {
TreeElement *te;
@ -1195,7 +1203,11 @@ static void outliner_collections_children_sort(ListBase *lb)
}
}
/* Filtering ----------------------------------------------- */
/** \} */
/* -------------------------------------------------------------------- */
/** \name Tree Filtering Helper
* \{ */
struct OutlinerTreeElementFocus {
TreeStoreElem *tselem;
@ -1644,8 +1656,11 @@ static void outliner_clear_newid_from_main(Main *bmain)
FOREACH_MAIN_ID_END;
}
/* ======================================================= */
/* Main Tree Building API */
/** \} */
/* -------------------------------------------------------------------- */
/** \name Main Tree Building API
* \{ */
void outliner_build_tree(Main *mainvar,
Scene *scene,
@ -1707,3 +1722,5 @@ void outliner_build_tree(Main *mainvar,
* as this expects valid IDs in this pointer, not random unknown data. */
outliner_clear_newid_from_main(mainvar);
}
/** \} */