Editing Documentation/Maemo 5 Developer Guide/Porting Software/Scaling Fixed Size Windows

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 61: Line 61:
static gint Y_POS = 56;
static gint Y_POS = 56;
-
/* Using 800x424 as fullscreen */
+
static gint X_FULL = 800;
-
static gdouble X_SCALE = 2.5;  /* width / X_SIZE */
+
static gint Y_FULL = 424;
-
static gdouble Y_SCALE = 1.77; /* height / Y_SIZE */
+
 
 +
static gdouble X_SCALE = 2.5;  /* X_FULL / X_SIZE */
 +
static gdouble Y_SCALE = 1.77; /* Y_FULL / Y_SIZE */
Line 101: Line 103:
{
{
   GtkWidget *drawing = gtk_drawing_area_new ();
   GtkWidget *drawing = gtk_drawing_area_new ();
 +
  GtkRequisition *req;
   g_signal_connect (drawing, "realize",
   g_signal_connect (drawing, "realize",
    G_CALLBACK (drawing_realize), NULL);
    G_CALLBACK (drawing_realize), NULL);
Line 119: Line 122:
   gdk_event_put ((GdkEvent *) newev);
   gdk_event_put ((GdkEvent *) newev);
}
}
 +
 +
static void
 +
button_clicked (GtkWidget *widget, HildonAnimationActor *actor)
 +
{
 +
  static gboolean fullscreen = FALSE;
 +
 +
  if (fullscreen) {
 +
    hildon_animation_actor_set_scale (actor, 1.0, 1.0);
 +
    fullscreen = FALSE;
 +
  }
 +
  else {
 +
    hildon_animation_actor_set_scale (actor, X_SCALE, Y_SCALE);
 +
    fullscreen = TRUE;
 +
  }
 +
}
 +
int
int
Line 126: Line 145:
   HildonAnimationActor *actor;
   HildonAnimationActor *actor;
   GtkWidget *window, *drawing;
   GtkWidget *window, *drawing;
 +
  HildonProgram *program;
   GdkColor pink = { .red = 0xffff, .green = 0x9999, .blue = 0x9999 };
   GdkColor pink = { .red = 0xffff, .green = 0x9999, .blue = 0x9999 };

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)