Advertisement
Guest User

outliner_buttons.c

a guest
Feb 17th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.51 KB | None | 0 0
  1. /*
  2.  * ***** BEGIN GPL LICENSE BLOCK *****
  3.  *
  4.  * This program is free software; you can redistribute it and/or
  5.  * modify it under the terms of the GNU General Public License
  6.  * as published by the Free Software Foundation; either version 2
  7.  * of the License, or (at your option) any later version.
  8.  *
  9.  * This program is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.  * GNU General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU General Public License
  15.  * along with this program; if not, write to the Free Software Foundation,
  16.  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  17.  *
  18.  * The Original Code is Copyright (C) 2016 Blender Foundation.
  19.  * All rights reserved.
  20.  *
  21.  *
  22.  * Contributor(s): Blender Foundation, Joshua Leung
  23.  *
  24.  * ***** END GPL LICENSE BLOCK *****
  25.  */
  26.  
  27. /** \file blender/editors/space_outliner/outliner_buttons.c
  28.  *  \ingroup spoutliner
  29.  */
  30.  
  31.  
  32. #include <string.h>
  33. #include <stdio.h>
  34. #include <math.h>
  35. #include <float.h>
  36.  
  37.  
  38. #include "DNA_object_types.h"
  39. #include "DNA_scene_types.h"
  40.  
  41. #include "MEM_guardedalloc.h"
  42.  
  43. #include "BLI_blenlib.h"
  44. #include "BLI_utildefines.h"
  45. #include "BLI_mempool.h"
  46.  
  47. #include "BKE_context.h"
  48. #include "BKE_layer.h"
  49. #include "BKE_screen.h"
  50. #include "BKE_scene.h"
  51. #include "BKE_outliner_treehash.h"
  52.  
  53. #include "WM_api.h"
  54. #include "WM_types.h"
  55.  
  56. #include "BIF_gl.h"
  57.  
  58. #include "RNA_access.h"
  59.  
  60. #include "ED_space_api.h"
  61. #include "ED_screen.h"
  62.  
  63. #include "UI_view2d.h"
  64. #include "UI_interface.h"
  65. #include "UI_resources.h"
  66.  
  67. #include "outliner_intern.h"   // own include
  68. #include "GPU_framebuffer.h"
  69.  
  70.  
  71.  
  72.  
  73.  
  74. /* ******************* outliner editor space & buttons ************** */
  75.  
  76. /* ******************* general ******************************** */
  77.  
  78. void outliner_buttons_register(ARegionType *UNUSED(art))
  79. {
  80.  
  81. }
  82.  
  83. static int outliner_properties_toggle_exec(bContext *C, wmOperator *UNUSED(op))
  84. {
  85.     ScrArea *sa = CTX_wm_area(C);
  86.     ARegion *ar = outliner_has_buttons_region(sa);
  87.  
  88.     if (ar)
  89.         ED_region_toggle_hidden(C, ar);
  90.  
  91.     return OPERATOR_FINISHED;
  92. }
  93.  
  94. void OUTLINER_OT_properties(wmOperatorType *ot)
  95. {
  96.     ot->name = "Toggle Sidebar";
  97.     ot->idname = "OUTLINER_OT_properties";
  98.     ot->description = "Toggle the properties region visibility";
  99.  
  100.     ot->exec = outliner_properties_toggle_exec;
  101.     ot->poll = ED_operator_outliner_active;
  102.  
  103.     /* flags */
  104.     ot->flag = 0;
  105. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement