gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/trunk r11659: Adapted the OS4 Gui to the r


From: Andrea Palmatè
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r11659: Adapted the OS4 Gui to the recent changes.
Date: Sat, 28 Nov 2009 11:50:24 +0100
User-agent: Bazaar (1.16.1)

------------------------------------------------------------
revno: 11659
committer: Andrea Palmatè <address@hidden>
branch nick: gnash
timestamp: Sat 2009-11-28 11:50:24 +0100
message:
  Adapted the OS4 Gui to the recent changes.
modified:
  gui/aos4.cpp
  gui/aos4_agg_glue.cpp
  gui/aos4_agg_glue.h
  gui/aos4_gnash_prefs.cpp
  gui/aos4sup.h
  libcore/asobj/flash/media/Microphone_as.cpp
=== modified file 'gui/aos4.cpp'
--- a/gui/aos4.cpp      2009-11-28 10:38:19 +0000
+++ b/gui/aos4.cpp      2009-11-28 10:50:24 +0000
@@ -615,14 +615,16 @@
 
 
 bool
-AOS4Gui::createWindow(const char *title, int width, int height)
+AOS4Gui::createWindow(const char *title, int width, int height, int xPosition, 
int yPosition)
 {
     _width = width;
     _height = height;
-
-    _glue.saveOrigiginalDimension(width,height);
+       
+    _glue.saveOrigiginalDimension(width,height,xPosition,yPosition);
        _orig_width  = width;
        _orig_height = height;
+       _orig_xPosition = xPosition;
+       _orig_yPosition = yPosition;
 
     _glue.prepDrawingArea(_width, _height);
 
@@ -636,7 +638,7 @@
        strcpy(_window_title,title);
 
        IIntuition->SetWindowTitles(_window,title,title);
-
+       IIntuition->ChangeWindowBox(_window,xPosition,yPosition,width,height);
     return true;
 }
 

=== modified file 'gui/aos4_agg_glue.cpp'
--- a/gui/aos4_agg_glue.cpp     2009-11-28 10:38:19 +0000
+++ b/gui/aos4_agg_glue.cpp     2009-11-28 10:50:24 +0000
@@ -31,28 +31,28 @@
 {
        /* Type, Label, CommKey, Flags, MutualExclude, UserData */
 
-       { NM_TITLE, "File",                     NULL,   0, 0L, NULL },          
/* Menu 0 */
-               { NM_ITEM,  "Load File..",          "L",        0, 0L, NULL },  
        /* Item 0 */
-               { NM_ITEM,  "Save",                 "S",        
NM_ITEMDISABLED, 0L, NULL },          /* Item 1 */
-               { NM_ITEM,  "Save As..",            "A",        
NM_ITEMDISABLED, 0L, NULL },          /* Item 2 */
+       { NM_TITLE, (CONST_STRPTR)"File",                       NULL,   0, 0L, 
NULL },          /* Menu 0 */
+               { NM_ITEM,  (CONST_STRPTR)"Load File..",          
(CONST_STRPTR)"L",    0, 0L, NULL },          /* Item 0 */
+               { NM_ITEM,  (CONST_STRPTR)"Save",                 
(CONST_STRPTR)"S",    NM_ITEMDISABLED, 0L, NULL },          /* Item 1 */
+               { NM_ITEM,  (CONST_STRPTR)"Save As..",            
(CONST_STRPTR)"A",    NM_ITEMDISABLED, 0L, NULL },          /* Item 2 */
                { NM_ITEM,  NM_BARLABEL,              NULL,     0, 0L, NULL },  
                /* Item 3 */
-               { NM_ITEM,  "Properties",           "E",        0, 0L, NULL },  
                /* Item 4 */
+               { NM_ITEM,  (CONST_STRPTR)"Properties",           
(CONST_STRPTR)"E",    0, 0L, NULL },                  /* Item 4 */
                { NM_ITEM,  NM_BARLABEL,              NULL,     0, 0L, NULL },  
                /* Item 5 */
-               { NM_ITEM,  "Exit",                 "Q",        0, 0L, NULL },  
        /* Item 6 */
-       { NM_TITLE, "Edit",                     NULL,   0, 0L, NULL },          
/* Menu 1 */
-               { NM_ITEM,  "Preferences",                      "O",    0, 0L, 
NULL },          /* Item 0 */
-       { NM_TITLE, "View",                         NULL,       0, 0L, NULL },  
        /* Menu 2 */
-               { NM_ITEM,  "Redraw",                           "D",    0 , 0L, 
NULL },                 /* Item 0 */
-               { NM_ITEM,  "Toggle fullscreen",        "F",    0 , 0L, NULL }, 
        /* Item 1 */
-               { NM_ITEM,  "Show updated ranges",      "U",    
MENUTOGGLE|CHECKIT , 0L, NULL },                /* Item 2 */
-       { NM_TITLE, "Movie Control",                    NULL,   0, 0L, NULL },  
        /* Menu 3 */
-               { NM_ITEM,  "Play",                                     "Y",    
0 , 0, NULL },                  /* Item 0 */
-               { NM_ITEM,  "Pause",                            "P",    0 , 0, 
NULL },                  /* Item 1 */
-        { NM_ITEM,  "Stop",                                    "T",    0 , 0, 
NULL },                  /* Item 2 */
+               { NM_ITEM,  (CONST_STRPTR)"Exit",                 
(CONST_STRPTR)"Q",    0, 0L, NULL },          /* Item 6 */
+       { NM_TITLE, (CONST_STRPTR)"Edit",                       NULL,   0, 0L, 
NULL },          /* Menu 1 */
+               { NM_ITEM,  (CONST_STRPTR)"Preferences",                        
(CONST_STRPTR)"O",      0, 0L, NULL },          /* Item 0 */
+       { NM_TITLE, (CONST_STRPTR)"View",                           NULL,       
0, 0L, NULL },          /* Menu 2 */
+               { NM_ITEM,  (CONST_STRPTR)"Redraw",                             
(CONST_STRPTR)"D",      0 , 0L, NULL },                 /* Item 0 */
+               { NM_ITEM,  (CONST_STRPTR)"Toggle fullscreen",  
(CONST_STRPTR)"F",      0 , 0L, NULL },         /* Item 1 */
+               { NM_ITEM,  (CONST_STRPTR)"Show updated ranges",        
(CONST_STRPTR)"U",      MENUTOGGLE|CHECKIT , 0L, NULL },                /* Item 
2 */
+       { NM_TITLE, (CONST_STRPTR)"Movie Control",                      NULL,   
0, 0L, NULL },          /* Menu 3 */
+               { NM_ITEM,  (CONST_STRPTR)"Play",                               
        (CONST_STRPTR)"Y",      0 , 0, NULL },                  /* Item 0 */
+               { NM_ITEM,  (CONST_STRPTR)"Pause",                              
(CONST_STRPTR)"P",      0 , 0, NULL },                  /* Item 1 */
+        { NM_ITEM,  (CONST_STRPTR)"Stop",                                      
(CONST_STRPTR)"T",      0 , 0, NULL },                  /* Item 2 */
         { NM_ITEM,  NM_BARLABEL,              NULL,    0, 0L, NULL },          
        /* Item 3 */
-        { NM_ITEM,  "Restart",                         "R",    0 , 0, NULL },  
                /* Item 4 */
-      { NM_TITLE, "Help",                                      NULL,   0, 0L, 
NULL },          /* Menu 4 */
-          { NM_ITEM,  "About",                         "?",    0 , 0, NULL },  
        /* Item 0 */
+        { NM_ITEM,  (CONST_STRPTR)"Restart",                           
(CONST_STRPTR)"R",      0 , 0, NULL },                  /* Item 4 */
+      { NM_TITLE, (CONST_STRPTR)"Help",                                        
NULL,   0, 0L, NULL },          /* Menu 4 */
+          { NM_ITEM,  (CONST_STRPTR)"About",                           
(CONST_STRPTR)"?",      0 , 0, NULL },          /* Item 0 */
       { NM_END,   NULL,                     NULL,      0, 0L, NULL }           
/* Terminator */
     };
 /* END OF MENU DEFINITION */
@@ -135,7 +135,7 @@
 AOS4AggGlue::setFullscreen()
 {
 
-       saveOrigiginalDimension(_width,_height);
+       saveOrigiginalDimension(_width,_height,_xPosition,_yPosition);
 
        _screen = IIntuition->LockPubScreen("Workbench");
        int new_width   = _screen->Width;
@@ -152,10 +152,12 @@
 }
 
 void 
-AOS4AggGlue::saveOrigiginalDimension(int width, int height)
+AOS4AggGlue::saveOrigiginalDimension(int width, int height, int xPosition, int 
yPosition)
 {
-       _orig_width  = width;
-       _orig_height = height;
+       _orig_width     = width;
+       _orig_height    = height;
+       _orig_xPosition = xPosition;
+       _orig_yPosition = yPosition;
 }
 
 void
@@ -169,6 +171,8 @@
 
        _width  = _orig_width;
        _height = _orig_height;
+       _xPosition = _orig_xPosition;
+       _yPosition = _orig_yPosition;
 
     resize(_width, _height);
 }
