Author: cazfi
Date: Tue Mar  1 02:44:32 2016
New Revision: 32137

URL: http://svn.gna.org/viewcvs/freeciv?rev=32137&view=rev
Log:
Renamed gtk_set_relative_position() as set_relative_window_position() in 
gtk3-clients. Made
it to take GtkWindow parameters instead of generic GtkWidgets.

See patch #7018

Modified:
    trunk/client/gui-gtk-3.0/gui_stuff.c
    trunk/client/gui-gtk-3.0/gui_stuff.h
    trunk/client/gui-gtk-3.0/helpdlg.c
    trunk/client/gui-gtk-3.x/gui_stuff.c
    trunk/client/gui-gtk-3.x/gui_stuff.h
    trunk/client/gui-gtk-3.x/helpdlg.c

Modified: trunk/client/gui-gtk-3.0/gui_stuff.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.0/gui_stuff.c?rev=32137&r1=32136&r2=32137&view=diff
==============================================================================
--- trunk/client/gui-gtk-3.0/gui_stuff.c        (original)
+++ trunk/client/gui-gtk-3.0/gui_stuff.c        Tue Mar  1 02:44:32 2016
@@ -53,19 +53,19 @@
 }
 
 /**************************************************************************
-  Set widget position relative to reference widget
-**************************************************************************/
-void gtk_set_relative_position(GtkWidget *ref, GtkWidget *w, int px, int py)
+  Set window position relative to reference window
+**************************************************************************/
+void set_relative_window_position(GtkWindow *ref, GtkWindow *w, int px, int py)
 {
   gint x, y, width, height;
 
-  gtk_window_get_position(GTK_WINDOW(ref), &x, &y);
-  gtk_window_get_size(GTK_WINDOW(ref), &width, &height);
-
-  x += px*width/100;
-  y += py*height/100;
-
-  gtk_window_move(GTK_WINDOW(w), x, y);
+  gtk_window_get_position(ref, &x, &y);
+  gtk_window_get_size(ref, &width, &height);
+
+  x += px * width / 100;
+  y += py * height / 100;
+
+  gtk_window_move(w, x, y);
 }
 
 /**************************************************************************

Modified: trunk/client/gui-gtk-3.0/gui_stuff.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.0/gui_stuff.h?rev=32137&r1=32136&r2=32137&view=diff
==============================================================================
--- trunk/client/gui-gtk-3.0/gui_stuff.h        (original)
+++ trunk/client/gui-gtk-3.0/gui_stuff.h        Tue Mar  1 02:44:32 2016
@@ -1,4 +1,4 @@
-/********************************************************************** 
+/**********************************************************************
  Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@
 GtkWidget *gtk_stockbutton_new(const gchar *stock, const gchar *label_text);
 void gtk_stockbutton_set_label(GtkWidget *button, const gchar *label_text);
 void gtk_expose_now(GtkWidget *w);
-void gtk_set_relative_position(GtkWidget *ref, GtkWidget *w, int px, int py);
+void set_relative_window_position(GtkWindow *ref, GtkWindow *w, int px, int 
py);
 
 void intl_slist(int n, const char **s, bool *done);
 

Modified: trunk/client/gui-gtk-3.0/helpdlg.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.0/helpdlg.c?rev=32137&r1=32136&r2=32137&view=diff
==============================================================================
--- trunk/client/gui-gtk-3.0/helpdlg.c  (original)
+++ trunk/client/gui-gtk-3.0/helpdlg.c  Tue Mar  1 02:44:32 2016
@@ -1,4 +1,4 @@
-/********************************************************************** 
+/**********************************************************************
  Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -170,15 +170,15 @@
 *****************************************************************/
 void popup_help_dialog_typed(const char *item, enum help_page_type htype)
 {
-  if(!help_dialog_shell) {
+  if (!help_dialog_shell) {
     create_help_dialog();
-    gtk_set_relative_position(toplevel, help_dialog_shell, 10, 10);
+    set_relative_window_position(GTK_WINDOW(toplevel),
+                                 GTK_WINDOW(help_dialog_shell), 10, 10);
   }
   gtk_window_present(GTK_WINDOW(help_dialog_shell));
 
   select_help_item_string(item, htype);
 }
-
 
 /****************************************************************
 Not sure if this should call Q_(item) as it does, or whether all

Modified: trunk/client/gui-gtk-3.x/gui_stuff.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.x/gui_stuff.c?rev=32137&r1=32136&r2=32137&view=diff
==============================================================================
--- trunk/client/gui-gtk-3.x/gui_stuff.c        (original)
+++ trunk/client/gui-gtk-3.x/gui_stuff.c        Tue Mar  1 02:44:32 2016
@@ -55,19 +55,19 @@
 }
 
 /**************************************************************************
-  Set widget position relative to reference widget
-**************************************************************************/
-void gtk_set_relative_position(GtkWidget *ref, GtkWidget *w, int px, int py)
+  Set window position relative to reference window
+**************************************************************************/
+void set_relative_window_position(GtkWindow *ref, GtkWindow *w, int px, int py)
 {
   gint x, y, width, height;
 
-  gtk_window_get_position(GTK_WINDOW(ref), &x, &y);
-  gtk_window_get_size(GTK_WINDOW(ref), &width, &height);
-
-  x += px*width/100;
-  y += py*height/100;
-
-  gtk_window_move(GTK_WINDOW(w), x, y);
+  gtk_window_get_position(ref, &x, &y);
+  gtk_window_get_size(ref, &width, &height);
+
+  x += px * width / 100;
+  y += py * height / 100;
+
+  gtk_window_move(w, x, y);
 }
 
 /**************************************************************************

Modified: trunk/client/gui-gtk-3.x/gui_stuff.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.x/gui_stuff.h?rev=32137&r1=32136&r2=32137&view=diff
==============================================================================
--- trunk/client/gui-gtk-3.x/gui_stuff.h        (original)
+++ trunk/client/gui-gtk-3.x/gui_stuff.h        Tue Mar  1 02:44:32 2016
@@ -1,4 +1,4 @@
-/********************************************************************** 
+/**********************************************************************
  Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -22,7 +22,7 @@
                                  const gchar *label_text);
 void gtk_stockbutton_set_label(GtkWidget *button, const gchar *label_text);
 void gtk_expose_now(GtkWidget *w);
-void gtk_set_relative_position(GtkWidget *ref, GtkWidget *w, int px, int py);
+void set_relative_window_position(GtkWindow *ref, GtkWindow *w, int px, int 
py);
 
 void intl_slist(int n, const char **s, bool *done);
 

Modified: trunk/client/gui-gtk-3.x/helpdlg.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.x/helpdlg.c?rev=32137&r1=32136&r2=32137&view=diff
==============================================================================
--- trunk/client/gui-gtk-3.x/helpdlg.c  (original)
+++ trunk/client/gui-gtk-3.x/helpdlg.c  Tue Mar  1 02:44:32 2016
@@ -1,4 +1,4 @@
-/********************************************************************** 
+/**********************************************************************
  Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -170,15 +170,15 @@
 *****************************************************************/
 void popup_help_dialog_typed(const char *item, enum help_page_type htype)
 {
-  if(!help_dialog_shell) {
+  if (!help_dialog_shell) {
     create_help_dialog();
-    gtk_set_relative_position(toplevel, help_dialog_shell, 10, 10);
+    set_relative_window_position(GTK_WINDOW(toplevel),
+                                 GTK_WINDOW(help_dialog_shell), 10, 10);
   }
   gtk_window_present(GTK_WINDOW(help_dialog_shell));
 
   select_help_item_string(item, htype);
 }
-
 
 /****************************************************************
 Not sure if this should call Q_(item) as it does, or whether all


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to