Skip to content

Commit

Permalink
Restructure code
Browse files Browse the repository at this point in the history
  • Loading branch information
RadhiFadlillah committed Oct 12, 2018
1 parent 35f761c commit ff5a811
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion application/enum.go → application-enum.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package application
package qamel

// FontWeight is the weight for thickness of the font.
// Qt uses a weighting scale from 0 to 99 similar to,
Expand Down
5 changes: 3 additions & 2 deletions application/application.cpp → application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ void App_SetOrganizationDomain(void* ptr, char* domain) {
app->setOrganizationDomain(QString(domain));
}

int App_Exec() {
return QGuiApplication::exec();
int App_Exec(void* ptr) {
QGuiApplication *app = static_cast<QGuiApplication*>(ptr);
return app->exec();
}
4 changes: 2 additions & 2 deletions application/application.go → application.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package application
package qamel

// #include <stdlib.h>
// #include <stdbool.h>
Expand Down Expand Up @@ -122,7 +122,7 @@ func (app Application) SetOrganizationDomain(domain string) {
// then returns the value that was set to exit() (which is 0 if exit() is
// called via quit()).
func (app Application) Exec() int {
return int(int32(C.App_Exec()))
return int(int32(C.App_Exec(app.ptr)))
}

func sliceToChars(src []string) **C.char {
Expand Down
2 changes: 1 addition & 1 deletion application/application.h → application.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void App_SetApplicationName(void* ptr, char* name);
void App_SetApplicationVersion(void* ptr, char* version);
void App_SetOrganizationName(void* ptr, char* name);
void App_SetOrganizationDomain(void* ptr, char* domain);
int App_Exec();
int App_Exec(void* ptr);

#ifdef __cplusplus
}
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion engine/engine.go → engine.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package engine
package qamel

// #include <stdlib.h>
// #include <stdbool.h>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion viewer/enum.go → viewer-enum.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package viewer
package qamel

// ResizeMode specifies how to resize the view.
type ResizeMode int
Expand Down
2 changes: 2 additions & 0 deletions viewer/viewer.cpp → viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,5 @@ void Viewer_ClearComponentCache(void* ptr) {
void Viewer_Reload(void* ptr) {
QMetaObject::invokeMethod(static_cast<QamelView*>(ptr), "reload");
}

#include "moc.h"
2 changes: 1 addition & 1 deletion viewer/viewer.go → viewer.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package viewer
package qamel

// #include <stdlib.h>
// #include <stdbool.h>
Expand Down
File renamed without changes.

0 comments on commit ff5a811

Please sign in to comment.