@@ -190,8 +194,16 @@
        {
            if ( ( _menu_screen = IIntuition->LockPubScreen ( "Workbench") ) )
            {
-                   left=(_menu_screen->Width-_width)/2;
-                   top=(_menu_screen->Height-_height)/2;
+                   if ((_xPosition == 0) && (_yPosition==0))
+                   {
+                       left = (_menu_screen->Width-_width)/2;
+                           top  = (_menu_screen->Height-_height)/2;
+                       }
+                       else
+                       {
+                               left = _xPosition;
+                               top  = _yPosition;
+                       }
 
                vi = IGadTools->GetVisualInfoA(_menu_screen,NULL);
                if (vi)

=== modified file 'gui/aos4_agg_glue.h'
--- a/gui/aos4_agg_glue.h       2009-11-28 10:38:19 +0000
+++ b/gui/aos4_agg_glue.h       2009-11-28 10:50:24 +0000
@@ -52,7 +52,7 @@
                void                     setFullscreen();
                void                     unsetFullscreen();
                void                     resize(int width, int height);
-               void                     saveOrigiginalDimension(int width, int 
height);
+               void                     saveOrigiginalDimension(int width, int 
height, int xPosition, int yPosition);
         private:
        geometry::Range2d<int> _validbounds;
            std::vector< geometry::Range2d<int> > _drawbounds;
@@ -65,6 +65,10 @@
        int                              _orig_width;
            int                                  _height;
            int                                  _orig_height;
+           int                                  _xPosition;
+           int                                  _orig_xPosition;
+           int                                  _yPosition;
+           int                                  _orig_yPosition;
        int                                      _stride;
                int                                      _btype;
                struct Menu             *_menu;

=== modified file 'gui/aos4_gnash_prefs.cpp'
--- a/gui/aos4_gnash_prefs.cpp  2009-11-28 10:38:19 +0000
+++ b/gui/aos4_gnash_prefs.cpp  2009-11-28 10:50:24 +0000
@@ -19,11 +19,6 @@
 
 #include <string.h>
 
-VOID prefshookfunc( struct Hook *me, APTR winobj, struct UIPrefs *p )
-{
-       IExec->DebugPrintF("new prefs hook called\n");
-}
-
 Object *Objects[OBJ_NUM];
 #define OBJ(x) Objects[x]
 #define GAD(x) (struct Gadget *)Objects[x]
@@ -32,7 +27,6 @@
 
 #define SPACE LAYOUT_AddChild, SpaceObject, End
 
-struct Hook newprefshook;
 Object *win;
 
 struct MsgPort *AppPort;
@@ -42,10 +36,6 @@
 {
        char verb_level[3];
 
-       /* create hook */
-       newprefshook.h_Entry = (HOOKFUNC)prefshookfunc;
-       newprefshook.h_SubEntry = NULL;
-       newprefshook.h_Data = NULL;
 /*
        printf("1)%s - 
%d\n",preferences->logfilename,strlen(preferences->logfilename));
        printf("2)%s - 
%d\n",preferences->sharedobjdir,strlen(preferences->sharedobjdir));
@@ -377,7 +367,6 @@
         WINDOW_IconifyGadget,  TRUE,
         WINDOW_IconTitle,      "Gnash",
         WINDOW_AppPort,        AppPort,
-        WINDOW_NewPrefsHook,   &newprefshook,
         WINDOW_Position,       WPOS_CENTERSCREEN,
         WINDOW_Layout,         VLayoutObject,
             LAYOUT_AddChild,       OBJ(OBJ_CLICKTAB_MAIN),

=== modified file 'gui/aos4sup.h'
--- a/gui/aos4sup.h     2009-11-28 10:38:19 +0000
+++ b/gui/aos4sup.h     2009-11-28 10:50:24 +0000
@@ -72,7 +72,7 @@
     AOS4Gui(unsigned long xid, float scale, bool loop, RunResources& r);
     virtual ~AOS4Gui();
     virtual bool init(int argc, char **argv[]);
-    virtual bool createWindow(const char *title, int width, int height);
+    virtual bool createWindow(const char *title, int width, int height, int 
xPosition = 0, int yPosition = 0);
     virtual bool run();
     virtual bool createMenu();
     virtual bool setupEvents();
@@ -111,6 +111,8 @@
 
        int      _orig_width;
     int         _orig_height;
+       int      _orig_xPosition;
+    int         _orig_yPosition;
 
 #ifdef RENDERER_AGG
     AOS4AggGlue      _glue;

=== modified file 'libcore/asobj/flash/media/Microphone_as.cpp'
--- a/libcore/asobj/flash/media/Microphone_as.cpp       2009-11-28 10:38:19 
+0000
+++ b/libcore/asobj/flash/media/Microphone_as.cpp       2009-11-28 10:50:24 
+0000
@@ -296,7 +296,7 @@
         return as_value();
     } 
 
-    const int32_t gain = clamp(fn.arg(0).to_int(), 0, 100);
+    const int32_t gain = clamp(fn.arg(0).to_int(), (boost::int32_t)0, 
(boost::int32_t)100);
     ptr->setGain(gain);
     return as_value();
 }
@@ -453,7 +453,7 @@
     
     if (numargs > 1) {
         // If it's less than 0, it's set to 0.
-        const int timeout = std::max(fn.arg(1).to_int(), 0);
+        const int timeout = std::max(fn.arg(1).to_int(), (boost::int32_t)0);
         ptr->setSilenceTimeout(timeout);
     }
     return as_value();


reply via email to

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