Make it possible to have implementations in different toolkits.

Also, make it possible to share the headers.
This commit is contained in:
Jonathan Schleifer 2011-12-27 23:38:07 +01:00
parent b5f40d159e
commit 73e7da5fb7
16 changed files with 3 additions and 3 deletions

23
headers/OGApplication.h Normal file
View file

@ -0,0 +1,23 @@
#include <gtk/gtk.h>
#import <ObjFW/ObjFW.h>
@protocol OGApplicationDelegate <OFObject>
- (void)applicationDidFinishLaunching;
@optional
- (void)applicationWillTerminate;
@end
@interface OGApplication: OFObject <OFApplicationDelegate>
{
id <OFApplicationDelegate> delegate;
}
+ (void)quit;
@end
#define OG_APPLICATION_DELEGATE(cls) \
Class \
og_application_delegate() { \
return [cls class]; \
}

14
headers/OGBox.h Normal file
View file

@ -0,0 +1,14 @@
#import "OGWidget.h"
@interface OGBox: OGWidget
+ box;
- (void)appendChild: (OGWidget*)child
expand: (BOOL)expand
fill: (BOOL)fill
padding: (float)padding;
- (void)prependChild: (OGWidget*)child
expand: (BOOL)expand
fill: (BOOL)fill
padding: (float)padding;
@end

19
headers/OGButton.h Normal file
View file

@ -0,0 +1,19 @@
#import "OGWidget.h"
@class OGButton;
@protocol OGButtonDelegate <OFObject>
@optional
- (void)buttonWasClicked: (OGButton*)button;
@end
@interface OGButton: OGWidget
{
id <OGButtonDelegate> delegate;
}
@property (assign) id <OGButtonDelegate> delegate;
@property (copy) OFString *label;
+ button;
@end

4
headers/OGHBox.h Normal file
View file

@ -0,0 +1,4 @@
#import "OGBox.h"
@interface OGHBox: OGBox
@end

4
headers/OGVBox.h Normal file
View file

@ -0,0 +1,4 @@
#import "OGBox.h"
@interface OGVBox: OGBox
@end

15
headers/OGWidget.h Normal file
View file

@ -0,0 +1,15 @@
#include <gtk/gtk.h>
#import <ObjFW/ObjFW.h>
@interface OGWidget: OFObject
{
@public
GtkWidget *widget;
}
- (void)show;
- (void)hide;
@end
extern void og_destroy(GtkWidget*, OGWidget*);

22
headers/OGWindow.h Normal file
View file

@ -0,0 +1,22 @@
#import "OGWidget.h"
@class OGWindow;
@protocol OGWindowDelegate <OFObject>
@optional
- (BOOL)windowWillClose: (OGWindow*)window;
@end
@interface OGWindow: OGWidget
{
id <OGWindowDelegate> delegate;
}
@property (assign) id <OGWindowDelegate> delegate;
@property (copy) OFString *title;
@property (assign) of_point_t position;
@property (assign) of_dimension_t dimension;
+ window;
- (void)addChild: (OGWidget*)widget;
@end