ObjGUI  Check-in [f711c6f48c]

Overview
Comment:Rename OG_W32 to OG_WIN32.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: f711c6f48c297fb3a975dde5b37570a2a94b55ed3ce954102611cded69df8127
User & Date: js on 2012-01-05 14:50:28
Other Links: manifest | tags
Context
2012-01-05
15:08
Clean up headers a little. check-in: ab5fc3316f user: js tags: trunk
14:50
Rename OG_W32 to OG_WIN32. check-in: f711c6f48c user: js tags: trunk
14:39
Unbreak Gtk. check-in: 39b3140423 user: js tags: trunk
Changes

Modified headers/OGBox.h from [19a668760d] to [1a3aaad4f9].

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#import "OGWidget.h"

#ifdef OG_W32
typedef struct s_OGBoxChild
{
	HWND  hwnd;
	BOOL  expand;
	BOOL  fill;
	int   padding;
	int   originalSize;
	float currentSize;
	struct s_OGBoxChild *next;
} OGBoxChild;
#endif

@interface OGBox: OGWidget
#ifdef OG_W32
{ OGBoxChild *firstBorn; }
- (void)resizeChildren;
#endif
+ 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
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#import "OGWidget.h"

#ifdef OG_WIN32
typedef struct s_OGBoxChild
{
	HWND  hwnd;
	BOOL  expand;
	BOOL  fill;
	int   padding;
	int   originalSize;
	float currentSize;
	struct s_OGBoxChild *next;
} OGBoxChild;
#endif

@interface OGBox: OGWidget
#ifdef OG_WIN32
{ OGBoxChild *firstBorn; }
- (void)resizeChildren;
#endif
+ 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

Modified headers/OGComboBox.h from [66411fb990] to [b4c169f6cb].

39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56

@interface OGComboBox: OGWidget
{
	id <OGComboBoxDelegate> delegate;
	id <OGComboBoxDataSource> dataSource;
}

#ifdef OG_W32
//unfortunately, the built-in Win32 ListBox stores a pointer to it's parent (for sending selection changed notifications) during CreateWindow().
//it does not update it after a SetParent()... unless we implement a custom ListBox control i don't see a way around this...
- initWithParent : (OGWidget *)parent;
#endif

@property (assign) id <OGComboBoxDelegate> delegate;
@property (assign) id <OGComboBoxDataSource> dataSource;

+ comboBox;
@end







|










39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56

@interface OGComboBox: OGWidget
{
	id <OGComboBoxDelegate> delegate;
	id <OGComboBoxDataSource> dataSource;
}

#ifdef OG_WIN32
//unfortunately, the built-in Win32 ListBox stores a pointer to it's parent (for sending selection changed notifications) during CreateWindow().
//it does not update it after a SetParent()... unless we implement a custom ListBox control i don't see a way around this...
- initWithParent : (OGWidget *)parent;
#endif

@property (assign) id <OGComboBoxDelegate> delegate;
@property (assign) id <OGComboBoxDataSource> dataSource;

+ comboBox;
@end

Modified headers/OGWidget.h from [9684a37946] to [563c683763].

17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#ifdef OG_GTK
# include <gtk/gtk.h>
#endif
#ifdef OG_W32
# include <windows.h>
#endif

#import <ObjFW/ObjFW.h>

@interface OGWidget: OFObject
{
@public
#ifdef OG_GTK
	GtkWidget *widget;
#endif
#ifdef OG_W32
	HWND widget;
#endif
}

- (void)show;
- (void)hide;
@end

#ifdef OG_GTK
extern void og_destroy(GtkWidget*, OGWidget*);
#endif
#ifdef OG_W32
extern void og_destroy(HWND widget, OGWidget *object);
#endif







|

<
|








|

<
|








|

<
|


17
18
19
20
21
22
23
24
25

26
27
28
29
30
31
32
33
34
35
36

37
38
39
40
41
42
43
44
45
46
47

48
49
50
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#if defined(OG_GTK)
# include <gtk/gtk.h>

#elif defined(OG_WIN32)
# include <windows.h>
#endif

#import <ObjFW/ObjFW.h>

@interface OGWidget: OFObject
{
@public
#if defined(OG_GTK)
	GtkWidget *widget;

#elif defined(OG_WIN32)
	HWND widget;
#endif
}

- (void)show;
- (void)hide;
@end

#if defined(OG_GTK)
extern void og_destroy(GtkWidget*, OGWidget*);

#elif defined(OG_WIN32)
extern void og_destroy(HWND widget, OGWidget *object);
#endif

Modified win32/Makefile from [2dc76f23f3] to [99a786d626].

1
2
3
4
5
6
7
8
9
10
11
12
PREFIX ?= /usr/local

all : test.exe

%.o : %.m
	gcc -g -DOG_W32 -I../headers -c -o $@ $^ `objfw-config --cppflags --objcflags`

test.exe : OGApplication.o OGWidget.o OGWindow.o OGBox.o OGVBox.o OGHBox.o OGButton.o OGComboBox.o OGComboBoxItem.o test.o
	gcc -mwindows -o test.exe *.o `objfw-config --libs`

clean :
	rm -f *.exe *.o





|






1
2
3
4
5
6
7
8
9
10
11
12
PREFIX ?= /usr/local

all : test.exe

%.o : %.m
	gcc -g -DOG_WIN32 -I../headers -c -o $@ $^ `objfw-config --cppflags --objcflags`

test.exe : OGApplication.o OGWidget.o OGWindow.o OGBox.o OGVBox.o OGHBox.o OGButton.o OGComboBox.o OGComboBoxItem.o test.o
	gcc -mwindows -o test.exe *.o `objfw-config --libs`

clean :
	rm -f *.exe *.o