0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 04:42:18 +02:00
obs-studio/plugins/mac-capture/window-utils.h
jp9000 c9df41c1e2 (API Change) Remove pointers from all typedefs
Typedef pointers are unsafe.  If you do:
typedef struct bla *bla_t;
then you cannot use it as a constant, such as: const bla_t, because
that constant will be to the pointer itself rather than to the
underlying data.  I admit this was a fundamental mistake that must
be corrected.

All typedefs that were pointer types will now have their pointers
removed from the type itself, and the pointers will be used when they
are actually used as variables/parameters/returns instead.

This does not break ABI though, which is pretty nice.
2014-09-25 21:48:11 -07:00

33 lines
770 B
Objective-C

#import <CoreGraphics/CGWindow.h>
#import <Cocoa/Cocoa.h>
#include <util/threading.h>
#include <obs-module.h>
struct cocoa_window {
CGWindowID window_id;
pthread_mutex_t name_lock;
NSString *owner_name;
NSString *window_name;
uint64_t next_search_time;
};
typedef struct cocoa_window *cocoa_window_t;
NSArray *enumerate_cocoa_windows(void);
bool find_window(cocoa_window_t cw, obs_data_t *settings, bool force);
void init_window(cocoa_window_t cw, obs_data_t *settings);
void destroy_window(cocoa_window_t cw);
void update_window(cocoa_window_t cw, obs_data_t *settings);
void window_defaults(obs_data_t *settings);
void add_window_properties(obs_properties_t *props);
void show_window_properties(obs_properties_t *props, bool show);