"Fossies" - the Fresh Open Source Software Archive

Member "google-gadgets-for-linux-0.11.2/hosts/gtk/standalone_gtk_host.h" (15 Mar 2009, 2286 Bytes) of package /linux/misc/old/google-gadgets-for-linux-0.11.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /*
    2   Copyright 2008 Google Inc.
    3 
    4   Licensed under the Apache License, Version 2.0 (the "License");
    5   you may not use this file except in compliance with the License.
    6   You may obtain a copy of the License at
    7 
    8        http://www.apache.org/licenses/LICENSE-2.0
    9 
   10   Unless required by applicable law or agreed to in writing, software
   11   distributed under the License is distributed on an "AS IS" BASIS,
   12   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13   See the License for the specific language governing permissions and
   14   limitations under the License.
   15 */
   16 
   17 #ifndef HOSTS_GTK_STANDALONE_GTK_HOST_H__
   18 #define HOSTS_GTK_STANDALONE_GTK_HOST_H__
   19 
   20 #include <string>
   21 #include <ggadget/gadget.h>
   22 #include <ggadget/host_interface.h>
   23 #include <ggadget/options_interface.h>
   24 #include <ggadget/signals.h>
   25 
   26 #include "gtk_host_base.h"
   27 
   28 namespace ggadget {
   29   DECLARE_VARIANT_PTR_TYPE(Gadget);
   30 };
   31 
   32 namespace hosts {
   33 namespace gtk {
   34 
   35 using ggadget::Connection;
   36 using ggadget::Gadget;
   37 using ggadget::ViewHostInterface;
   38 
   39 class StandaloneGtkHost : public GtkHostBase {
   40  public:
   41   StandaloneGtkHost(int flags, int view_debug_mode,
   42                     Gadget::DebugConsoleConfig debug_console_config);
   43   virtual ~StandaloneGtkHost();
   44   virtual ViewHostInterface *NewViewHost(Gadget *gadget,
   45                                          ViewHostInterface::Type type);
   46   virtual Gadget *LoadGadget(const char *path, const char *options_name,
   47                              int instance_id, bool show_debug_console);
   48   virtual void RemoveGadget(Gadget *gadget, bool save_data);
   49   virtual void ShowGadgetDebugConsole(Gadget *gadget);
   50   virtual int GetDefaultFontSize();
   51 
   52   virtual bool IsSafeToExit() const;
   53  public:
   54   /**
   55    * Inits this standalone host with a specified gadget.
   56    *
   57    * If it's failed, then OnExit signal will be emitted, and false will be
   58    * returned.
   59    */
   60   bool Init(const std::string &gadget_path);
   61 
   62   /** Presents the main view of current gadget to user. */
   63   void Present();
   64 
   65   Connection *ConnectOnLoadGadget(
   66       ggadget::Slot4<Gadget *, const char *, const char *, int, bool> *slot);
   67 
   68  private:
   69   class Impl;
   70   Impl *impl_;
   71   DISALLOW_EVIL_CONSTRUCTORS(StandaloneGtkHost);
   72 };
   73 
   74 } // namespace gtk
   75 } // namespace hosts
   76 
   77 #endif // HOSTS_GTK_STANDALONE_GTK_HOST_H__