gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash/gui aqua.cpp aqua_ogl_glue.cpp


From: Markus Gothe
Subject: [Gnash-commit] gnash/gui aqua.cpp aqua_ogl_glue.cpp
Date: Sun, 22 Jul 2007 23:28:06 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Markus Gothe <nihilus>  07/07/22 23:28:06

Modified files:
        gui            : aqua.cpp aqua_ogl_glue.cpp 

Log message:
        Tweaks

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/aqua.cpp?cvsroot=gnash&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/aqua_ogl_glue.cpp?cvsroot=gnash&r1=1.9&r2=1.10

Patches:
Index: aqua.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/aqua.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- aqua.cpp    1 Jul 2007 10:54:00 -0000       1.10
+++ aqua.cpp    22 Jul 2007 23:28:05 -0000      1.11
@@ -18,7 +18,7 @@
 // 
 //
 
-/* $Id: aqua.cpp,v 1.10 2007/07/01 10:54:00 bjacques Exp $ */
+/* $Id: aqua.cpp,v 1.11 2007/07/22 23:28:05 nihilus Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -42,6 +42,31 @@
 
 #include <Carbon/Carbon.h>
 
+struct GlobalAppInfo  
+{
+  CFBundleRef          mainBundle;
+  IBNibRef                     mainNib;
+  WindowGroupRef       windowGroups[3];
+};
+typedef struct GlobalAppInfo GlobalAppInfo;
+
+GlobalAppInfo  g;
+
+static pascal OSStatus AppEventHandlerProc(EventHandlerCallRef inCallRef, 
EventRef inEvent, void* inUserData)
+{
+  #pragma unused (inCallRef)
+  HICommand                    command;
+  WindowGroupRef               windowGroup;
+  WindowGroupAttributes windowGroupAttributes;
+  UInt32       eventKind       = GetEventKind(inEvent);
+  UInt32       eventClass      = GetEventClass(inEvent);
+  WindowRef    window          = (WindowRef) inUserData;
+  OSStatus     err             = eventNotHandledErr;
+ 
+  return err;  
+}
+static pascal OSStatus SimpleWindowEventHandlerProc(EventHandlerCallRef 
inCallRef, EventRef inEvent, void* inUserData);
+
 namespace gnash {
        
 AquaGui::AquaGui()
@@ -68,19 +93,58 @@
 bool AquaGui::run()
 {
     GNASH_REPORT_FUNCTION;
-    return false;
+    
+    RunApplicationEventLoop();
+    return true;
 }
 
 void AquaGui::renderBuffer()
 {
-    //GNASH_REPORT_FUNCTION;
-
-    _glue.render();
+    GNASH_REPORT_FUNCTION;
 }
 
 bool AquaGui::init(int /*argc*/, char *** /*argv*/) /* Self-explainatory */
 {
-       return true;
+  OSErr                                                err;
+  static const EventTypeSpec   sApplicationEvents[] =  {  {kEventClassCommand, 
kEventCommandProcess}  };
+
+  BlockZero(&g, sizeof(g));
+    
+  g.mainBundle = CFBundleGetMainBundle();
+  if (g.mainBundle == NULL) 
+  {
+        err = -1;  
+        goto Bail;
+  }
+  
+  err  = CreateNibReferenceWithCFBundle(g.mainBundle, CFSTR("aqua"), 
&g.mainNib);
+  if (err != noErr)goto Bail;
+  if (g.mainNib == NULL)
+  {
+       err = -1;
+       goto Bail;
+  }
+
+  err = SetMenuBarFromNib(g.mainNib, CFSTR("MenuBar"));
+  if (err != noErr)goto Bail;
+
+  InstallApplicationEventHandler(NewEventHandlerUPP(AppEventHandlerProc), 
GetEventTypeCount(sApplicationEvents), sApplicationEvents, 0, NULL);
+
+  //  Force the document group to be created first, so we can position our 
groups between the floating and document groups
+  (void) GetWindowGroupOfClass(kDocumentWindowClass);
+  
+  //  Create our default WindowGroups and set their z-order
+  err = CreateWindowGroup(0, &g.windowGroups[0]);
+  err = CreateWindowGroup(0, &g.windowGroups[1]);
+  err = CreateWindowGroup(0, &g.windowGroups[2]);
+
+  //  Position our groups behind the floating group and in front of the 
document group
+  SendWindowGroupBehind(g.windowGroups[2], 
GetWindowGroupOfClass(kDocumentWindowClass));
+  SendWindowGroupBehind(g.windowGroups[1], g.windowGroups[2]);
+  SendWindowGroupBehind(g.windowGroups[0], g.windowGroups[1]);
+
+Bail:  
+  return err;  
 }
 
 void AquaGui::setTimeout(unsigned int timeout)
@@ -92,9 +156,10 @@
 {
 }
 
-bool AquaGui::createWindow(const char* /*title*/, int /*width*/, int 
/*height*/)
+bool AquaGui::createWindow(const char* title, int width, int height)
 {
-       return true;
+
+    return false;
 }
 
 bool AquaGui::createMenu()

Index: aqua_ogl_glue.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/aqua_ogl_glue.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- aqua_ogl_glue.cpp   1 Jul 2007 10:54:00 -0000       1.9
+++ aqua_ogl_glue.cpp   22 Jul 2007 23:28:05 -0000      1.10
@@ -18,7 +18,7 @@
 // 
 //
 
-/* $Id: aqua_ogl_glue.cpp,v 1.9 2007/07/01 10:54:00 bjacques Exp $ */
+/* $Id: aqua_ogl_glue.cpp,v 1.10 2007/07/22 23:28:05 nihilus Exp $ */
 
 
 #include "aqua_ogl_glue.h"
@@ -116,8 +116,9 @@
 void
 AquaOglGlue::render()
 {
-//    GNASH_REPORT_FUNCTION;
+    GNASH_REPORT_FUNCTION;
     //SDL_GL_SwapBuffers();
+    glFlush();
 }
 
 } // namespace gnash
\ No newline at end of file




reply via email to

[Prev in Thread] Current Thread [Next in Thread]