moved autocommproc, autoflagproc and autoflipproc to gtk
[xboard.git] / interface.c
index 056a44e..b5381c9 100644 (file)
 
 
 
-GdkPixbuf *load_pixbuf(char *filename)
+GdkPixbuf *load_pixbuf(char *filename,int size)
 {
   GdkPixbuf *image;
 
-  image = gdk_pixbuf_new_from_file(filename,NULL);
-
+  if(size)
+    image = gdk_pixbuf_new_from_file_at_size(filename,size,size,NULL);
+  else
+    image = gdk_pixbuf_new_from_file(filename,NULL);
+  
   if(image == NULL)
     {
       fprintf(stderr,_("Error: couldn't load file: %s\n"),filename);
@@ -47,31 +50,19 @@ GdkPixbuf *load_pixbuf(char *filename)
   return image;
 }
 
-void GUI_DisplayTitle(text)
-     char *text;
+void GUI_SetAspectRatio(ratio)
+     int ratio;
 {
-    char title[MSG_SIZ];
+  /* sets the aspect ration of the main window */
+    GdkGeometry hints;
     extern GtkWidget *GUI_Window;
 
-    if (text == NULL) text = "";
-
-    /* todo
-    if (appData.titleInWindow) {
-       i = 0;
-       XtSetArg(args[i], XtNlabel, text);   i++;
-       XtSetValues(titleWidget, args, i);
-       } */
-
-    if (*text != NULLCHAR) {
-       strcpy(title, text);
-    } else if (appData.icsActive) {
-       sprintf(title, "%s: %s", programName, appData.icsHost);
-    } else if (appData.cmailGameName[0] != NULLCHAR) {
-       sprintf(title, "%s: %s", programName, "CMail");
-    } else if (appData.noChessProgram) {
-       strcpy(title, programName);
-    } else {
-       sprintf(title, "%s: %s", programName, first.tidy);
-    }
-    gtk_window_set_title(GTK_WINDOW(GUI_Window),title);
+    hints.min_aspect = ratio;
+    hints.max_aspect = ratio;
+    
+    gtk_window_set_geometry_hints (GTK_WINDOW (GUI_Window),
+                                  GTK_WIDGET (GUI_Window),
+                                  &hints,
+                                  GDK_HINT_ASPECT);
+    return;
 }