├── .gitignore ├── src ├── chunkc │ ├── README.md │ ├── makefile │ └── chunkc.c ├── core │ ├── dispatch │ │ ├── display.h │ │ ├── carbon.h │ │ ├── workspace.h │ │ ├── display.cpp │ │ ├── event.cpp │ │ ├── event.h │ │ ├── workspace.mm │ │ └── carbon.cpp │ ├── hotloader.h │ ├── config.h │ ├── clog.h │ ├── constants.h │ ├── state.h │ ├── cvar.h │ ├── wqueue.h │ ├── clog.c │ ├── hotload.h │ ├── plugin.h │ ├── hotloader.cpp │ ├── wqueue.cpp │ ├── cvar.cpp │ ├── sa_text.cpp │ └── sa.mm ├── plugins │ ├── tiling │ │ ├── config.h │ │ ├── examples │ │ │ ├── README.md │ │ │ └── khdrc │ │ ├── mouse.h │ │ ├── presel.h │ │ ├── misc.h │ │ ├── rule.h │ │ ├── makefile │ │ ├── region.h │ │ ├── vspace.h │ │ ├── controller.h │ │ ├── constants.h │ │ ├── node.h │ │ ├── presel.mm │ │ └── vspace.cpp │ ├── purify │ │ ├── makefile │ │ └── plugin.mm │ ├── template │ │ ├── makefile │ │ └── plugin.cpp │ ├── ffm │ │ ├── makefile │ │ ├── README.md │ │ └── CHANGELOG.md │ └── border │ │ ├── makefile │ │ ├── README.md │ │ └── CHANGELOG.md ├── common │ ├── misc │ │ ├── string.h │ │ ├── assert.h │ │ ├── workspace.h │ │ ├── profile.h │ │ ├── carbon.cpp │ │ ├── workspace.mm │ │ └── carbon.h │ ├── config │ │ ├── tokenize.h │ │ ├── cvar.h │ │ ├── cvar.cpp │ │ └── tokenize.cpp │ ├── ipc │ │ ├── daemon.h │ │ └── daemon.cpp │ ├── border │ │ ├── border.h │ │ └── border.mm │ ├── accessibility │ │ ├── application.h │ │ ├── observer.h │ │ ├── element.h │ │ ├── window.h │ │ ├── observer.cpp │ │ ├── window.cpp │ │ ├── application.cpp │ │ └── display.h │ └── dispatch │ │ ├── cgeventtap.h │ │ └── cgeventtap.cpp ├── api │ ├── plugin_cvar.h │ ├── plugin_export.h │ └── plugin_api.h └── completions │ └── _chunkc ├── docs ├── images │ └── chunkwm-logo.png ├── contact.html ├── styles │ └── style.css ├── screens.html ├── docs │ ├── source.html │ └── sa.html ├── index.html ├── docs.html └── api.md ├── .travis.yml ├── makefile ├── examples ├── com.koekeishiya.chunkwm.plist └── chunkwmrc ├── LICENSE.txt ├── README.md └── CHANGELOG.md /.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | /plugins 3 | -------------------------------------------------------------------------------- /src/chunkc/README.md: -------------------------------------------------------------------------------- 1 | *chunkc* is a program used to write to *chunkwms* socket. 2 | -------------------------------------------------------------------------------- /src/chunkc/makefile: -------------------------------------------------------------------------------- 1 | all: 2 | rm -rf ./bin 3 | mkdir ./bin 4 | clang chunkc.c -O2 -o bin/chunkc 5 | -------------------------------------------------------------------------------- /docs/images/chunkwm-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saforem2/chunkwm/HEAD/docs/images/chunkwm-logo.png -------------------------------------------------------------------------------- /src/core/dispatch/display.h: -------------------------------------------------------------------------------- 1 | #ifndef CHUNKWM_OSX_DISPLAY_H 2 | #define CHUNKWM_OSX_DISPLAY_H 3 | 4 | bool BeginDisplayHandler(); 5 | bool EndDisplayHandler(); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /src/plugins/tiling/config.h: -------------------------------------------------------------------------------- 1 | #ifndef PLUGIN_CONFIG_H 2 | #define PLUGIN_CONFIG_H 3 | 4 | void CommandCallback(int SockFD, const char *Type, const char *Message); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /src/core/hotloader.h: -------------------------------------------------------------------------------- 1 | #ifndef CHUNKWM_CORE_HOTLOADER_H 2 | #define CHUNKWM_CORE_HOTLOADER_H 3 | 4 | #include "hotload.h" 5 | 6 | void HotloadPlugins(hotloader *Hotloader, hotloader_callback Callback); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /src/plugins/tiling/examples/README.md: -------------------------------------------------------------------------------- 1 | *skhdrc* is a sample config for use with [**skhd**](https://github.com/koekeishiya/skhd) 2 | 3 | *khdrc* is a sample config for use with [**khd**](https://github.com/koekeishiya/khd) 4 | -------------------------------------------------------------------------------- /src/plugins/tiling/mouse.h: -------------------------------------------------------------------------------- 1 | #ifndef PLUGIN_MOUSE_H 2 | #define PLUGIN_MOUSE_H 3 | 4 | EVENTTAP_CALLBACK(EventTapCallback); 5 | bool BindMouseMoveAction(const char *BindSym); 6 | bool BindMouseResizeAction(const char *BindSym); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /src/core/config.h: -------------------------------------------------------------------------------- 1 | #ifndef CHUNKWM_CORE_CONFIG_H 2 | #define CHUNKWM_CORE_CONFIG_H 3 | 4 | struct chunkwm_delegate 5 | { 6 | int SockFD; 7 | char *Target; 8 | char *Command; 9 | const char *Message; 10 | }; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /src/common/misc/string.h: -------------------------------------------------------------------------------- 1 | #ifndef CHUNKWM_COMMON_STRING_H 2 | #define CHUNKWM_COMMON_STRING_H 3 | 4 | #include 5 | 6 | struct string_comparator { 7 | bool operator()(const char *A, const char *B) const 8 | { 9 | return strcmp(A, B) < 0; 10 | } 11 | }; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /src/common/misc/assert.h: -------------------------------------------------------------------------------- 1 | #ifndef CHUNKWM_COMMON_ASSERT_H 2 | #define CHUNKWM_COMMON_ASSERT_H 3 | 4 | #ifdef CHUNKWM_DEBUG 5 | #include 6 | #define ASSERT(Condition) do { if(!(Condition)) {\ 7 | printf("#%d:%s:%s: assert failed '%s'\n", \ 8 | __LINE__, __FILE__, __FUNCTION__, #Condition); \ 9 | *(int volatile *)0 = 0; \ 10 | } } while(0) 11 | #else 12 | #define ASSERT(Ignored) 13 | #endif 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /src/core/clog.h: -------------------------------------------------------------------------------- 1 | #ifndef CHUNKWM_CORE_CLOG_H 2 | #define CHUNKWM_CORE_CLOG_H 3 | 4 | #include 5 | 6 | enum c_log_level 7 | { 8 | C_LOG_LEVEL_DEBUG = 0, 9 | C_LOG_LEVEL_PROFILE = 1, 10 | C_LOG_LEVEL_WARN = 2, 11 | C_LOG_LEVEL_ERROR = 3, 12 | C_LOG_LEVEL_NONE = 10, 13 | }; 14 | 15 | extern enum c_log_level c_log_active_level; 16 | extern FILE *c_log_output_file; 17 | void c_log(enum c_log_level level, const char *format, ...); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/common/misc/workspace.h: -------------------------------------------------------------------------------- 1 | #ifndef CHUNKWM_COMMON_WS_H 2 | #define CHUNKWM_COMMON_WS_H 3 | 4 | #include 5 | 6 | enum application_launch_state 7 | { 8 | Application_State_Failed, 9 | Application_State_Launching, 10 | Application_State_Launched 11 | }; 12 | 13 | char *WorkspaceCopyProcessNameAndPolicy(pid_t PID, uint32_t *ProcessPolicy); 14 | char *WorkspaceCopyProcessName(pid_t PID); 15 | application_launch_state WorkspaceGetApplicationLaunchState(pid_t PID); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/core/dispatch/carbon.h: -------------------------------------------------------------------------------- 1 | #ifndef CHUNKWM_OSX_CARBON_H 2 | #define CHUNKWM_OSX_CARBON_H 3 | 4 | #include 5 | #include "../../common/misc/carbon.h" 6 | 7 | struct carbon_event_handler 8 | { 9 | EventTargetRef EventTarget; 10 | EventHandlerUPP EventHandler; 11 | EventTypeSpec EventType[2]; 12 | EventHandlerRef CurHandler; 13 | }; 14 | 15 | bool BeginCarbonEventHandler(carbon_event_handler *Carbon); 16 | bool EndCarbonEventHandler(carbon_event_handler *Carbon); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /src/core/dispatch/workspace.h: -------------------------------------------------------------------------------- 1 | #ifndef CHUNKWM_OSX_WS_H 2 | #define CHUNKWM_OSX_WS_H 3 | 4 | #include 5 | 6 | struct workspace_application_details 7 | { 8 | char *ProcessName; 9 | ProcessSerialNumber PSN; 10 | pid_t PID; 11 | }; 12 | 13 | void BeginSharedWorkspace(); 14 | void EndWorkspaceApplicationDetails(workspace_application_details *Info); 15 | workspace_application_details *BeginWorkspaceApplicationDetails(char *ProcessName, ProcessSerialNumber PSN, pid_t PID); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/common/config/tokenize.h: -------------------------------------------------------------------------------- 1 | #ifndef CHUNKWM_COMMON_TOKENIZE_H 2 | #define CHUNKWM_COMMON_TOKENIZE_H 3 | 4 | struct token 5 | { 6 | const char *Text; 7 | unsigned Length; 8 | }; 9 | 10 | bool TokenEquals(token Token, const char *Match); 11 | char *TokenToString(token Token); 12 | float TokenToFloat(token Token); 13 | int TokenToInt(token Token); 14 | unsigned TokenToUnsigned(token Token); 15 | bool TokenIsDigit(token Token); 16 | 17 | // NOTE(koekeishiya): simple 'whitespace' tokenizer 18 | token GetToken(const char **Data); 19 | #endif 20 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | osx_image: xcode9.4 3 | env: 4 | - BUILD_DIR=. 5 | - BUILD_DIR=./src/plugins/tiling 6 | - BUILD_DIR=./src/plugins/border 7 | - BUILD_DIR=./src/plugins/ffm 8 | script: cd $BUILD_DIR && make install 9 | notifications: 10 | irc: 11 | channels: 12 | - "irc.freenode.net#chunkwm" 13 | template: 14 | - "%{repository_slug} (%{commit}) : %{commit_message} " 15 | - "Build details (%{result}): %{build_url}" 16 | use_notice: true 17 | skip_join: true 18 | 19 | -------------------------------------------------------------------------------- /src/plugins/tiling/presel.h: -------------------------------------------------------------------------------- 1 | #ifndef PRESEL_H 2 | #define PRESEL_H 3 | 4 | #define PRESEL_TYPE_NORTH 0 5 | #define PRESEL_TYPE_EAST 1 6 | #define PRESEL_TYPE_SOUTH 2 7 | #define PRESEL_TYPE_WEST 3 8 | 9 | struct presel_window 10 | { 11 | int Type; 12 | int Width; 13 | unsigned Color; 14 | }; 15 | 16 | presel_window *CreatePreselWindow(int Type, int X, int Y, int W, int H, int Width, unsigned Color); 17 | void UpdatePreselWindow(presel_window *Window, int X, int Y, int W, int H); 18 | void DestroyPreselWindow(presel_window *Window); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /src/plugins/purify/makefile: -------------------------------------------------------------------------------- 1 | BUILD_FLAGS = -O0 -g -std=c++11 -Wall 2 | BUILD_PATH = ./../../../plugins 3 | SRC = ./plugin.mm 4 | BINS = $(BUILD_PATH)/purify.so 5 | LINK = -shared -fPIC -framework Carbon -framework Cocoa -framework ApplicationServices 6 | 7 | all: $(BINS) 8 | 9 | install: BUILD_FLAGS=-O2 -std=c++11 -Wall 10 | install: clean $(BINS) 11 | 12 | .PHONY: all clean install 13 | 14 | $(BUILD_PATH): 15 | mkdir -p $(BUILD_PATH) 16 | 17 | clean: 18 | rm -f $(BUILD_PATH)/purify.so 19 | 20 | $(BUILD_PATH)/purify.so: $(SRC) | $(BUILD_PATH) 21 | clang++ $^ $(BUILD_FLAGS) -o $@ $(LINK) 22 | -------------------------------------------------------------------------------- /src/core/constants.h: -------------------------------------------------------------------------------- 1 | #ifndef CHUNKWM_CORE_CONSTANTS_H 2 | #define CHUNKWM_CORE_CONSTANTS_H 3 | 4 | #define MAX_LEN 256 5 | 6 | #define CHUNKWM_MAJOR 0 7 | #define CHUNKWM_MINOR 4 8 | #define CHUNKWM_PATCH 10 9 | 10 | #define CHUNKWM_THREAD_COUNT 4 11 | 12 | #define CHUNKWM_CONFIG ".chunkwmrc" 13 | #define CHUNKWM_PORT 3920 14 | 15 | #define CVAR_PLUGIN_DIR "plugin_dir" 16 | #define CVAR_PLUGIN_HOTLOAD "hotload" 17 | #define CVAR_LOG_LEVEL "log_level" 18 | #define CVAR_LOG_FILE "log_file" 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /src/plugins/template/makefile: -------------------------------------------------------------------------------- 1 | BUILD_FLAGS = -O0 -g -std=c++11 -Wall 2 | BUILD_PATH = ./../../../plugins 3 | SRC = ./plugin.cpp 4 | BINS = $(BUILD_PATH)/template.so 5 | LINK = -shared -fPIC -framework Carbon -framework Cocoa -framework ApplicationServices 6 | 7 | all: $(BINS) 8 | 9 | install: BUILD_FLAGS=-O2 -std=c++11 -Wall 10 | install: clean $(BINS) 11 | 12 | .PHONY: all clean install 13 | 14 | $(BUILD_PATH): 15 | mkdir -p $(BUILD_PATH) 16 | 17 | clean: 18 | rm -f $(BUILD_PATH)/template.so 19 | 20 | $(BUILD_PATH)/template.so: $(SRC) | $(BUILD_PATH) 21 | clang++ $^ $(BUILD_FLAGS) -o $@ $(LINK) 22 | -------------------------------------------------------------------------------- /src/core/state.h: -------------------------------------------------------------------------------- 1 | #ifndef CHUNKWM_CORE_STATE_H 2 | #define CHUNKWM_CORE_STATE_H 3 | 4 | #include 5 | 6 | struct macos_window; 7 | bool AddWindowToCollection(macos_window *Window); 8 | void RemoveWindowFromCollection(macos_window *Window); 9 | void UpdateWindowCollection(); 10 | 11 | void UpdateWindowTitle(macos_window *Window); 12 | 13 | struct macos_application; 14 | macos_application *GetApplicationFromPID(pid_t PID); 15 | void ConstructAndAddApplication(carbon_application_details *Info); 16 | void RemoveAndDestroyApplication(macos_application *Application); 17 | 18 | bool InitState(); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /src/common/misc/profile.h: -------------------------------------------------------------------------------- 1 | #ifndef CHUNKWM_COMMON_PROFILE_H 2 | #define CHUNKWM_COMMON_PROFILE_H 3 | 4 | #ifdef CHUNKWM_PROFILE 5 | #include 6 | #define BEGIN_TIMED_BLOCK() \ 7 | clock_t timed_block_begin = clock() 8 | #define END_TIMED_BLOCK() \ 9 | clock_t timed_block_end = clock(); \ 10 | double timed_block_elapsed = ((timed_block_end - timed_block_begin) / (double)CLOCKS_PER_SEC) * 1000.0f; \ 11 | c_log(C_LOG_LEVEL_PROFILE, "#%d:%s:%s = %.8fms\n", __LINE__, __FILE__, __FUNCTION__, timed_block_elapsed) 12 | #else 13 | #define BEGIN_TIMED_BLOCK() 14 | #define END_TIMED_BLOCK() 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/common/ipc/daemon.h: -------------------------------------------------------------------------------- 1 | #ifndef CHUNKWM_COMMON_DAEMON_H 2 | #define CHUNKWM_COMMON_DAEMON_H 3 | 4 | #define DAEMON_CALLBACK(name) void name(const char *Message, int SockFD) 5 | typedef DAEMON_CALLBACK(daemon_callback); 6 | 7 | bool StartDaemon(int Port, daemon_callback Callback); 8 | bool StartDaemon(char *SocketPath, daemon_callback *Callback); 9 | 10 | void StopDaemon(); 11 | 12 | bool ConnectToDaemon(int *SockFD, int Port); 13 | bool ConnectToDaemon(int *SockFD, char *SocketPath); 14 | 15 | void WriteToSocket(const char *Message, int SockFD); 16 | char *ReadFromSocket(int SockFD); 17 | void CloseSocket(int SockFD); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/plugins/ffm/makefile: -------------------------------------------------------------------------------- 1 | BUILD_FLAGS = -O0 -g -DCHUNKWM_DEBUG -std=c++11 -Wall 2 | BUILD_PATH = ./../../../plugins 3 | SRC = ./plugin.cpp 4 | BINS = $(BUILD_PATH)/ffm.so 5 | LINK = -shared -fPIC -framework Carbon -framework ApplicationServices -F/System/Library/PrivateFrameworks -framework SkyLight 6 | 7 | all: $(BINS) 8 | 9 | install: BUILD_FLAGS=-O2 -std=c++11 -Wall 10 | install: clean $(BINS) 11 | 12 | .PHONY: all clean install 13 | 14 | $(BUILD_PATH): 15 | mkdir -p $(BUILD_PATH) 16 | 17 | clean: 18 | rm -f $(BUILD_PATH)/ffm.so 19 | 20 | $(BUILD_PATH)/ffm.so: $(SRC) | $(BUILD_PATH) 21 | clang++ $^ $(BUILD_FLAGS) -o $@ $(LINK) 22 | -------------------------------------------------------------------------------- /src/common/border/border.h: -------------------------------------------------------------------------------- 1 | #ifndef CHUNKWM_COMMON_BORDER_H 2 | #define CHUNKWM_COMMON_BORDER_H 3 | 4 | struct border_window 5 | { 6 | int Width; 7 | int Radius; 8 | unsigned Color; 9 | bool Outline; 10 | }; 11 | 12 | border_window *CreateBorderWindow(int X, int Y, int W, int H, int BorderWidth, int BorderRadius, unsigned int BorderColor, bool BorderOutline); 13 | void UpdateBorderWindowRect(border_window *Border, int X, int Y, int W, int H, bool BorderOutline); 14 | void UpdateBorderWindowColor(border_window *Border, unsigned Color); 15 | void UpdateBorderWindowWidth(border_window *Border, int BorderWidth); 16 | void DestroyBorderWindow(border_window *Border); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /src/core/cvar.h: -------------------------------------------------------------------------------- 1 | #ifndef CHUNKWM_CORE_CVAR_H 2 | #define CHUNKWM_CORE_CVAR_H 3 | 4 | #include 5 | 6 | #include "../common/config/cvar.h" 7 | #include "../common/misc/string.h" 8 | 9 | typedef std::map cvar_map; 10 | typedef cvar_map::iterator cvar_map_it; 11 | 12 | bool BeginCVars(); 13 | void EndCVars(); 14 | 15 | // NOTE(koekeishiya): API - Exposed to plugins through pointer 16 | void UpdateCVarAPI(const char *Name, char *Value); 17 | 18 | // NOTE(koekeishiya): API - Exposed to plugins through pointer 19 | char *AcquireCVarAPI(const char *Name); 20 | 21 | // NOTE(koekeishiya): API - Exposed to plugins through pointer 22 | bool FindCVarAPI(const char *Name); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /makefile: -------------------------------------------------------------------------------- 1 | BUILD_FLAGS = -O0 -g -DCHUNKWM_DEBUG -std=c++11 -Wall -Wno-deprecated 2 | BUILD_PATH = ./bin 3 | SRC = ./src/core/chunkwm.mm 4 | BINS = $(BUILD_PATH)/chunkwm 5 | LINK = -rdynamic -ldl -lpthread -framework Carbon -framework Cocoa -framework ScriptingBridge -DGIT_VERSION=\"$(GIT_VERSION)\" 6 | GIT_VERSION := "$(shell git describe --abbrev=4 --dirty --always)" 7 | 8 | 9 | all: $(BINS) 10 | 11 | install: BUILD_FLAGS=-O2 -std=c++11 -Wall -Wno-deprecated 12 | install: clean $(BINS) 13 | 14 | .PHONY: all clean install 15 | 16 | $(BINS): | $(BUILD_PATH) 17 | 18 | $(BUILD_PATH): 19 | mkdir -p $(BUILD_PATH) 20 | 21 | clean: 22 | rm -rf $(BUILD_PATH) 23 | 24 | $(BUILD_PATH)/chunkwm: $(SRC) 25 | clang++ $^ $(BUILD_FLAGS) -o $@ $(LINK) 26 | -------------------------------------------------------------------------------- /src/common/accessibility/application.h: -------------------------------------------------------------------------------- 1 | #ifndef AXLIB_APPLICATION_H 2 | #define AXLIB_APPLICATION_H 3 | 4 | #include 5 | #include 6 | 7 | #include "observer.h" 8 | 9 | struct macos_application 10 | { 11 | AXUIElementRef Ref; 12 | macos_observer Observer; 13 | 14 | char *Name; 15 | pid_t PID; 16 | ProcessSerialNumber PSN; 17 | }; 18 | 19 | macos_application *AXLibConstructFocusedApplication(); 20 | macos_application *AXLibConstructApplication(ProcessSerialNumber PSN, pid_t PID, char *Name); 21 | void AXLibDestroyApplication(macos_application *Application); 22 | bool AXLibAddApplicationObserver(macos_application *Application, ObserverCallback Callback); 23 | 24 | std::vector AXLibRunningProcesses(uint32_t ProcessFlags); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /examples/com.koekeishiya.chunkwm.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Label 6 | com.koekeishiya.chunkwm 7 | ProgramArguments 8 | 9 | /usr/local/bin/chunkwm 10 | 11 | EnvironmentVariables 12 | 13 | PATH 14 | /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin 15 | 16 | RunAtLoad 17 | 18 | KeepAlive 19 | 20 | StandardOutPath 21 | /tmp/chunkwm.out 22 | StandardErrorPath 23 | /tmp/chunkwm.err 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/common/config/cvar.h: -------------------------------------------------------------------------------- 1 | #ifndef CHUNKWM_COMMON_CVAR_H 2 | #define CHUNKWM_COMMON_CVAR_H 3 | 4 | struct chunkwm_api; 5 | void BeginCVars(chunkwm_api *Api); 6 | 7 | bool CVarExists(const char *Name); 8 | 9 | void UpdateCVar(const char *Name, int Value); 10 | void UpdateCVar(const char *Name, unsigned Value); 11 | void UpdateCVar(const char *Name, float Value); 12 | void UpdateCVar(const char *Name, char *Value); 13 | 14 | void CreateCVar(const char *Name, int Value); 15 | void CreateCVar(const char *Name, unsigned Value); 16 | void CreateCVar(const char *Name, float Value); 17 | void CreateCVar(const char *Name, char *Value); 18 | 19 | int CVarIntegerValue(const char *Name); 20 | int CVarUnsignedValue(const char *Name); 21 | float CVarFloatingPointValue(const char *Name); 22 | char *CVarStringValue(const char *Name); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/core/wqueue.h: -------------------------------------------------------------------------------- 1 | #ifndef CHUNKWM_CORE_WQUEUE_H 2 | #define CHUNKWM_CORE_WQUEUE_H 3 | 4 | #include 5 | #include 6 | 7 | #define WORK_QUEUE_CALLBACK(name) void name(void *Data) 8 | typedef WORK_QUEUE_CALLBACK(work_queue_callback); 9 | 10 | struct work_queue_entry 11 | { 12 | work_queue_callback *Callback; 13 | void *Data; 14 | }; 15 | 16 | struct work_queue 17 | { 18 | uint32_t volatile EntriesCompleted; 19 | uint32_t volatile EntryCount; 20 | uint32_t volatile EntryToWrite; 21 | uint32_t volatile EntryToRead; 22 | sem_t *Semaphore; 23 | 24 | work_queue_entry Entries[256]; 25 | }; 26 | 27 | void CompleteWorkQueue(work_queue *Queue); 28 | void AddWorkQueueEntry(work_queue *Queue, work_queue_callback *Callback, void *Data); 29 | void *WorkQueueThreadProc(void *Data); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /src/plugins/ffm/README.md: -------------------------------------------------------------------------------- 1 | #### chunkwm-ffm configuration index 2 | 3 | * [config settings](#config-settings) 4 | * [bypass ffm temporarily](#bypass-ffm-temporarily) 5 | * [standby on float](#standby-on-float) 6 | * [disable raise](#disable-raise) 7 | 8 | #### config settings 9 | 10 | Changing config settings require a plugin reload to take affect. 11 | 12 | ##### bypass ffm temporarily 13 | 14 | chunkc set ffm_bypass_modifier