Revision 614eb7a0
Von martin vor etwa 15 Jahren hinzugefügt
configure.ac | ||
---|---|---|
GWENHYWFAR_VERSION_MAJOR=3
|
||
GWENHYWFAR_VERSION_MINOR=99
|
||
GWENHYWFAR_VERSION_PATCHLEVEL=16
|
||
GWENHYWFAR_VERSION_BUILD=0
|
||
GWENHYWFAR_VERSION_BUILD=2
|
||
dnl "stable", "rcX", "betaX", "cvs"
|
||
GWENHYWFAR_VERSION_TAG="beta"
|
||
GWENHYWFAR_VERSION_TAG="svn"
|
||
|
||
|
||
|
||
... | ... | |
AQ_CHECK_OS
|
||
|
||
|
||
if test "$OSYSTEM" = "osx"; then
|
||
COCOA_FRAMEWORK="-framework Cocoa"
|
||
FOUNDATION_FRAMEWORK="-framework CoreFoundation"
|
||
SYSCONF_FRAMEWORK="-framework SystemConfiguration"
|
||
APPKIT_FRAMEWORK="-framework AppKit"
|
||
COREDATA_FRAMEWORK="-framework CoreData"
|
||
fi
|
||
AC_SUBST(COCOA_FRAMEWORK)
|
||
AC_SUBST(FOUNDATION_FRAMEWORK)
|
||
AC_SUBST(SYSCONF_FRAMEWORK)
|
||
AC_SUBST(APPKIT_FRAMEWORK)
|
||
AC_SUBST(COREDATA_FRAMEWORK)
|
||
|
||
|
||
###-------------------------------------------------------------------------
|
||
# prefix handling
|
||
|
||
... | ... | |
#
|
||
AC_PROG_CC
|
||
AC_PROG_CXX
|
||
AC_PROG_OBJC
|
||
AC_PROG_INSTALL
|
||
|
||
AC_LIBTOOL_WIN32_DLL
|
||
... | ... | |
gui/fox16/Makefile
|
||
gui/fox16/gwengui-fox16.pc
|
||
gui/gtk2/Makefile
|
||
gui/cocoa/Makefile
|
||
gui/testdialogs/Makefile
|
||
])
|
||
AC_OUTPUT
|
||
... | ... | |
|
||
|
||
|
||
# cocoa
|
||
#
|
||
rm -Rf gwenhywfar4/gwen-gui-cocoa 2>/dev/null
|
||
mkdir -p gwenhywfar4/gwen-gui-cocoa
|
||
for d in gui/cocoa; do
|
||
hfiles=`( cd "${srcdir}/${d}" && ls *.h 2>/dev/null )`
|
||
for f in ${hfiles}; do
|
||
case ${f} in
|
||
*_l.h | *_p.h | gtk2_gui_*.h)
|
||
;;
|
||
*)
|
||
ln -s "${lprefix}/${d}/${f}" "gwenhywfar4/gwen-gui-cocoa/${f}"
|
||
;;
|
||
esac
|
||
done
|
||
done
|
||
|
||
|
||
|
||
|
||
###-------------------------------------------------------------------------
|
||
#
|
gui/Makefile.am | ||
---|---|---|
SUBDIRS=testdialogs cpp @gwenhywfar_guis@
|
||
DIST_SUBDIRS=testdialogs cpp qt3 qt4 fox16 gtk2
|
||
DIST_SUBDIRS=testdialogs cpp qt3 qt4 fox16 gtk2 cocoa
|
||
|
||
sources:
|
||
for d in $(SUBDIRS); do \
|
gui/cocoa/Makefile.am | ||
---|---|---|
INCLUDES=-I$(gwenhywfar_symlinkdir) $(COCOA_CFLAGS)
|
||
|
||
AM_CPPFLAGS= @visibility_cflags@
|
||
DEFS+=-DBUILDING_COCOA_GUI -DPACKAGE=\"$(PACKAGE)\"
|
||
|
||
lib_LTLIBRARIES=libgwengui-cocoa.la
|
||
|
||
|
||
libgwengui_cocoa_la_LIBADD=$(top_builddir)/src/$(gwenhywfar_internal_libname) \
|
||
$(COCOA_FRAMEWORK) $(FOUNDATION_FRAMEWORK) $(APPKIT_FRAMEWORK) $(COREDATA_FRAMEWORK) \
|
||
-lobjc
|
||
|
||
#libgwengui_cocoa_la_LDFLAGS=
|
||
noinst_HEADERS=\
|
||
cocoa_gui_p.h
|
||
|
||
libgwengui_cocoa_la_SOURCES=\
|
||
cocoa_gui.mm
|
||
|
||
|
||
iheaderdir=${includedir}/gwen-gui-cocoa
|
||
iheader_HEADERS= \
|
||
cocoa_gui.h
|
||
|
||
|
||
noinst_PROGRAMS = libtest
|
||
libtest_SOURCES = libtest.m
|
||
#libtest_LDFLAGS=
|
||
libtest_LDADD = libgwengui-cocoa.la $(top_builddir)/src/$(gwenhywfar_internal_libname) \
|
||
$(COCOA_FRAMEWORK) $(FOUNDATION_FRAMEWORK) $(APPKIT_FRAMEWORK) $(COREDATA_FRAMEWORK) \
|
||
-lobjc \
|
||
$(builddir)/../testdialogs/libgwengui-test.la
|
||
|
gui/cocoa/cocoa_gui.h | ||
---|---|---|
/***************************************************************************
|
||
begin : August 03 2010
|
||
copyright : (C) 2010 by Samuel Strupp
|
||
|
||
***************************************************************************
|
||
* Please see toplevel file COPYING for license details *
|
||
***************************************************************************/
|
||
|
||
|
||
|
||
#ifndef COCOA_GUI_H
|
||
#define COCOA_GUI_H
|
||
|
||
|
||
//#include <gtk/gtk.h>
|
||
|
||
|
||
#if defined __GNUC__ && (! defined (__sun)) && (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))
|
||
# ifdef BUILDING_COCOA_GUI
|
||
# define COCOAGUI_API __attribute__ ((visibility("default")))
|
||
# else
|
||
# define COCOAGUI_API
|
||
# endif
|
||
#else
|
||
# define COCOAGUI_API
|
||
#endif
|
||
|
||
|
||
#include <gwenhywfar/gui.h>
|
||
#include <gwenhywfar/gui_be.h>
|
||
|
||
|
||
|
||
COCOAGUI_API GWEN_GUI *Cocoa_Gui_new();
|
||
|
||
|
||
#endif
|
||
|
gui/cocoa/cocoa_gui.mm | ||
---|---|---|
/***************************************************************************
|
||
begin : August 03 2010
|
||
copyright : (C) 2010 by Samuel Strupp
|
||
|
||
***************************************************************************
|
||
* Please see toplevel file COPYING for license details *
|
||
***************************************************************************/
|
||
|
||
#ifdef HAVE_CONFIG_H
|
||
# include <config.h>
|
||
#endif
|
||
|
||
|
||
#include "cocoa_gui_p.h"
|
||
|
||
#include <assert.h>
|
||
|
||
#include <gwenhywfar/inherit.h>
|
||
#include <gwenhywfar/debug.h>
|
||
#include <gwenhywfar/gui_be.h>
|
||
#include <gwenhywfar/i18n.h>
|
||
|
||
#include <gwenhywfar/text.h>
|
||
#include <gwenhywfar/mdigest.h>
|
||
#include <gwenhywfar/debug.h>
|
||
|
||
|
||
GWEN_INHERIT(GWEN_GUI, COCOA_GUI)
|
||
|
||
|
||
#define I18N(msg) GWEN_I18N_Translate(PACKAGE, msg)
|
||
|
||
|
||
|
||
GWEN_GUI *Cocoa_Gui_new() {
|
||
GWEN_GUI *gui;
|
||
COCOA_GUI *xgui;
|
||
|
||
gui=GWEN_Gui_new();
|
||
GWEN_NEW_OBJECT(COCOA_GUI, xgui);
|
||
GWEN_INHERIT_SETDATA(GWEN_GUI, COCOA_GUI, gui, xgui, Cocoa_Gui_FreeData);
|
||
|
||
GWEN_Gui_AddFlags(gui, GWEN_GUI_FLAGS_DIALOGSUPPORTED);
|
||
GWEN_Gui_UseDialogs(gui);
|
||
xgui->execDialogFn=GWEN_Gui_SetExecDialogFn(gui, COCOA_Gui_ExecDialog);
|
||
xgui->openDialogFn=GWEN_Gui_SetOpenDialogFn(gui, COCOA_Gui_OpenDialog);
|
||
xgui->closeDialogFn=GWEN_Gui_SetCloseDialogFn(gui, COCOA_Gui_CloseDialog);
|
||
xgui->runDialogFn=GWEN_Gui_SetRunDialogFn(gui, COCOA_Gui_RunDialog);
|
||
xgui->getFileNameDialogFn=GWEN_Gui_SetGetFileNameFn(gui, COCOA_Gui_GetFileName);
|
||
|
||
return gui;
|
||
}
|
||
|
||
|
||
|
||
void Cocoa_Gui_FreeData(void *bp, void *p) {
|
||
COCOA_GUI *xgui;
|
||
|
||
xgui=(COCOA_GUI*) p;
|
||
|
||
GWEN_FREE_OBJECT(xgui);
|
||
}
|
||
|
||
|
||
|
||
|
||
int COCOA_Gui_ExecDialog(GWEN_GUI *gui, GWEN_DIALOG *dlg, uint32_t guiid) {
|
||
|
||
}
|
||
|
||
|
||
|
||
int COCOA_Gui_OpenDialog(GWEN_GUI *gui, GWEN_DIALOG *dlg, uint32_t guiid) {
|
||
return 0;
|
||
}
|
||
|
||
|
||
|
||
int COCOA_Gui_CloseDialog(GWEN_GUI *gui, GWEN_DIALOG *dlg) {
|
||
return 0;
|
||
}
|
||
|
||
|
||
|
||
int COCOA_Gui_RunDialog(GWEN_GUI *gui, GWEN_DIALOG *dlg, int untilEnd) {
|
||
return 0;
|
||
}
|
||
|
||
|
||
|
||
int COCOA_Gui_GetFileName(GWEN_GUI *gui,
|
||
const char *caption,
|
||
GWEN_GUI_FILENAME_TYPE fnt,
|
||
uint32_t flags,
|
||
const char *patterns,
|
||
GWEN_BUFFER *pathBuffer,
|
||
uint32_t guiid) {
|
||
|
||
}
|
||
|
||
|
||
|
gui/cocoa/cocoa_gui_p.h | ||
---|---|---|
/***************************************************************************
|
||
begin : August 03 2010
|
||
copyright : (C) 2010 by Samuel Strupp
|
||
|
||
***************************************************************************
|
||
* Please see toplevel file COPYING for license details *
|
||
***************************************************************************/
|
||
|
||
|
||
|
||
#ifndef COCOA_GUI_P_H
|
||
#define COCOA_GUI_P_H
|
||
|
||
#include "cocoa_gui.h"
|
||
|
||
|
||
typedef struct COCOA_GUI COCOA_GUI;
|
||
struct COCOA_GUI {
|
||
|
||
GWEN_GUI_EXEC_DIALOG_FN execDialogFn;
|
||
|
||
GWEN_GUI_OPEN_DIALOG_FN openDialogFn;
|
||
GWEN_GUI_CLOSE_DIALOG_FN closeDialogFn;
|
||
GWEN_GUI_RUN_DIALOG_FN runDialogFn;
|
||
GWEN_GUI_GET_FILENAME_FN getFileNameDialogFn;
|
||
};
|
||
|
||
|
||
|
||
|
||
static GWENHYWFAR_CB
|
||
void Cocoa_Gui_FreeData(void *bp, void *p);
|
||
|
||
static GWENHYWFAR_CB
|
||
int COCOA_Gui_ExecDialog(GWEN_GUI *gui, GWEN_DIALOG *dlg, uint32_t guiid);
|
||
|
||
static GWENHYWFAR_CB
|
||
int COCOA_Gui_OpenDialog(GWEN_GUI *gui, GWEN_DIALOG *dlg, uint32_t guiid);
|
||
|
||
static GWENHYWFAR_CB
|
||
int COCOA_Gui_CloseDialog(GWEN_GUI *gui, GWEN_DIALOG *dlg);
|
||
|
||
static GWENHYWFAR_CB
|
||
int COCOA_Gui_RunDialog(GWEN_GUI *gui, GWEN_DIALOG *dlg, int timeout);
|
||
|
||
static GWENHYWFAR_CB
|
||
int COCOA_Gui_GetFileName(GWEN_GUI *gui,
|
||
const char *caption,
|
||
GWEN_GUI_FILENAME_TYPE fnt,
|
||
uint32_t flags,
|
||
const char *patterns,
|
||
GWEN_BUFFER *pathBuffer,
|
||
uint32_t guiid);
|
||
|
||
|
||
#endif
|
gui/cocoa/libtest.c | ||
---|---|---|
/***************************************************************************
|
||
begin : August 03 2010
|
||
copyright : (C) 2010 by Samuel Strupp
|
||
|
||
***************************************************************************
|
||
* Please see toplevel file COPYING for license details *
|
||
***************************************************************************/
|
||
|
||
|
||
#include "cocoa_gui.h"
|
||
//#include "../testdialogs/dlg_test.h"
|
||
|
||
#include <gwenhywfar/gwenhywfar.h>
|
||
#include <gwenhywfar/gui.h>
|
||
#include <gwenhywfar/dialog.h>
|
||
#include <gwenhywfar/debug.h>
|
||
|
||
|
||
#include <unistd.h>
|
||
|
||
|
||
int test1(int argc, char **argv) {
|
||
fprintf(stderr, "Test\n");
|
||
|
||
/* GWEN_GUI *gui;
|
||
int rv;
|
||
GWEN_DIALOG *dlg;
|
||
|
||
rv=GWEN_Init();
|
||
if (rv) {
|
||
DBG_ERROR_ERR(0, rv);
|
||
return 2;
|
||
}
|
||
|
||
GWEN_Logger_SetLevel(0, GWEN_LoggerLevel_Info);
|
||
|
||
gtk_set_locale ();
|
||
gtk_init (&argc, &argv);
|
||
|
||
// create GUI
|
||
gui=Gtk2_Gui_new();
|
||
GWEN_Gui_SetGui(gui);
|
||
|
||
dlg=Dlg_Test1_new();
|
||
if (dlg==NULL) {
|
||
fprintf(stderr, "Could not create dialog.\n");
|
||
return 2;
|
||
}
|
||
|
||
rv=GWEN_Gui_ExecDialog(dlg, 0);
|
||
fprintf(stderr, "Result: %d\n", rv);*/
|
||
|
||
return 0;
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
/*int test2(int argc, char **argv) {
|
||
int rv;
|
||
uint32_t id1;
|
||
uint32_t id2;
|
||
uint64_t i1;
|
||
uint64_t i2;
|
||
GWEN_GUI *gui;
|
||
|
||
gtk_set_locale ();
|
||
gtk_init (&argc, &argv);
|
||
|
||
gui=Gtk2_Gui_new();
|
||
GWEN_Gui_SetGui(gui);
|
||
|
||
id1=GWEN_Gui_ProgressStart(GWEN_GUI_PROGRESS_SHOW_LOG |
|
||
GWEN_GUI_PROGRESS_SHOW_ABORT |
|
||
GWEN_GUI_PROGRESS_KEEP_OPEN,
|
||
"Progress-Title",
|
||
"<html>"
|
||
"<p><b>This</b> is an example <i>text</i>..</p>"
|
||
"<p>As you can see <font color=red>colors</font> can "
|
||
"be used.</p>"
|
||
"</html>",
|
||
10,
|
||
0);
|
||
for (i1=1; i1<=10; i1++) {
|
||
char numbuf[128];
|
||
|
||
snprintf(numbuf, sizeof(numbuf)-1, "Step %d\n", (int)i1);
|
||
GWEN_Gui_ProgressLog(id1, GWEN_LoggerLevel_Notice, numbuf);
|
||
id2=GWEN_Gui_ProgressStart(GWEN_GUI_PROGRESS_SHOW_LOG |
|
||
GWEN_GUI_PROGRESS_DELAY |
|
||
GWEN_GUI_PROGRESS_SHOW_ABORT,
|
||
"2nd progress",
|
||
"Starting 2nd progress...",
|
||
10,
|
||
id1);
|
||
for (i2=1; i2<=10; i2++) {
|
||
sleep(1);
|
||
fprintf(stderr, "Advancing %d/%d\n", (int)i1, (int)i2);
|
||
rv=GWEN_Gui_ProgressAdvance(id2, i2);
|
||
if (rv==GWEN_ERROR_USER_ABORTED) {
|
||
fprintf(stderr, "Aborted by user (2)\n");
|
||
break;
|
||
}
|
||
}
|
||
GWEN_Gui_ProgressEnd(id2);
|
||
|
||
rv=GWEN_Gui_ProgressAdvance(id1, i1);
|
||
if (rv==GWEN_ERROR_USER_ABORTED) {
|
||
fprintf(stderr, "Aborted by user (1)\n");
|
||
break;
|
||
}
|
||
}
|
||
|
||
GWEN_Gui_ProgressEnd(id1);
|
||
|
||
return 0;
|
||
}*/
|
||
|
||
|
||
|
||
|
||
|
||
int main(int argc, char **argv) {
|
||
return test1(argc, argv);
|
||
//return test2(argc, argv);
|
||
#if 0
|
||
GWEN_GUI *gui;
|
||
|
||
gtk_set_locale ();
|
||
gtk_init (&argc, &argv);
|
||
|
||
gui=Gtk2_Gui_new();
|
||
GWEN_Gui_SetGui(gui);
|
||
|
||
return 0;
|
||
#endif
|
||
}
|
||
|
||
|
gui/cocoa/libtest.m | ||
---|---|---|
/***************************************************************************
|
||
begin : August 03 2010
|
||
copyright : (C) 2010 by Samuel Strupp
|
||
|
||
***************************************************************************
|
||
* Please see toplevel file COPYING for license details *
|
||
***************************************************************************/
|
||
|
||
|
||
#include "cocoa_gui.h"
|
||
//#include "../testdialogs/dlg_test.h"
|
||
|
||
#include <gwenhywfar/gwenhywfar.h>
|
||
#include <gwenhywfar/gui.h>
|
||
#include <gwenhywfar/dialog.h>
|
||
#include <gwenhywfar/debug.h>
|
||
|
||
|
||
#include <unistd.h>
|
||
|
||
#import <Foundation/Foundation.h>
|
||
|
||
|
||
int test1(int argc, char **argv) {
|
||
fprintf(stderr, "Test\n");
|
||
|
||
/* GWEN_GUI *gui;
|
||
int rv;
|
||
GWEN_DIALOG *dlg;
|
||
|
||
rv=GWEN_Init();
|
||
if (rv) {
|
||
DBG_ERROR_ERR(0, rv);
|
||
return 2;
|
||
}
|
||
|
||
GWEN_Logger_SetLevel(0, GWEN_LoggerLevel_Info);
|
||
|
||
gtk_set_locale ();
|
||
gtk_init (&argc, &argv);
|
||
|
||
// create GUI
|
||
gui=Gtk2_Gui_new();
|
||
GWEN_Gui_SetGui(gui);
|
||
|
||
dlg=Dlg_Test1_new();
|
||
if (dlg==NULL) {
|
||
fprintf(stderr, "Could not create dialog.\n");
|
||
return 2;
|
||
}
|
||
|
||
rv=GWEN_Gui_ExecDialog(dlg, 0);
|
||
fprintf(stderr, "Result: %d\n", rv);*/
|
||
|
||
return 0;
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
/*int test2(int argc, char **argv) {
|
||
int rv;
|
||
uint32_t id1;
|
||
uint32_t id2;
|
||
uint64_t i1;
|
||
uint64_t i2;
|
||
GWEN_GUI *gui;
|
||
|
||
gtk_set_locale ();
|
||
gtk_init (&argc, &argv);
|
||
|
||
gui=Gtk2_Gui_new();
|
||
GWEN_Gui_SetGui(gui);
|
||
|
||
id1=GWEN_Gui_ProgressStart(GWEN_GUI_PROGRESS_SHOW_LOG |
|
||
GWEN_GUI_PROGRESS_SHOW_ABORT |
|
||
GWEN_GUI_PROGRESS_KEEP_OPEN,
|
||
"Progress-Title",
|
||
"<html>"
|
||
"<p><b>This</b> is an example <i>text</i>..</p>"
|
||
"<p>As you can see <font color=red>colors</font> can "
|
||
"be used.</p>"
|
||
"</html>",
|
||
10,
|
||
0);
|
||
for (i1=1; i1<=10; i1++) {
|
||
char numbuf[128];
|
||
|
||
snprintf(numbuf, sizeof(numbuf)-1, "Step %d\n", (int)i1);
|
||
GWEN_Gui_ProgressLog(id1, GWEN_LoggerLevel_Notice, numbuf);
|
||
id2=GWEN_Gui_ProgressStart(GWEN_GUI_PROGRESS_SHOW_LOG |
|
||
GWEN_GUI_PROGRESS_DELAY |
|
||
GWEN_GUI_PROGRESS_SHOW_ABORT,
|
||
"2nd progress",
|
||
"Starting 2nd progress...",
|
||
10,
|
||
id1);
|
||
for (i2=1; i2<=10; i2++) {
|
||
sleep(1);
|
||
fprintf(stderr, "Advancing %d/%d\n", (int)i1, (int)i2);
|
||
rv=GWEN_Gui_ProgressAdvance(id2, i2);
|
||
if (rv==GWEN_ERROR_USER_ABORTED) {
|
||
fprintf(stderr, "Aborted by user (2)\n");
|
||
break;
|
||
}
|
||
}
|
||
GWEN_Gui_ProgressEnd(id2);
|
||
|
||
rv=GWEN_Gui_ProgressAdvance(id1, i1);
|
||
if (rv==GWEN_ERROR_USER_ABORTED) {
|
||
fprintf(stderr, "Aborted by user (1)\n");
|
||
break;
|
||
}
|
||
}
|
||
|
||
GWEN_Gui_ProgressEnd(id1);
|
||
|
||
return 0;
|
||
}*/
|
||
|
||
|
||
|
||
int test3(int argc, char **argv) {
|
||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||
|
||
NSLog(@"Cocoa-Test");
|
||
NSString *cocoa_string = @"Das ist ein Cocoa String";
|
||
|
||
[pool release];
|
||
return 0;
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
int main(int argc, char **argv) {
|
||
//return test1(argc, argv);
|
||
//return test2(argc, argv);
|
||
return test3(argc, argv);
|
||
#if 0
|
||
GWEN_GUI *gui;
|
||
|
||
gtk_set_locale ();
|
||
gtk_init (&argc, &argv);
|
||
|
||
gui=Gtk2_Gui_new();
|
||
GWEN_Gui_SetGui(gui);
|
||
|
||
return 0;
|
||
#endif
|
||
}
|
||
|
||
|
Auch abrufbar als: Unified diff
Started with the Cocoa implementation of the GWEN_DIALOG framework.
git-svn-id: https://devel.aqbanking.de/svn/gwenhywfar/trunk@1922 70169cfe-8b10-0410-8925-dcb4b91034d8