Commit Graph

19 Commits

Author SHA1 Message Date
Julian Eisel
6de85a0cc0 Ghost: Support queries for special user directories (desktop, documents, etc.)
When we had to get special user directories, we'd usually do it in varying,
rather ad-hoc ways. It would be done with a bunch of `#ifdef`s for the
different operating systems. Also, some of the used Win32 functions were legacy
ones and the API docs recommend using newer ones.
Further, seems `BKE_appdir_folder_default()` used `XDG_DOCUMENTS_DIR` wrong.
It's not supposed to be an environment variable but a value inside a config
file.

This adds the platform dependent logic to Ghost, so we can abstract it away
nicely using the `GHOST_ISystemPaths` interface. Getting the desktop directory
for example can now easily be done with:
`GHOST_getUserSpecialDir(GHOST_kUserSpecialDirDesktop).`

For now I added the logic for desktop, documents, downloads, videos, images and
music directories, even though we only use the Documents one. We can extend/
change this as needed, it's easy to do now.
On Windows and macOS, it uses pretty much the same way to access the
directories as elsewhere already. On Linux, it uses the `xdg-user-dir` command
that seems to be available by default on most Linux systems.

No functional changes. The new queries are not actually used yet.

Differential Revision: https://developer.blender.org/D9800

Reviewed by: Brecht Van Lommel
2020-12-11 16:20:53 +01:00
Jacques Lucke
1b1129f82a Code Style: use "#pragma once" in intern/ghost
More information can be found in D8466.
2020-08-07 10:18:01 +02:00
Campbell Barton
e12c08e8d1 ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.

For details on usage and instructions for migrating branches
without conflicts, see:

https://wiki.blender.org/wiki/Tools/ClangFormat
2019-04-17 06:21:24 +02:00
Campbell Barton
de13d0a80c doxygen: add newline after \file
While \file doesn't need an argument, it can't have another doxy
command after it.
2019-02-18 08:22:12 +11:00
Campbell Barton
eef4077f18 Cleanup: remove redundant doxygen \file argument
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
2019-02-06 15:45:22 +11:00
Campbell Barton
65ec7ec524 Cleanup: remove redundant, invalid info from headers
BF-admins agree to remove header information that isn't useful,
to reduce noise.

- BEGIN/END license blocks

  Developers should add non license comments as separate comment blocks.
  No need for separator text.

- Contributors

  This is often invalid, outdated or misleading
  especially when splitting files.

  It's more useful to git-blame to find out who has developed the code.

See P901 for script to perform these edits.
2019-02-02 01:36:28 +11:00
Campbell Barton
58e8c71cbd Cleanup: strip ghost trailing space 2018-06-04 18:47:57 +02:00
Campbell Barton
47ec91e8d3 code clenup: comments and some style edits on ghost/osx (odd indentation) 2012-09-06 02:10:09 +00:00
Campbell Barton
3c8a4c458b more guardedalloc use in C++, also make compositorMutex a static var, was allocated and never freed. 2012-06-25 10:35:24 +00:00
Brecht Van Lommel
942fcf4415 Unix: enable use of XDG paths for storing Blender configuration on Linux/BSD/..,
starting from version 2.64. Unless you have a special system setup, this means the
will be in ~/.config/blender rather than ~/.blender.

When the version number is changed to 2.64, the "Copy Previous Settings" operator
in the splash will copy the settings to the new location.

XDG base directory specification:
http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
2012-05-25 12:08:29 +00:00
Campbell Barton
112b1a0779 style cleanup: ghost headers 2012-05-19 09:23:08 +00:00
Campbell Barton
2b7ca2304a unify include guard defines, __$FILENAME__
without the underscores these clogged up the namespace for autocompleation which was annoying.
2012-02-17 18:59:41 +00:00
Campbell Barton
e84c0980a3 correct indentation and some whitespace edits (no functional changes) 2011-11-11 13:09:14 +00:00
Campbell Barton
4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
Nathan Letwory
b15161a2d3 doxygen: fixup and tag intern/ghost. 2011-02-25 11:28:33 +00:00
Nathan Letwory
3f96359d5a doxygen: make sure license blocks don't interfere. 2011-02-22 23:40:06 +00:00
Guillermo S. Romero
a46689b15d SVN maintenance. 2011-01-05 19:19:49 +00:00
Andrea Weikert
a45183125a Patch: [#22524] Update Windows Recent Documents on Open/Save
Slightly modified to better fit in architecture (moved to related GHOST SystemPaths)
Thanks to Harley Acheson for the research and for providing the original patch.

Note: I added empty function for X11(Linux) and Mac (Carbon and Cocoa) to be implemented still.
2011-01-05 14:56:10 +00:00
Andrea Weikert
195cc9c6a6 ToDo: long outstanding patch to allow access to system paths in background mode
Thanks Damien Plisson for contributing the Carbon and Cocoa implementation
2011-01-05 14:00:14 +00:00